check_disk to check all drives

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

check_disk to check all drives

Postby mrak692 » Thu May 19, 2016 1:54 am

Hi All,

I have check disk with the following command. The other day my /var/log reached 95% however Nagios did not alert me. I wonder if my command only check / and does not check attached drive such as /var/log

Code: Select all
command[check_disks]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -C -W 20% -K 10% -p /


My file server file system as per below.

Code: Select all
# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      9.9G  6.1G  3.3G  65% /
udev            1.9G   12K  1.9G   1% /dev
tmpfs           376M  344K  375M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            1.9G   12K  1.9G   1% /run/shm
/dev/xvdb       4.0G   73M  3.7G   2% /mnt
/dev/xvdf       9.9G  3.6G  5.9G  38% /var/log


What I need is a disk check to give me warning when the usage or inode reached 80% and critical when reached 90% for all my drives.
mrak692
 
Posts: 1
Joined: Thu May 19, 2016 1:25 am

Re: check_disk to check all drives

Postby mcapra » Thu May 19, 2016 9:18 am

You could try this command definition (note the /* path at the end):

command[check_disks]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -C -W 20% -K 10% -p /*

Here's my test file system:
Code: Select all
[root@localhost boot]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        18G  4.1G   14G  23% /
devtmpfs        899M     0  899M   0% /dev
tmpfs           913M  440K  913M   1% /dev/shm
tmpfs           913M  9.0M  904M   1% /run
tmpfs           913M     0  913M   0% /sys/fs/cgroup
/dev/sda1       297M  295M  2.6M 100% /boot
tmpfs           183M  4.0K  183M   1% /run/user/42
tmpfs           183M  8.0K  183M   1% /run/user/1000
tmpfs           183M     0  183M   0% /run/user/0


Notice /dev/sda1 is at 100% capacity. Some sample outputs:

Code: Select all
[root@localhost libexec]# ./check_disk -w 20% -c 10% -p /
DISK OK - free space: / 13969 MB (77% inode=99%);| /=4151MB;14496;16308;0;18121


Code: Select all
[root@localhost libexec]# ./check_disk -w 20% -c 10% -p /*
DISK CRITICAL - free space: / 13969 MB (77% inode=99%); /boot 2 MB (0% inode=96%);| /=4151MB;14496;16308;0;18121 /boot=294MB;236;266;0;296
Former Nagios employee
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3600
Joined: Thu May 05, 2016 3:54 pm


Return to Community Support

Who is online

Users browsing this forum: Google [Bot] and 15 guests