File check_disks of Package nagios-plugins-disks (Revision f4455fa4629121c05e606683f3786fdf)
Currently displaying revision f4455fa4629121c05e606683f3786fdf, show latest
1
#!/bin/bash
2
CHECK_MULTI_CMD_FILE="/tmp/check_disks.cmd"
3
CNT=0
4
5
rm -rf ${CHECK_MULTI_CMD_FILE}
6
7
for a in `grep -E '(xfs|ext2|ext3|ext4|btrfs|reiserfs|vfat|tmpfs|vzfs)' /proc/mounts | awk '{print $1}' | grep ^/` ; do
8
echo "command[check_disk_${CNT}]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p ${a}" >> ${CHECK_MULTI_CMD_FILE}
9
CNT=`expr ${CNT} + 1`
10
done
11
if [ -x /usr/lib/nagios/plugins/check_multi ] ; then
12
if [ -f ${CHECK_MULTI_CMD_FILE} ] ; then
13
/usr/lib/nagios/plugins/check_multi -f ${CHECK_MULTI_CMD_FILE} -s dont_be_paranoid=1
14
else
15
if [ -x /usr/lib/nagios/plugins/check_disk ] ; then
16
/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
17
else
18
echo "Couldn't find any valid filesystem to check and i'm unable to execute check_disk plugin"
19
exit 2
20
fi
21
fi
22
else
23
echo "Plugin: /usr/lib/nagios/plugins/check_multi not executable"
24
exit 2
25
fi
26