NTI SNMP Plugin for Nagios

Nagios is an open source network monitoring tool that you might already be using or are familiar with. You can use it to receive Enviromux alerts. By using Nagios, you can monitor ENVIROMUX and your other network devices through the same interface.

Installing the Plugin
Plugins are usually installed in the libexec directory of your Nagios installation (i.e. /usr/local/nagios/libexec). Simply copy the plugin (check_nti_snmp.pl) to the libexec directory of your installation. Be sure to change its permissions to match those of the other plugins.

Configuring a Nagios Command
To add a Nagios command that calls the script, you must add the contents of Listing 1 to your Nagios configuration. The simplest method is to add the contents of Listing 1 to the file commands.cfg, which is often found in /usr/local/nagios/etc/object/commands.cfg.

Listing 1
# Command definition for Network Technologies Inc SNMP plugin
 define command{
       command_name    check_nti_snmp
       command_line    $USER1$/check_nti_snmp.pl -H $HOSTADDRESS$ $ARG1$

Generating a Product Configuration
To monitor NTI products with the NTI SNMP plugin for Nagios, you should first use the script to assist in generating a proper configuration. Using the script to generate the proper configuration greatly eases the burden of deciphering the MIB, interpreting sensor values, etc. View Listing 2 for example.

Listing 2
root@dev:/usr/local/nagios/libexec# ./check_nti_snmp.pl -m config

The script will then ask for some information required to generate a configuration, such as product type, IP address, and SNMP community string. The script can generate two types of configurations: one service for the entire device, and one service for each sensor. Generating one service for the entire device will create a single service entry in Nagios in which all sensors on the unit will be queried. Generating a service for each sensor will allow you finer grained control over which sensors are queried. View Listing 3 for example.

Listing 3
What product type are we configuring for Nagios?
        2) ENVIROMUX-SEMS-16
        3) IPDU-S2
Enter choice [1]: 1
Enter the IP address of the device:
Enter the SNMP community string [public]: public
Which type of service to generate?
        1) One service for the entire device
        2) One service for each sensor
Enter choice [1]: 1

After entering all requested information, the script will generate an appropriate configuration based on your input and print it to the screen. View Listing 4 for example.

Listing 4
# You need to define this command exactly once to monitor NTI products.
# define command{
#       command_name    check_nti_snmp
#       command_line    $USER1$/check_nti_snmp.pl -H $HOSTADDRESS$ $ARG1$
#       }

define host{
        use                    generic-host
        host_name              enviromuxMini_192.168.1.100
        alias                  ENVIROMUX-MINI
        max_check_attempts     5

define service{
        use                    generic-service
        host_name              enviromuxMini_192.168.1.100
        service_description    ALL_SENSORS
        check_command          check_nti_snmp!-m batch -C public -p enviromuxMini

Installing Product Configuration into Nagios
The configuration generated by the script must now be added to Nagios. One way to do this is to create a directory for all NTI product configurations and inform Nagios of this directory. For this example, we’ll add directory /usr/local/nagios/etc/objects/networktechinc/ to Nagios and then create a separate file for each device we wish to monitor. To do this, add the text as shown in Listing 5 to the file /usr/local/nagios/etc/nagios.cfg.

Listing 5
# Directory for Network Technologies Inc device configurations

Copy the previously generated configuration and place it in a new file in the directory /usr/local/nagios/etc/objects/networktechinc. You can give this file any name you wish. With this new file in place, you can now verify your configuration and restart Nagios. Your newly added devices and services should now be monitored with Nagios.

You can get more information regarding installing, configuring and troubleshooting the plugin install from the NTI SNMP Plugin for Nagios page.

This entry was posted in Application Note, Enterprise Server Environment Monitoring System, Insight and tagged , , , . Bookmark the permalink.

Leave a Reply