check_snmp_int.pl to check windows interfaces

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
amprantino
Posts: 140
Joined: Thu Apr 18, 2013 8:25 am
Location: libexec

check_snmp_int.pl to check windows interfaces

Post by amprantino »

Hello

I am trying to use check_snmp_int.pl to check windows interfaces.
The interfaces are named as:
................. interface omitted for brevity .................
OID : 1.3.6.1.2.1.2.2.1.2.8, Desc : WAN Miniport (IP)
OID : 1.3.6.1.2.1.2.2.1.2.12, Desc : Microsoft Hyper-V Network Adapter #2
OID : 1.3.6.1.2.1.2.2.1.2.17, Desc : Microsoft Hyper-V Network Adapter-QoS Packet Scheduler-0000
OID : 1.3.6.1.2.1.2.2.1.2.18, Desc : Microsoft Hyper-V Network Adapter-WFP LightWeight Filter-0000
OID : 1.3.6.1.2.1.2.2.1.2.20, Desc : WAN Miniport (IP)-QoS Packet Scheduler-0000
OID : 1.3.6.1.2.1.2.2.1.2.13, Desc : Microsoft Hyper-V Network Adapter
OID : 1.3.6.1.2.1.2.2.1.2.11, Desc : Microsoft Hyper-V Network Adapter
I think the script is comparing internally the description like this:

Code: Select all

verb("Filter : $o_descr");
foreach my $key ( keys %$resultat) {
   verb("OID : $key, Desc : $$resultat{$key}");
   # test by regexp or exact match
   my $test = defined($o_noreg)
                ? $$resultat{$key} eq $o_descr
                : $$resultat{$key} =~ /$o_descr/
Any idea how to match the interfaces correctly?

Ι get more interfaces that I should:
./check_snmp_int.pl -H x.x.x.x -C SNMP_COMMUNITY -n "Microsoft Hyper-V Network Adapter #2"
Microsoft Hyper-V Network Adapter #2-WFP LightWeight Filter-0000:UP, Microsoft Hyper-V Network Adapter #2:NotPresent, Microsoft Hyper-V Network Adapter #2:UP, Microsoft Hyper-V Network Adapter #2-QoS Packet Scheduler-0000:UP: 1 int NOK : CRITICAL


Disabling the regex, the plugin fails:

./check_snmp_int.pl -H x.x.x.x -C SNMP_COMMUNITY -r -n "Microsoft Hyper-V Network Adapter #2"
ERROR : Unknown interface Microsoft Hyper-V Network Adapter #2
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_snmp_int.pl to check windows interfaces

Post by dwhitfield »

What exactly do you want to check...just that they exist? Have you looked at any other plugins on the exchange for this? Is SNMP a must?
amprantino
Posts: 140
Joined: Thu Apr 18, 2013 8:25 am
Location: libexec

Re: check_snmp_int.pl to check windows interfaces

Post by amprantino »

I would like to check if the interface is UP or DOWN.
amprantino
Posts: 140
Joined: Thu Apr 18, 2013 8:25 am
Location: libexec

Re: check_snmp_int.pl to check windows interfaces

Post by amprantino »

Which are the alternatives I have?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_snmp_int.pl to check windows interfaces

Post by dwhitfield »

WMI would be the obvious option: https://stackoverflow.com/questions/203 ... windows-pc

See also https://assets.nagios.com/downloads/nag ... ios-XI.pdf. While the document is written for XI, it will give you some basics for getting things set up.
Locked