Table of Contents

Name

nagios-check-diskfree - show free disk space

Synopsis

nagios-check-diskfree MOUNTPOINT [...]

Description

This program shows the available diskspace in percent for the filesystem on the given mountpoint.
On any error like i.e. not existing file/dir it prints "9999".
Its primary purpose is the usage as nagios remote plugin with net-snmp. Just add to snmpd.conf a single line like this:
extend .1.3.6.1.4.1.2021.80 dfroot /usr/sbin/nagios-check-diskfree / dfcheck_root

Any additional arguments are silently ignored and can be used as a mark for i.e. searching a snmpwalk output with less.
This program can also be used to check the existence of files, sockets, pipes and more because it just uses one stat-call.

Return Value

The return value is 1 on any errors. On success 0 is returned.

Examples

nagios-check-diskfree / snmp_check_df_root
nagios-check-diskfree /var/lib/mysql/mysql.sock dfvarmysql

Author

Frank Bergmann, http://www.tuxad.com


Table of Contents