Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Advanced Network Interface Check - check_netint / check_snmp_netint
- Nagios 2.x
- Nagios 3.x
- Nagios XI
- Nagios Fusion
File | Description |
---|---|
check_snmp_netint.pl | check_snmp_netint.pl (2.23 - old release, Oct 08) |
check_snmp_netint_21.pl | check_snmp_netint.pl (2.16 - old release, Feb 08) |
check_snmp_netint.pl | check_snmp_netint.pl (2.36 - June 2012) - probably last 2.3 release, 2.4 beta coming soon |
check_netint.pl | check_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 |
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!
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.
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 ?
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.
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
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.
[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?
/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.
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"
}
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?
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
}
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
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.
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!
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
Does this plugin work with DLink switches?
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
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).
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!
I'll add new --juniper option with above OIDs and settings. Thank you.
./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
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.
Brilliant!
Could you add the following feature to your plugin:
Interface selection by using its index instead of its name?
Regards
This is supported by specifying custom OID with -N. See example in plugin header how its done for Alteon.