Page 1 of 1

check_snmp_int.pl to check windows interfaces

Posted: Fri Jan 12, 2018 5:20 am
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

Re: check_snmp_int.pl to check windows interfaces

Posted: Fri Jan 12, 2018 4:41 pm
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?

Re: check_snmp_int.pl to check windows interfaces

Posted: Fri Jan 12, 2018 4:57 pm
by amprantino
I would like to check if the interface is UP or DOWN.

Re: check_snmp_int.pl to check windows interfaces

Posted: Mon Jan 15, 2018 10:03 am
by amprantino
Which are the alternatives I have?

Re: check_snmp_int.pl to check windows interfaces

Posted: Mon Jan 15, 2018 1:06 pm
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.