Monitor Linux network interface traffic using nagios

To monitor network traffic on your systems using nagios there is the check_netio plugin on nagios exchange.

Here's the setup for debian systems:

Download the check_netio_1.1 to /usr/local/bin and test it. You will have to change paths, like this: check_netio_1.1_debian Copy this file to all your servers that you check by ssh.

You need these commands to enable netio checking for a hostgroups based configuration.

# 'ssh_netio' command definition                                                          
define command{                                                                           
        command_name ssh_netio                                                            
        command_line /usr/lib/nagios/plugins/check_by_ssh -H $HOSTADDRESS$ -C "/usr/local/bin/check_netio_1.1 -i $ARG1$"                                                            
}                                                                                         
define hostgroup {                                                                        
        hostgroup_name  netio-servers                                                     
        }                                                                                
define service{                                                                            use                             generic-service         ; Name of service template to use                                                                                 hostgroup_name                  netio-servers                                     
        service_description             NETIO                                             
        check_command                   ssh_netio!eth0                                           }                                                                           

To enable netio checking for a given host, add the entry netio-servers to the hostgroups of the host entry.

Restart nagios using /etc/init.d/nagios3 restart to make sure everything works. Nagios should check the NETIO service.

To enable nagiosgrapher display for the netio plugin copy the file check_netio_1.1_debian to /etc/nagiosgrapher/ngraph.d/extra/netio.ncfg

Restart nagiosgrapher and control /var/log/nagiosgrapher/ngraph.log. For every host where you enable netio checking, you should see the information that the config has been added.

Note:

  • If you run a bastille hardened server, the plugin call by ssh may fail because ifconfig can't be executed. Test it using

/usr/lib/nagios/plugins/check_by_ssh -H newton.ksk.ch -C '/usr/local/bin/check_netio_1.1 -i eth0'

~~LINKBACK~~

Enter your comment. Wiki syntax is allowed:
If you can't read the letters on the image, download this .wav file to get them read to you.