Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
damned
bydamned, December 24, 2023
Hi, here's my version that works on my config, i changed some deprecated commands:
#!/bin/bash
#
# Created by Sebastian Grewe, Jammicron Technology
#
# Get count of raid arrays
RAID_DEVICES=$(grep ^md -c /proc/mdstat)
# Get count of degraded arrays
#RAID_STATUS=`grep "\[.*_.*\]" /proc/mdstat -c`
RAID_STATUS=$(grep -E "\[.*(=|>|\.).*\]" /proc/mdstat -c)
# Is an array currently recovering, get percentage of recovery
RAID_RECOVER=$(grep recovery /proc/mdstat | awk '{print $4}')
RAID_RESYNC=$(grep resync /proc/mdstat | awk '{print $4}')
RAID_CHECK=$(grep check /proc/mdstat | awk '{print $4}')
# Check raid status
# RAID recovers --> Warning
if [ -n "${RAID_RECOVER}" ]; then
#if [[ $RAID_RECOVER ]]; then
STATUS="WARNING - Checked $RAID_DEVICES arrays, recovering : $RAID_RECOVER"
EXIT=1
elif [ -n "${RAID_RESYNC}" ]; then
STATUS="WARNING - Checked $RAID_DEVICES arrays, resync : $RAID_RESYNC"
EXIT=1
elif [ -n "${RAID_CHECK}" ]; then
STATUS="OK - Checked $RAID_DEVICES arrays, check : $RAID_CHECK"
EXIT=0
# RAID ok
elif [ -n "${RAID_STATUS}" = "0" ]; then
STATUS="OK - Checked $RAID_DEVICES arrays."
EXIT=0
# All else critical, better save than sorry
else
EXTEND_RAID_STATUS=$(grep -E "\[.*(=|>|\.|_).*\]" /proc/mdstat | awk '{print $2}' | uniq -c | xargs echo)
STATUS="WARNING- Checked $RAID_DEVICES arrays, $RAID_STATUS have failed check: $EXTEND_RAID_STATUS "
EXIT=1
fi
# Status and quit
echo "$STATUS"
exit $EXIT
#!/bin/bash
#
# Created by Sebastian Grewe, Jammicron Technology
#
# Get count of raid arrays
RAID_DEVICES=$(grep ^md -c /proc/mdstat)
# Get count of degraded arrays
#RAID_STATUS=`grep "\[.*_.*\]" /proc/mdstat -c`
RAID_STATUS=$(grep -E "\[.*(=|>|\.).*\]" /proc/mdstat -c)
# Is an array currently recovering, get percentage of recovery
RAID_RECOVER=$(grep recovery /proc/mdstat | awk '{print $4}')
RAID_RESYNC=$(grep resync /proc/mdstat | awk '{print $4}')
RAID_CHECK=$(grep check /proc/mdstat | awk '{print $4}')
# Check raid status
# RAID recovers --> Warning
if [ -n "${RAID_RECOVER}" ]; then
#if [[ $RAID_RECOVER ]]; then
STATUS="WARNING - Checked $RAID_DEVICES arrays, recovering : $RAID_RECOVER"
EXIT=1
elif [ -n "${RAID_RESYNC}" ]; then
STATUS="WARNING - Checked $RAID_DEVICES arrays, resync : $RAID_RESYNC"
EXIT=1
elif [ -n "${RAID_CHECK}" ]; then
STATUS="OK - Checked $RAID_DEVICES arrays, check : $RAID_CHECK"
EXIT=0
# RAID ok
elif [ -n "${RAID_STATUS}" = "0" ]; then
STATUS="OK - Checked $RAID_DEVICES arrays."
EXIT=0
# All else critical, better save than sorry
else
EXTEND_RAID_STATUS=$(grep -E "\[.*(=|>|\.|_).*\]" /proc/mdstat | awk '{print $2}' | uniq -c | xargs echo)
STATUS="WARNING- Checked $RAID_DEVICES arrays, $RAID_STATUS have failed check: $EXTEND_RAID_STATUS "
EXIT=1
fi
# Status and quit
echo "$STATUS"
exit $EXIT
bydamned, September 27, 2021
please use this fork, very cool!
https://github.com/BaldMansMojo/check_vmware_esx/
https://github.com/BaldMansMojo/check_vmware_esx/
bydamned, July 15, 2021
bydamned, December 19, 2019
Great, it works very well and documentation is very complete!
bydamned, February 4, 2019
download don't work..
Great plugin!
I use to discover 6008 errors on windows machine..the infamous Blue Screen
I use to discover 6008 errors on windows machine..the infamous Blue Screen
bydamned, September 13, 2017
bydamned, May 17, 2017
and that's good, but there's a typo, change:
if($excludeVM -ne ""
to
if($excludeVM -ne "")
if($excludeVM -ne ""
to
if($excludeVM -ne "")
bydamned, January 26, 2017
Great, simple and very usefull.
Works also if ilo ethernet cable is disconnected.
Works also if ilo ethernet cable is disconnected.
bydamned, January 26, 2017
hard without any sort of documentation.
doesn't seem to work with a IBM 2005-16B
doesn't seem to work with a IBM 2005-16B
A very complete plugin but with some problems with big disks..
Volume #1: CRITICAL: Unknown, Total Size (bytes): 3.5, Free: 732.6 (20931%)|FreeSize_Volume-1=20931%;1;2;0;100
CRITICAL: Total:3TB - Used:2TB - Free:0GB = 79%|Used=2857.36;35;71;0;3590.00
Volume #1: CRITICAL: Unknown, Total Size (bytes): 3.5, Free: 732.6 (20931%)|FreeSize_Volume-1=20931%;1;2;0;100
CRITICAL: Total:3TB - Used:2TB - Free:0GB = 79%|Used=2857.36;35;71;0;3590.00
Owner's reply
Thanks for your feedback I check this part of code it's a possible bug.
bydamned, February 2, 2015
It does its job very well but is very slow..i had to increase all the services timeout in
/usr/local/nagios/etc/nagios.cfg
to get it working in nagiosxi
/usr/local/nagios/etc/nagios.cfg
to get it working in nagiosxi
bydamned, November 6, 2014
Great plugin, but there's an error..on the variable definition there are 'pw' and'pc' instead of 'tw' and 'tc' for the temperature variable.
bydamned, September 23, 2014
hi, i've got this error:
Failed test query: in Zapi::invoke, cannot connect to socket
what is belong to?
i copied the lib from the 5.1 sdk to /usr/lib/perl
Failed test query: in Zapi::invoke, cannot connect to socket
what is belong to?
i copied the lib from the 5.1 sdk to /usr/lib/perl