Home Directory Plugins Operating Systems Windows check_usolved_disks - Check usage on all disks

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

check_usolved_disks - Check usage on all disks

Rating
5 votes
Favoured:
0
Current Version
1.1
Last Release Date
2014-04-30
Compatible With
  • Nagios 3.x
License
GPL
Hits
28004
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
check_usolved_disks - Check usage on all disks
This PHP Nagios plugin automaticly detects all disks/partitions of a Windows or Linux operating system and checks the free space. You don't need a check for every disk and just can use this check that'll return all available disks on the system. If a system gets a new partition you don't need to change your check.

The plugin also returns performance data and you can exclude disks that you don't want to check.
You can download the latest version and see the full documentation on GitHub.

----------------------------------------------------------

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'
Reviews (2)
bysailci, August 31, 2015
0 of 1 people found this review helpful
I get -bash: ./check_usolved_disks.php: /usr/bin/php^M: bad interpreter: No such file or directory

I am new to this so any help would be appreciated.
Owner's reply

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

byThomasC., October 4, 2014
I am running it on a Ubuntu server with php5.
./check_usolved_disks.php -H 10.2.1.11 -C public -w 90 -c 95
returns nothing, no error, no output at all.
Owner's reply

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