check_snmp_int.pl to check windows interfaces

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

check_snmp_int.pl to check windows interfaces

Postby amprantino » Fri Jan 12, 2018 5:20 am

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
amprantino
 
Posts: 114
Joined: Thu Apr 18, 2013 8:25 am
Location: libexec

Re: check_snmp_int.pl to check windows interfaces

Postby dwhitfield » Fri Jan 12, 2018 4:41 pm

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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 4276
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC

Re: check_snmp_int.pl to check windows interfaces

Postby amprantino » Fri Jan 12, 2018 4:57 pm

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

Re: check_snmp_int.pl to check windows interfaces

Postby amprantino » Mon Jan 15, 2018 10:03 am

Which are the alternatives I have?
amprantino
 
Posts: 114
Joined: Thu Apr 18, 2013 8:25 am
Location: libexec

Re: check_snmp_int.pl to check windows interfaces

Postby dwhitfield » Mon Jan 15, 2018 1:06 pm

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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 4276
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC


Return to Nagios Core

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], sufibasis and 26 guests