Home Directory Plugins Network Protocols SNMP Advanced Network Interface Check - check_netint / check_snmp_netint

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

Directory Tree

Advanced Network Interface Check - check_netint / check_snmp_netint

Current Version
2.36 (stable) and 2.4a9 (beta)
Last Release Date
2012-11-30
Compatible With
  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI
  • Nagios Fusion
Owner
License
GPL
Hits
240051
Files:
FileDescription
check_snmp_netint.plcheck_snmp_netint.pl (2.23 - old release, Oct 08)
check_snmp_netint_21.plcheck_snmp_netint.pl (2.16 - old release, Feb 08)
check_snmp_netint.plcheck_snmp_netint.pl (2.36 - June 2012) - probably last 2.3 release, 2.4 beta coming soon
check_netint.plcheck_netint.pl (2.4a9 - Nov 2012) - this is a development release of a new version for testing, new features include support for checking linux interface locally, support for bulk snmp queries and more
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This plugin checks port status, STP, traffic and errors data of network interfaces. It is optimized for faster execution and has advanced support of cisco switches. Starting with 2.4 version it be used both with SNMP and run locally on linux servers. The plugin can use previous run perfdata for bandwidth calculations which avoids creation of temporary files.
This is a plugin for nagios to check network interfaces (network ports) on servers, switches and routers. Originally based on check_snmp_int.pl plugin it has extensive rewrites for performance improvements (caching improved execution time by up to 100%) and better support for cisco switches (cisco port names, port link and operational status data) and checking of STP (spanning tree protocol) status.

Possibly most feature is ability to calculate traffic & utilization data from counters without creation of temporary files as plugin can store and re-use previous performance data with -P option. More than one set of previous history data can be stored and used for calculation which gives more accurate results and smoother curve. For these features you can use '--pcount=?' parameter to control how many previous history data are to be used and '--delta=?' to set how often plugin runs on your system so that old data is not used for calculations. If you're using -P option to pass performance data back to plugin then you may (depending on version of nagios) also need to modify nagios.cfg and remove ' from illegal_macro_output_chars=`~$&|'"<> line, i.e. change to
illegal_macro_output_chars=`~$&|"<>

In version 2.4 (in beta until end of 2012) the plugin added support for checking network interfaces directly on linux machine without SNMP. This version also added support for SNMP bulk queries, which allows to check all ports on big switches. Starting this version specifying network port name or regex with -n is optional and by default plugin will check all ports together.

Thresholds are normally set with '-w' and '-c' options or you can use '-z' option if you just want to get performance data and utilization data but don't want to set thresholds.
Note that you may need to use -k and/or -q options to enable perf data output for graphing programs.

Documentation for this plugin is contained within header of the perl code (several pages long). You can also do check_snmp_netint --help and will get fairly good overview and what options should be used.
Reviews (26)
When trying in command line, I get output,
but using same command in Nagios 4.4.9 I just see
"no output on stdout".
Should'nt it write to some temporary files in e.g. /usr/local/nagios_temp ?
byjondi, December 19, 2017
This plugin is excellent and works fine on all our Centos 5 and Centos 6 servers. But it doesn't work on Centos 7 system.

Difference in output:

Centos 6:
# /sbin/check_netint -r -n eth1 -fYB -k -w4000,15000 -c10000,25000
eth1:UP (no usable data - 5 rows) (1 UP): OK

Centos 7:
# /sbin/check_netint -r -n enp5s0 -fYB -k -w4000,15000 -c10000,25000
ERROR : Unknown interface enp5s0

Can you help me?. I guess many people face the same on Centos versions higher than version 6.
Hi,

I want use this script to check spanning tree status (fwd, blk, etc ...) on Cisco switch.
I use rstp and there is different state for the same port on different vlan.

How can I check spanning tree state on different vlan ?

thx for your help
Hi.
I have a lot of servers with more than one interface(eth0,eth1,...) and some of them are down.
It's possible to monitor just the UP ones and to ignore the rest without using regexp ?
If I use "-n eth* " I cant figure how to ignore the interfaces that are down.
Thank you very much for the good work.
Below is the command output:

[root@gjvatwb1 libexec]# ./check_snmp_netint.pl -H 172.16.1.105 -C nocgnr -k -M -w5,5 -c8,8 -n "QLogic"

QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #128:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #135:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #135-Trend Micro NDIS 6.0 Filter driver-0000:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #131-QoS Packet Scheduler-0000:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #130-QoS Packet Scheduler-0000:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #128-WFP LightWeight Filter-0000:UP (no usable data - 5 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #135-QoS Packet Scheduler-0000:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #130:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #131-Trend Micro NDIS 6.0 Filter driver-0000:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #131-WFP LightWeight Filter-0000:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #128-Trend Micro NDIS 6.0 Filter driver-0000:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #128-QoS Packet Scheduler-0000:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #130-WFP LightWeight Filter-0000:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #135-WFP LightWeight Filter-0000:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #131:UP (no usable data - 4 rows) , QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #130-Trend Micro NDIS 6.0 Filter driver-0000:UP (no usable data - 4 rows) :(16 UP): OK |


This isn't the final result. Can I have final command, which should show total bandwidth utilization of single network interface?
was up and running in 10 minutes checking bandwidth on all my important trunk ports. good job!
bysstins, August 28, 2014
Does a good job. Pretty dizzying array of options to try and figure out. Have one combination that often results in illegal division by zero error. Any idea what that problem might be?

/ois/usr/nagios/libexec/check_netint.pl -n "eth" -S -k -e -f -w 80,80,2,2,2,2 -c 90,90,4,4,4,4 -q -d 10 -u
Use of uninitialized value $speed_metric in division (/) at /ois/usr/nagios/libexec/check_netint.pl line 2490.
Illegal division by zero at /ois/usr/nagios/libexec/check_netint.pl line 2490.
I had my first bandwidth check up and running 15 minutes after installing.

Initial usage:
Cisco 2921 router (my eline interface) bandwidth usage monitor... 10Mbps interface...

commands.cfg...
define command {
command_name check_eline_bw
command_line /usr/local/sbin/nagios-plugins/check_snmp_netint.pl -H $HOSTADDRESS$ -C -k -M -w5,5 -c8,8 -n $ARG1$
}

And then the service entry....
define service{
use generic-service
host_name ops_router
service_description Eline Bandwidth
check_command check_eline_bw!"GigabitEthernet0/1"
}
Hi, this is great plugin, but perfomrance data is not working. I moved to check_snmp_netint because in check_snmp_int is not working reqex matching name of interface, but on check_snmp_netint is not working perfomrance data generation so I am stuck. I try with command:

check_snmp_netint.pl -H xxx.xxx.xxx.xxx -C public -n "Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller$" -f

But I get only this output, where is missing performance data.

Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller:UP:(1 UP): OK |

I tried also -z option, but it is same. Can you help me what is needed to change?
Can you please help me solve a problem as sent in e-mail? I want to know exactly the command I use to monitor the traffic on Cisco interfaces, kind if 90Mbps is reached on interface an WARNING is generated etc.

But now the error is GigabitEthernet1/31:UP (no usable data - 201 rows) (1 UP): OK

Below my services.cfg

define service{
host_name br-spo-cbo-acc71
service_description Checagem de Trafego
check_command check_netint!GigabitEthernet1/31
max_check_attempts 3
normal_check_interval 2
retry_check_interval 2
check_period 24x7
notification_interval 28800
notification_period 24x7
notification_options w,c,r
contact_groups administrador
}

Below hosts.cfg

define host {
use switch ; Name of host template to use
host_name br-spo-cbo-acc71
alias hostfiber.com.br-10.99.0.71
hostgroups Infraestrutura
address 10.99.0.71
check_command check-host-alive
max_check_attempts 3
notification_interval 28800
notification_period 24x7
notification_options d,u,r
contact_groups administrador

}

Below my checkcommands:

# check_netint command definition
define command{
command_name check_netint
command_line /usr/lib64/nagios/plugins/check_netint.pl -H $HOSTADDRESS$ -C H0STL0C4T10N -2 -n $ARG1$ -f -Y -k -B -u -d -w 5,5 -c 90,90
}
bytmoensted, February 24, 2014
Really nice plugin for monitoring the status and bandwidth of switch ports for instance.

One addition i would like is this:
You can check the administrative status of an interface with -a, but i would like an option for the check to allways return OK for a port, even though it is down, if the interface is administratively down
For me unfortunately, I have an issue with an Enterasys S6 switch in that the description table is less than useful. Here is the results I get:

IF-MIB::ifDescr.52001 = STRING: Enterasys Networks, Inc. 1000BASE-SX Mini GBIC w/LC connector
IF-MIB::ifDescr.52002 = STRING: Enterasys Networks, Inc. 1000BASE-SX Mini GBIC w/LC connector
IF-MIB::ifDescr.52003 = STRING: Enterasys Networks, Inc. 1000BASE-SX Mini GBIC w/LC connector
IF-MIB::ifDescr.52004 = STRING: Enterasys Networks, Inc. 1000BASE-LX Mini GBIC w/LC connector

