Network Connections, Stats and Bandwidth

Advanced Network Interface Check – check_netint / check_snmp_netint

Description:

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.

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

License

GPL


Project Files
Project Notes
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) Add a Review
Not working with Nagios 4.4.9
by kuchenmann, June 30, 2023

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 ?



Doesn't work on Centos7 :(
by jondi, December 31, 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.



check spanning tree state by vlan
by yanikku, October 31, 2017

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



Select interfaces you want to monitor
by sfinx, September 30, 2016

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.



Need to give Proper Network Card Name
by nishith, February 29, 2016

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?



I have been using this for a couple of years and it works gret
by adamgonzalez1984, September 30, 2015

was up and running in 10 minutes checking bandwidth on all my important trunk ports. good job!



Nice job
by sstins, August 31, 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.



15 minutes up and running
by TrevThorpe, July 31, 2014

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" }



Perfomance data not working
by magik, July 31, 2014

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?



Really nice but I'm getting problems
by Silva, July 31, 2014

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 }



Really useful
by tmoensted, February 28, 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



Problems with Enterasys
by blueandwhitehoops, September 30, 2013

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.



Great work
by Yu, 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.



it works with HP?
by Viperdriver2000, July 31, 2013

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!



Does it work with DLink?
by Hamzab, July 31, 2013

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



how to enable graph?
by pieruk, July 31, 2013

it's a great tool, but i can't make it work with performance graph, is this possible at all?



A few changes to work with Juniper.
by zan, June 30, 2013

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!



error
by jarduini, April 30, 2013

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



Interface selection by index
by IOxar, February 28, 2013

Hi, Brilliant! Could you add the following feature to your plugin: Interface selection by using its index instead of its name? Regards



Essential plugin
by pws, August 31, 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.



Works on Cisco SG 300
by FlynJets, July 31, 2012

Works with the Cisco SG-300. You need to specify the oid of the description table since the SG line doesn't use the standard Cisco ones. -N 1.3.6.1.2.1.31.1.1.1.1 -r is necessary if checking port 1 so you don't get port 10 as well.



Very nice plugin, some suggestions
by RedFish, June 30, 2012

Hi, I use this plugin a lot and I would like to make some suggestions. 1. When -f is used with --stp and --intspeed, I get stp and intspeed in the performance output, is there a way to avoid that ? (I tried with and without -S) 2. Checking the duplex mode could be great, for example by adding --intspeed=100Mb/full or 100Mb/half as options. Thanks anyway for that great software.



pnp4nagios template
by vvm7ua, May 31, 2012

William, you can add a template for pnp4nagios to the repository. template can be downloaded from my page - http://worm.org.ua/projects/nagios/



Fantastic plugin
by funa, February 29, 2012

This is a great SNMP plugin for switches and routers. Many features and great support.



Nice, good work
by Napsty, November 30, 2011

I've used check_snmp_int for a long time until I came across this 'fork'. Well it seems to be working good so far (tested on Cisco switches), but I'd like to have the possibility to output perfdata of the interface usage _without_ having to declare warning and critical thresholds (-k). If this feature could be added that would be great.



disappointing
by Majed, August 31, 2011

well it does show if the interface is up or down but it didn't work with bandwidth at least not on windows machines. in the command line it does give output with bandwidth and sometimes says no usable data - 37 rows. in nagios it just gives an unknown error for the command check line: /usr/bin/perl $USER1$/check_snmp_netint.pl -H 10.1.1.94 -C public -n Realtek -O 1.3.6.1.2.1.2.2.1.2 output: unknown 2 warning levels for bandwidth checks



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.6 (48)
Favorites
9
Views
239,596