** Updated 1.6.2010** Check_all_disks

w. configuration file


This script checks all mounted filesystems. The script can be passed variables for warning, critical, and configuration file location but if you don't pass it these values, the script sets a default of 90% for warning, 95% for critical and /usr/local/ct/nagios/etc for the configuration file. The configuration file can be used to ignore filesystems:

/myfs IGNORE

and it can also be used to change the threshold of specific filesystems:

/temp CHANGE 10 30
/opt CHANGE 99 100

Comments can be included in the configuration file. You can use tabs or spaces in the configuration file.

When the script finds a file system that is critical, it sends the message to Nagios and exits.

When the script finds a file system that is in a warning state, it continues and then, in the end, notifies Nagios of all filesystems that are in this state.

NOTE: The script will behave very differently depending on what KSH shell you have. You should have the "real" AT&T shell for this to run consistently across all of your Linux servers. To that end, I have included the ATT KSH shell in this package. You can place it somewhere and call it att_ksh (or something) and then call it from your script. This way you don't disturb your existing KSH shell and scripts.

This script runs on AIX and HP-UX as well.  



  • Updated 1/6/2010

You can now pass the script -t PERCENTAGE or -t USAGE flag.  

-t PERCENTAGE - This will output the current percentage utilization for each file system.  Using this flag is required if you want to monitor the disks in Nagios. An example output is shown below.

ALLDISK OK - Storage capacity for all filessytems are fine. | /=40% /boot=20% /dev/shm=0%

-t USAGE - This is used to just output the disk used for each file system. On AIX, HP-UX, and other operating systems it is very easy (and is done frequently) to expand a file system when space begins to get tight. In these environments trending the disk utilization as a percentage doesn't really tell us anything and so it's better to trend the actual MB used.  

Note: passing the script this flag will force the script to ALWAYS exit successful.

So, don't use this flag if you want to be alerted when a threshold is crossed. This is just used when you want to trend the disk usage.  An example output:

ALLDISK OK - Storage capacity for all filessytems are fine. | /=87445948KB /boot=18506KB /dev/shm=0KB