Or using the -v switch I get:

OID : 1.3.6.1.2.1.2.2.1.2.52004, Clean Desc : Enterasys Networks, Inc. 1000BASE-LX Mini GBIC w/LC connector, Raw Desc: Enterasys Networks, Inc. 1000BASE-LX Mini GBIC w/LC connector

As you can see…it is just the type of connector. The index name gives me this:

IF-MIB::ifIndex.52001 = INTEGER: 52001
IF-MIB::ifIndex.52002 = INTEGER: 52002
IF-MIB::ifIndex.52003 = INTEGER: 52003
IF-MIB::ifIndex.52004 = INTEGER: 52004

And I know that I need the last entry 52004 (blade module 5, port 4)…so is there a way that I can reference this directly? I've read the instructions in the top of the plugin, I've tried quite a few things, but I can't figure it out.

Would you be able to suggest anything I can look at to resolve this?

I've tried with versions 2.34, 2.36 and 2.4.
byYu, July 31, 2013
Can You add checking is really traffic on interface on-the-fly? Check in|out_octets, sleep timeout, check2. If (check2-check1) we have no traffic. "Speed" have slow variation.
hi,
I would like to use the full scope of functions with our HP switches.
maybe I do not understand all the parameters but when I do the following is the output something little.

. / check_snmp_netint.pl-H xxx.xxx.xxx.xxx-C public-n
VLANXXXX: UP: (1 UP): OK |

especially because there is no VLANXXXX.

the second is we use pnp4nagios. can we use the performance data for this?

thank you for your help!
Owner's reply

please debug this further using '-v' to see what interfaces are reported.

and VLANS have always been an issue actually, most vendors are not reporting this right in SNMP actually

Hi, thanks for the contribution :)
Does this plugin work with DLink switches?
Owner's reply

it should work with all network switches as long as vendor is supporting standard MIB (and most do).so just try it and report back only if it doesn't work

bypieruk, July 9, 2013
1 of 1 people found this review helpful
it's a great tool, but i can't make it work with performance graph, is this possible at all?
Owner's reply

That depends on graphing software but most do require custom templates or config to make it work. I've templates available for PNP and NagiosGrapher. To get this to work you need graphing software that would allow you to select which perf variables to graph (those that try to graph all will not work).

I changed a few oids to make it work with juniper FW ssg550 version 6.2
my $oper_table = '1.3.6.1.4.1.3224.9.1.1.5.';
my $in_octet_table = '1.3.6.1.4.1.3224.9.3.1.3.';
my $out_octet_table = '1.3.6.1.4.1.3224.9.3.1.5.';

also had to change the status to be 0 for Down
my %status=('UP'=>1,'DOWN'=>0,'TESTING'=>3,'UNKNOWN'=>4,'DORMANT'=>5,'NotPresent'=>6,'lowerLayerDown'=>7);
my %status_print=(1=>'UP',0=>'DOWN',3=>'TESTING',4=>'UNKNOWN',5=>'DORMANT',6=>'NotPresent',7=>'lowerLayerDown');

And finally the check command is for exmaple (i use another OID for the description table thats why the -n switch ):
./check_netint.pl -H xxx.xxx.xxx.xxx -C public -2 -N 1.3.6.1.4.1.3224.9.1.1.2 -n ethernet0/2.20 -k -B -M -Y -w10,10 -c 20,20

Great work willix! thanks!
Owner's reply

I'll add new --juniper option with above OIDs and settings. Thank you.

byjarduini, April 15, 2013
0 of 1 people found this review helpful
hi, im trying to use this plugin with rhel6.4 and it give me the next error:
./check_netint.pl -H 127.0.0.1 -C privado -2 -n eth0 -z
Use of uninitialized value within @oid_perf_inoct in hash element at ./check_netint.pl line 2023.
eth0:UP (1 UP): OK

Any ideas?
Thanks a lot
Javier
Owner's reply

Unsure. Contact me by email or open ticket at github and send output with debug info from "-v" and exact version number. Check_netint is currently going through active development and beta-testing so some versions may have errors that are fixed but also new errors, I'd probably need you to try newest dev version from github dev branch and test if it gives error there.

Hi,
Brilliant!
Could you add the following feature to your plugin:

Interface selection by using its index instead of its name?

Regards
Owner's reply

This is supported by specifying custom OID with -N. See example in plugin header how its done for Alteon.

bypws, August 28, 2012
This plugin has proven extremely valuable in detecting errors on redundant links. We're using it to monitor 600 inter-switch trunks on Cisco, Force10 and Dell switches.
Page 1 of 2