Monitoring Buffalo TeraStation NAS with Nagios

terastation01

Monitoring the storage usage in NAS devices is a key point to maintain the network functionality. What if the NAS where the backup saves its files run out of space? The backup fails and risk of data loss can be unpredictable.

To monitor Buffalo TeraStation family NAS devices, Nagios can help with the use of a dedicate plugin PHP based named check_terastation_storage.php.

 

Prerequisites

 

Nagios configuration

Download the plugin and copy it in the directory /var/lib64/nagios/plugins.

# cp check_terastation_storage.php /usr/lib64/nagios/plugins

Edit the Nagios configuration file checkcommands.cfg and insert the following lines:

define command {
command_name check_terastation_storage
command_line php /path/to/check_terastation_storage.php $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$
}

# vi /etc/nagios/checkcommands.cfg

terastation02

 

Usage

The plugin has to be used with the following syntax:

php check_terastation_storage.php IP_HOST COMMUNITY WARNING CRITICAL

Example: php check_terastation_storage.php 192.168.10.20 public 10 5

 

Testing the plugin

Prior testing the plugin from Nagios, you need to enable SNMP from the NAS device.

From TeraStation web console, select menu Network > SNMP enable click on Modify Settings button and enable SNMP Settings and set the SNMP community name as public then click Save.

terastation03

From Nagios console go to …/nagios/plugins directory and type the command.

# cd /usr/lib64/nagios/plugins
# php check_terastation_storage.php 192.168.10.20 public 10 5

terastation03

Opening the browser, Nagios displays information related to Storage Usage of TeraStation NAS devices.

terastation05

The monitoring system can now check the storage usage in order to notify the administrator for any concern.

buffalo terastation nagios 1