Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_usolved_disks - Check usage on all disks
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
The plugin also returns performance data and you can exclude disks that you don't want to check.
----------------------------------------------------------
INSTALLATION:
Just copy the file check_usolved_disks.php into your Nagios plugin directory. For example into the path /usr/local/nagios/libexec/
Add execution permission for the nagios user on check_usolved_disks.php. If you have at least PHP 5 this plugin should run out-of-the-box.
Make sure to have the PHP SNMP module installed and enabled in your php.ini.
> apt-get install php5-snmp (Ubuntu, Debian, ...)
or
> yum install php-snmp (RedHat, CentOS, ...)
----------------------------------------------------------
USAGE:
If you are in the Nagios plugin directory execute this command:
./check_usolved_disks.php -H localhost -C public -w 90 -c 95
The output should look like this on a Linux machine:
Disks OK // / (37%), /boot (30%), /dev/shm (0%)
/ - Size: 50.61 GB / Used: 18.73 GB (37% used)
/boot - Size: 0.1 GB / Used: 0.03 GB (30% used)
/dev/shm - Size: 2.91 GB / Used: 0 GB (0% used)
On a Windows machine the output could look something like this:
Disks OK // C: (20.5%), D: (87.8%)
C: - Size: 59.66 GB / Used: 12.24 GB (20.5% used)
D: - Size: 80 GB / Used: 70.22 GB (87.8% used)
----------------------------------------------------------
ARGUMENTS:
-H (host address)
Give the host address with the IP address or FQDN
-C (snmp community)
Give the SNMP Community String
-w (warn)
Warning treshold in percent
-c (crit)
Critical treshold in percent
[-V (snmp version)]
Optional: SNMP version 1 or 2c are supported, if argument not given version 1 is used by default
[-P (perfdata)]
Optional: Give 'yes' as argument if you wish performace data output
[-E '(exclude partitions)']
Optional: Exclude partitions with a comma separated list on Windows like 'D:,E:' (with or without colon) or on Linux '/var,/tmp'
I am new to this so any help would be appreciated.
You somehow managed to save the file with windows line endings. If you download the raw file from GitHub it will work. So not an issue with the plugin itself :).
Here are some solutions if you want to change the line endings with several tools on your existing file:
http://stackoverflow.com/questions/14219092/bash-my-script-bin-bashm-bad-interpreter-no-such-file-or-directory
./check_usolved_disks.php -H 10.2.1.11 -C public -w 90 -c 95
returns nothing, no error, no output at all.
If there's no output, then the php5 snmp extension is missing on your installation (on the latest version of the plugin there's also a check if the snmp extension is available with an output).
Please check if the extension is properly installed and activated in your php.ini.
To install the module on Ubuntu use:
apt-get install php5-snmp
On distributions like RedHat use:
yum install php-snmp