Issue in wmi plus with nagios

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.
jeraldsm
Posts: 7
Joined: Tue Feb 07, 2017 8:40 am

Issue in wmi plus with nagios

Post by jeraldsm »

Hi,

We have to monitor few windows servers with existing nagios. So I tried testing WMI plus pluggin in my local VM.
Few checks i tried are working fine but the following 3 checks are not working and is badly needed.

1) checkcpu always shows the following output for every run

Code: Select all

[root@nagios ~]# /opt/omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checkcpu -w 1 -c 90  -H 192.168.100.56 -u wmiagent -p wmiagent
OK (Sample Period 1 sec) - Average CPU Utilisation Need at least 2 WMI samples%
2) checknetwork does not display anything.

Code: Select all

[root@nagios check_wmi_plus]# /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56  -u wmiagent -p wmiagent -w 20 -c 70 --nokeepstate
[root@nagios check_wmi_plus]# 
3) checkproc displays the following error:

Code: Select all

[root@nagios check_wmi_plus]# /opt/omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checkproc -s memory -a spoolsv%  -H 192.168.100.56 -u wmiagent -p wmiagent
WMI Query returned no data. The item you were looking for may NOT exist or the software that creates the WMI Class may not be running, or all data has been excluded.
[root@nagios check_wmi_plus]# /opt/omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checkproc -s cpu -a spoolsv%  -H 192.168.100.56 -u wmiagent -p wmiagent
WMI Query returned no data. The item you were looking for may NOT exist or the software that creates the WMI Class may not be running, or all data has been excluded.
Some of the working checks i tried:
checkmem, checkdrivesize, checkprocess

I have followed all steps of windows configuration mentioned in this document.
http://edcint.co.nz/checkwmiplus/?q=con ... owsfromop5

wmi plus version:
[root@nagios ~]# /opt/omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl --version
Version: 1.62

I have also tried rebuilding/resetting the wmic in windows 7 by following this link.
https://social.technet.microsoft.com/Fo ... nservergen

Note that I am using windows 7 home premium VM in my local for testing purpose before rolling it out to the actual windows servers.

It would be great if anyone can help me find the issue.
Last edited by dwhitfield on Fri Feb 17, 2017 11:07 am, edited 1 time in total.
Reason: marking with green check mark
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Issue in wmi plus with nagios

Post by rkennedy »

We're a bit limitd on the support we can provide since this is a third party plugin.

Does the testing on this page work properly? http://www.edcint.co.nz/checkwmiplus/?q=quickstart - specifically, the 'test wmic' part.

Then, let's test the plugin, you'll want to run it twice as mentioned to allow the WMI samples -

Code: Select all

Run this twice: check_wmi_plus.pl -H HOST -m checkcpu -u USER -p PASS
Expected Output: OK (Sample Period 26 sec) - Average CPU Utilisation 15.19%|'Avg CPU Utilisation'=15.19%; 
(remove the other parameters you currently have defined for testing, and format it as mentioned above.)
Former Nagios Employee
jeraldsm
Posts: 7
Joined: Tue Feb 07, 2017 8:40 am

Re: Issue in wmi plus with nagios

Post by jeraldsm »

HI,

1) checkcpu & 2 checkproc is working now after I have setup a windows server 2012 VM. Additionally, I had to add the monitoring user (wmiagent) to performance log users group. Not sure what has to be done in windows home premium as I couldn't find a group policy option.

Code: Select all

[root@nagios ~]# /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checkcpu -H 192.168.100.56  -u wmiagent -p WMI@mci -w 20 -c 70 
OK (Sample Period 668 sec) - Average CPU Utilisation 0.63%|'Avg CPU Utilisation'=0.63%;20;70; 

[root@nagios ~]# /opt/omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checkproc -s memory -a spoolsv%  -H 192.168.100.56 -u wmiagent -p WMI@mci
Found 1 Instance(s) of "spoolsv%" running. OK - spoolsv: Private Memory=3.547MB, Working Set=9.316MB, Virtual Memory=2,048.071GB|'Process Count'=1; 'PrivateMemory_spoolsv'=3719168Bytes; 'TotalWorkingSet_spoolsv'=9768960Bytes; 'VirtualMemory_spoolsv'=2199099097088Bytes; 


Now Please help me with the checknetwork issue.

While I execute the check in debug mode, there is some information, otherwise there is no output.

Code: Select all

[root@nagios ~]# /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56  -u wmiagent -p WMI@mci -w 20 -c 70 
[root@nagios ~]# 
[root@nagios ~]# 
[root@nagios ~]# 
[root@nagios ~]# /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56  -u wmiagent -p WMI@mci -w 20 -c 70  -d
Command Line (v1.62): /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56 -u USER -p PASS -w 20 -c 70 -d
Base Dir: /opt/omd/sites/jsm/lib/nagios/plugins/
Conf File Dir: /etc/check_wmi_plus
Loaded Conf File /etc/check_wmi_plus/check_wmi_plus.conf
WMI Ini Dir: /etc/check_wmi_plus/check_wmi_plus.d
Round #1 of 1
QUERY: /usr/bin/wmic '-U' 'USER%PASS' '--namespace' 'root/cimv2' '//192.168.100.56' 'select CurrentBandwidth,BytesReceivedPerSec,BytesSentPerSec,Name,Frequency_Sys100NS,OutputQueueLength,PacketsReceivedErrors,PacketsReceivedPerSec,PacketsSentPerSec,Timestamp_Sys100NS from Win32_PerfRawData_Tcpip_NetworkInterface'
OUTPUT: CLASS: Win32_PerfRawData_Tcpip_NetworkInterface
BytesReceivedPersec|BytesSentPersec|CurrentBandwidth|Frequency_Sys100NS|Name|OutputQueueLength|PacketsReceivedErrors|PacketsReceivedPersec|PacketsSentPersec|Timestamp_Sys100NS
2047|33056|1000000000|10000000|Intel[R] PRO_1000 MT Desktop Adapter|0|0|13|325|131310975140690000
366342|462900|1000000000|10000000|Intel[R] PRO_1000 MT Desktop Adapter _2|0|0|2708|2441|131310975140690000
0|0|100000|10000000|isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}|0|0|0|0|131310975140690000
0|0|100000|10000000|isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}|0|0|0|0|131310975140690000

COLUMNS(last index=9):BytesReceivedPersec|BytesSentPersec|CurrentBandwidth|Frequency_Sys100NS|Name|OutputQueueLength|PacketsReceivedErrors|PacketsReceivedPersec|PacketsSentPersec|Timestamp_Sys100NS
Now looking for (.*?)\n (use_split=1)
FIELDS (via Split):COLNAME=BytesReceivedPersec,FIELD=2047
COLNAME=BytesSentPersec,FIELD=33056
COLNAME=CurrentBandwidth,FIELD=1000000000
COLNAME=Frequency_Sys100NS,FIELD=10000000
COLNAME=Name,FIELD=Intel[R] PRO_1000 MT Desktop Adapter
COLNAME=OutputQueueLength,FIELD=0
COLNAME=PacketsReceivedErrors,FIELD=0
COLNAME=PacketsReceivedPersec,FIELD=13
COLNAME=PacketsSentPersec,FIELD=325
COLNAME=Timestamp_Sys100NS,FIELD=131310975140690000

Row Data Found OK
FIELDS (via Split):COLNAME=BytesReceivedPersec,FIELD=366342
COLNAME=BytesSentPersec,FIELD=462900
COLNAME=CurrentBandwidth,FIELD=1000000000
COLNAME=Frequency_Sys100NS,FIELD=10000000
COLNAME=Name,FIELD=Intel[R] PRO_1000 MT Desktop Adapter _2
COLNAME=OutputQueueLength,FIELD=0
COLNAME=PacketsReceivedErrors,FIELD=0
COLNAME=PacketsReceivedPersec,FIELD=2708
COLNAME=PacketsSentPersec,FIELD=2441
COLNAME=Timestamp_Sys100NS,FIELD=131310975140690000

Row Data Found OK
FIELDS (via Split):COLNAME=BytesReceivedPersec,FIELD=0
COLNAME=BytesSentPersec,FIELD=0
COLNAME=CurrentBandwidth,FIELD=100000
COLNAME=Frequency_Sys100NS,FIELD=10000000
COLNAME=Name,FIELD=isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}
COLNAME=OutputQueueLength,FIELD=0
COLNAME=PacketsReceivedErrors,FIELD=0
COLNAME=PacketsReceivedPersec,FIELD=0
COLNAME=PacketsSentPersec,FIELD=0
COLNAME=Timestamp_Sys100NS,FIELD=131310975140690000

Row Data Found OK
FIELDS (via Split):COLNAME=BytesReceivedPersec,FIELD=0
COLNAME=BytesSentPersec,FIELD=0
COLNAME=CurrentBandwidth,FIELD=100000
COLNAME=Frequency_Sys100NS,FIELD=10000000
COLNAME=Name,FIELD=isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}
COLNAME=OutputQueueLength,FIELD=0
COLNAME=PacketsReceivedErrors,FIELD=0
COLNAME=PacketsReceivedPersec,FIELD=0
COLNAME=PacketsSentPersec,FIELD=0
COLNAME=Timestamp_Sys100NS,FIELD=131310975140690000

Row Data Found OK
WMI DATA:$VAR1 = [
          [
            {
              'PacketsReceivedPersec' => '13',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131310975140690000',
              '_ChecksOK' => 1,
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '33056',
              '_ItemCount' => 4,
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
              'PacketsSentPersec' => '325',
              'BytesReceivedPersec' => '2047',
              'CurrentBandwidth' => '1000000000'
            },
            {
              'PacketsReceivedPersec' => '2708',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131310975140690000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '462900',
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
              'PacketsSentPersec' => '2441',
              'BytesReceivedPersec' => '366342',
              'CurrentBandwidth' => '1000000000'
            },
            {
              'PacketsReceivedPersec' => '0',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131310975140690000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
              'PacketsSentPersec' => '0',
              'BytesReceivedPersec' => '0',
              'CurrentBandwidth' => '100000'
            },
            {
              'PacketsReceivedPersec' => '0',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131310975140690000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
              'PacketsSentPersec' => '0',
              'BytesReceivedPersec' => '0',
              'CurrentBandwidth' => '100000'
            }
          ]
        ];
Performing Join on MWI data using Name (\W) to match to Description (\W) in data from select ipaddress,description,macaddress,ipsubnet,defaultipgateway,dhcpenabled,dhcpserver,dnsdomain,servicename from win32_networkadapterconfiguration where macaddress like '%:%'
Round #1 of 1
QUERY: /usr/bin/wmic '-U' 'USER%PASS' '--namespace' 'root/cimv2' '//192.168.100.56' 'select ipaddress,description,macaddress,ipsubnet,defaultipgateway,dhcpenabled,dhcpserver,dnsdomain,servicename from win32_networkadapterconfiguration where macaddress like "%:%"'
OUTPUT: CLASS: Win32_NetworkAdapterConfiguration
DefaultIPGateway|Description|DHCPEnabled|DHCPServer|DNSDomain|Index|IPAddress|IPSubnet|MACAddress|ServiceName
(10.0.2.2)|Intel(R) PRO/1000 MT Desktop Adapter|True|10.0.2.2|(null)|10|(10.0.2.15,fe80::81c5:5b60:1886:4b0)|(255.255.255.0,64)|08:00:27:B1:3C:D6|E1G60
NULL|Intel(R) PRO/1000 MT Desktop Adapter #2|False|(null)|(null)|13|(192.168.100.56,fe80::58b8:2343:9f57:84a6)|(255.255.255.0,64)|08:00:27:96:C6:01|E1G60

COLUMNS(last index=9):DefaultIPGateway|Description|DHCPEnabled|DHCPServer|DNSDomain|Index|IPAddress|IPSubnet|MACAddress|ServiceName
Now looking for (.*?)\n (use_split=1)
FIELDS (via Split):COLNAME=DefaultIPGateway,FIELD=(10.0.2.2)
COLNAME=Description,FIELD=Intel(R) PRO/1000 MT Desktop Adapter
COLNAME=DHCPEnabled,FIELD=True
COLNAME=DHCPServer,FIELD=10.0.2.2
COLNAME=DNSDomain,FIELD=(null)
COLNAME=Index,FIELD=10
COLNAME=IPAddress,FIELD=(10.0.2.15,fe80::81c5:5b60:1886:4b0)
COLNAME=IPSubnet,FIELD=(255.255.255.0,64)
COLNAME=MACAddress,FIELD=08:00:27:B1:3C:D6
COLNAME=ServiceName,FIELD=E1G60

Row Data Found OK
FIELDS (via Split):COLNAME=DefaultIPGateway,FIELD=NULL
COLNAME=Description,FIELD=Intel(R) PRO/1000 MT Desktop Adapter #2
COLNAME=DHCPEnabled,FIELD=False
COLNAME=DHCPServer,FIELD=(null)
COLNAME=DNSDomain,FIELD=(null)
COLNAME=Index,FIELD=13
COLNAME=IPAddress,FIELD=(192.168.100.56,fe80::58b8:2343:9f57:84a6)
COLNAME=IPSubnet,FIELD=(255.255.255.0,64)
COLNAME=MACAddress,FIELD=08:00:27:96:C6:01
COLNAME=ServiceName,FIELD=E1G60

Row Data Found OK
WMI DATA:$VAR1 = [
          [
            {
              'IPSubnet' => '(255.255.255.0,64)',
              'DefaultIPGateway' => '(10.0.2.2)',
              'ServiceName' => 'E1G60',
              'MACAddress' => '08:00:27:B1:3C:D6',
              'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
              'Index' => '10',
              '_ChecksOK' => 1,
              'DHCPEnabled' => 'True',
              'DNSDomain' => '(null)',
              '_ItemCount' => 2,
              'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
              'DHCPServer' => '10.0.2.2'
            },
            {
              'IPSubnet' => '(255.255.255.0,64)',
              'DefaultIPGateway' => 'NULL',
              'ServiceName' => 'E1G60',
              'MACAddress' => '08:00:27:96:C6:01',
              'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
              'Index' => '13',
              'DHCPEnabled' => 'False',
              'DNSDomain' => '(null)',
              'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
              'DHCPServer' => '(null)'
            }
          ]
        ];
Processing Query #0:
Will be looking for Extra Results in $VAR1 = [
          {
            'IPSubnet' => '(255.255.255.0,64)',
            'DefaultIPGateway' => '(10.0.2.2)',
            'ServiceName' => 'E1G60',
            'MACAddress' => '08:00:27:B1:3C:D6',
            'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
            'Index' => '10',
            '_ChecksOK' => 1,
            'DHCPEnabled' => 'True',
            'DNSDomain' => '(null)',
            '_ItemCount' => 2,
            'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
            'DHCPServer' => '10.0.2.2'
          },
          {
            'IPSubnet' => '(255.255.255.0,64)',
            'DefaultIPGateway' => 'NULL',
            'ServiceName' => 'E1G60',
            'MACAddress' => '08:00:27:96:C6:01',
            'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
            'Index' => '13',
            'DHCPEnabled' => 'False',
            'DNSDomain' => '(null)',
            'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
            'DHCPServer' => '(null)'
          }
        ];
Applying Regex \W on intel_r__pro_1000_mt_desktop_adapter and replacing with _ gives intel_r__pro_1000_mt_desktop_adapter
Applying Regex \W on intel_r__pro_1000_mt_desktop_adapter__2 and replacing with _ gives intel_r__pro_1000_mt_desktop_adapter__2
Extra Lookup Index for Query Number 0: $VAR1 = {
          'intel_r__pro_1000_mt_desktop_adapter__2' => 1,
          'intel_r__pro_1000_mt_desktop_adapter' => 0
        };
Processing Base Row #0: $VAR1 = {
          'PacketsReceivedPersec' => '13',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131310975140690000',
          '_ChecksOK' => 1,
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '33056',
          '_ItemCount' => 4,
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
          'PacketsSentPersec' => '325',
          'BytesReceivedPersec' => '2047',
          'CurrentBandwidth' => '1000000000'
        };

Applying Regex \W on intel_r__pro_1000_mt_desktop_adapter and replacing with _ gives intel_r__pro_1000_mt_desktop_adapter
Looking for intel_r__pro_1000_mt_desktop_adapter in Extra Data
Found Matching Data in Extra Row: 0
Giving: $VAR1 = {
          'DefaultIPGateway' => '(10.0.2.2)',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '13',
          'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          '_ChecksOK' => 1,
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          '_ItemCount' => 4,
          'BytesReceivedPersec' => '2047',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:B1:3C:D6',
          'Index' => '10',
          'Timestamp_Sys100NS' => '131310975140690000',
          'DHCPEnabled' => 'True',
          'BytesSentPersec' => '33056',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
          'DHCPServer' => '10.0.2.2',
          'PacketsSentPersec' => '325'
        };

Processing Base Row #1: $VAR1 = {
          'PacketsReceivedPersec' => '2708',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131310975140690000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '462900',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
          'PacketsSentPersec' => '2441',
          'BytesReceivedPersec' => '366342',
          'CurrentBandwidth' => '1000000000'
        };

Applying Regex \W on intel_r__pro_1000_mt_desktop_adapter__2 and replacing with _ gives intel_r__pro_1000_mt_desktop_adapter__2
Looking for intel_r__pro_1000_mt_desktop_adapter__2 in Extra Data
Found Matching Data in Extra Row: 1
Giving: $VAR1 = {
          'DefaultIPGateway' => 'NULL',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '2708',
          'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          'BytesReceivedPersec' => '366342',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:96:C6:01',
          'Index' => '13',
          'Timestamp_Sys100NS' => '131310975140690000',
          'DHCPEnabled' => 'False',
          'BytesSentPersec' => '462900',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
          'DHCPServer' => '(null)',
          'PacketsSentPersec' => '2441'
        };

Processing Base Row #2: $VAR1 = {
          'PacketsReceivedPersec' => '0',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131310975140690000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '0',
          'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
          'PacketsSentPersec' => '0',
          'BytesReceivedPersec' => '0',
          'CurrentBandwidth' => '100000'
        };

Applying Regex \W on isatap__ed08290f_f2a7_43e5_88f4_49f460368d14_ and replacing with _ gives isatap__ed08290f_f2a7_43e5_88f4_49f460368d14_
Looking for isatap__ed08290f_f2a7_43e5_88f4_49f460368d14_ in Extra Data
Could not match the base value isatap__ed08290f_f2a7_43e5_88f4_49f460368d14_ to an extra value
Processing Base Row #3: $VAR1 = {
          'PacketsReceivedPersec' => '0',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131310975140690000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '0',
          'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
          'PacketsSentPersec' => '0',
          'BytesReceivedPersec' => '0',
          'CurrentBandwidth' => '100000'
        };

Applying Regex \W on isatap__639f5095_6f42_42ea_93ad_046fb66e1fdc_ and replacing with _ gives isatap__639f5095_6f42_42ea_93ad_046fb66e1fdc_
Looking for isatap__639f5095_6f42_42ea_93ad_046fb66e1fdc_ in Extra Data
Could not match the base value isatap__639f5095_6f42_42ea_93ad_046fb66e1fdc_ to an extra value
Performing Join on MWI data using MACAddress () to match to MACAddress () in data from select macaddress,netconnectionID from win32_networkadapter where netconnectionid like '%'
Round #1 of 1
QUERY: /usr/bin/wmic '-U' 'USER%PASS' '--namespace' 'root/cimv2' '//192.168.100.56' 'select macaddress,netconnectionID from win32_networkadapter where netconnectionid like "%"'
OUTPUT: CLASS: Win32_NetworkAdapter
DeviceID|MACAddress|NetConnectionID
10|08:00:27:B1:3C:D6|Ethernet
13|08:00:27:96:C6:01|Ethernet 2

COLUMNS(last index=2):DeviceID|MACAddress|NetConnectionID
Now looking for (.*?)\n (use_split=1)
FIELDS (via Split):COLNAME=DeviceID,FIELD=10
COLNAME=MACAddress,FIELD=08:00:27:B1:3C:D6
COLNAME=NetConnectionID,FIELD=Ethernet

Row Data Found OK
FIELDS (via Split):COLNAME=DeviceID,FIELD=13
COLNAME=MACAddress,FIELD=08:00:27:96:C6:01
COLNAME=NetConnectionID,FIELD=Ethernet 2

Row Data Found OK
WMI DATA:$VAR1 = [
          [
            {
              '_ChecksOK' => 1,
              'DeviceID' => '10',
              'MACAddress' => '08:00:27:B1:3C:D6',
              'NetConnectionID' => 'Ethernet',
              '_ItemCount' => 2
            },
            {
              'DeviceID' => '13',
              'MACAddress' => '08:00:27:96:C6:01',
              'NetConnectionID' => 'Ethernet 2'
            }
          ]
        ];
Processing Query #0:
Will be looking for Extra Results in $VAR1 = [
          {
            '_ChecksOK' => 1,
            'DeviceID' => '10',
            'MACAddress' => '08:00:27:B1:3C:D6',
            'NetConnectionID' => 'Ethernet',
            '_ItemCount' => 2
          },
          {
            'DeviceID' => '13',
            'MACAddress' => '08:00:27:96:C6:01',
            'NetConnectionID' => 'Ethernet 2'
          }
        ];
Extra Lookup Index for Query Number 0: $VAR1 = {
          '08:00:27:96:c6:01' => 1,
          '08:00:27:b1:3c:d6' => 0
        };
Processing Base Row #0: $VAR1 = {
          'DefaultIPGateway' => '(10.0.2.2)',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '13',
          'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          '_ChecksOK' => 1,
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          '_ItemCount' => 4,
          'BytesReceivedPersec' => '2047',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:B1:3C:D6',
          'Index' => '10',
          'Timestamp_Sys100NS' => '131310975140690000',
          'DHCPEnabled' => 'True',
          'BytesSentPersec' => '33056',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
          'DHCPServer' => '10.0.2.2',
          'PacketsSentPersec' => '325'
        };

Looking for 08:00:27:b1:3c:d6 in Extra Data
Found Matching Data in Extra Row: 0
Giving: $VAR1 = {
          'DefaultIPGateway' => '(10.0.2.2)',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '13',
          'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          '_ChecksOK' => 1,
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          'NetConnectionID' => 'Ethernet',
          '_ItemCount' => 4,
          'BytesReceivedPersec' => '2047',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:B1:3C:D6',
          'Index' => '10',
          'Timestamp_Sys100NS' => '131310975140690000',
          'DeviceID' => '10',
          'DHCPEnabled' => 'True',
          'BytesSentPersec' => '33056',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
          'DHCPServer' => '10.0.2.2',
          'PacketsSentPersec' => '325'
        };

Processing Base Row #1: $VAR1 = {
          'DefaultIPGateway' => 'NULL',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '2708',
          'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          'BytesReceivedPersec' => '366342',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:96:C6:01',
          'Index' => '13',
          'Timestamp_Sys100NS' => '131310975140690000',
          'DHCPEnabled' => 'False',
          'BytesSentPersec' => '462900',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
          'DHCPServer' => '(null)',
          'PacketsSentPersec' => '2441'
        };

Looking for 08:00:27:96:c6:01 in Extra Data
Found Matching Data in Extra Row: 1
Giving: $VAR1 = {
          'DefaultIPGateway' => 'NULL',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '2708',
          'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          'NetConnectionID' => 'Ethernet 2',
          'BytesReceivedPersec' => '366342',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:96:C6:01',
          'Index' => '13',
          'Timestamp_Sys100NS' => '131310975140690000',
          'DeviceID' => '13',
          'DHCPEnabled' => 'False',
          'BytesSentPersec' => '462900',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
          'DHCPServer' => '(null)',
          'PacketsSentPersec' => '2441'
        };

Processing Base Row #2: $VAR1 = {
          'PacketsReceivedPersec' => '0',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131310975140690000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '0',
          'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
          'PacketsSentPersec' => '0',
          'BytesReceivedPersec' => '0',
          'CurrentBandwidth' => '100000'
        };

Looking for  in Extra Data
Could not match the base value  to an extra value
Processing Base Row #3: $VAR1 = {
          'PacketsReceivedPersec' => '0',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131310975140690000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '0',
          'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
          'PacketsSentPersec' => '0',
          'BytesReceivedPersec' => '0',
          'CurrentBandwidth' => '100000'
        };

Looking for  in Extra Data
Could not match the base value  to an extra value
Looking for a match to  in 'Intel[R] PRO_1000 MT Desktop Adapter' or 'Ethernet' or '(10.0.2.15,fe80::81c5:5b60:1886:4b0)' or '08:00:27:B1:3C:D6'
Looking for a match to  in 'Intel[R] PRO_1000 MT Desktop Adapter _2' or 'Ethernet 2' or '(192.168.100.56,fe80::58b8:2343:9f57:84a6)' or '08:00:27:96:C6:01'
Looking for a match to  in 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}' or '' or '' or ''
Looking for a match to  in 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}' or '' or '' or ''

jeraldsm
Posts: 7
Joined: Tue Feb 07, 2017 8:40 am

Re: Issue in wmi plus with nagios

Post by jeraldsm »

Hi,

1) checkcpu & 3) checkproc is working after i have tested in windows server 2012, Additionally I added the monitoring user (wmiagent) to performance log users group. Not sure what to do in windows 7 home premium where there is no such group policy. Anyways thats fine.


Now, Can you please help me with checknetwork issue with wmi plugin.
The check has some information while executed in debug mode, but shows no output otherwise.

Here is the command:

Code: Select all

[root@nagios ~]# /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56  -u wmiagent -p WMI@mci -w 20 -c 70 
[root@nagios ~]# 
[root@nagios ~]# 
[root@nagios ~]# 
[root@nagios ~]# /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56  -u wmiagent -p WMI@mci -w 20 -c 70  -d
Command Line (v1.62): /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56 -u USER -p PASS -w 20 -c 70 -d
Base Dir: /opt/omd/sites/jsm/lib/nagios/plugins/
Conf File Dir: /etc/check_wmi_plus
Loaded Conf File /etc/check_wmi_plus/check_wmi_plus.conf
WMI Ini Dir: /etc/check_wmi_plus/check_wmi_plus.d
Round #1 of 1
QUERY: /usr/bin/wmic '-U' 'USER%PASS' '--namespace' 'root/cimv2' '//192.168.100.56' 'select CurrentBandwidth,BytesReceivedPerSec,BytesSentPerSec,Name,Frequency_Sys100NS,OutputQueueLength,PacketsReceivedErrors,PacketsReceivedPerSec,PacketsSentPerSec,Timestamp_Sys100NS from Win32_PerfRawData_Tcpip_NetworkInterface'
OUTPUT: CLASS: Win32_PerfRawData_Tcpip_NetworkInterface
BytesReceivedPersec|BytesSentPersec|CurrentBandwidth|Frequency_Sys100NS|Name|OutputQueueLength|PacketsReceivedErrors|PacketsReceivedPersec|PacketsSentPersec|Timestamp_Sys100NS
2047|33056|1000000000|10000000|Intel[R] PRO_1000 MT Desktop Adapter|0|0|13|325|131310975140690000
366342|462900|1000000000|10000000|Intel[R] PRO_1000 MT Desktop Adapter _2|0|0|2708|2441|131310975140690000
0|0|100000|10000000|isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}|0|0|0|0|131310975140690000
0|0|100000|10000000|isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}|0|0|0|0|131310975140690000

COLUMNS(last index=9):BytesReceivedPersec|BytesSentPersec|CurrentBandwidth|Frequency_Sys100NS|Name|OutputQueueLength|PacketsReceivedErrors|PacketsReceivedPersec|PacketsSentPersec|Timestamp_Sys100NS
Now looking for (.*?)\n (use_split=1)
FIELDS (via Split):COLNAME=BytesReceivedPersec,FIELD=2047
COLNAME=BytesSentPersec,FIELD=33056
COLNAME=CurrentBandwidth,FIELD=1000000000
COLNAME=Frequency_Sys100NS,FIELD=10000000
COLNAME=Name,FIELD=Intel[R] PRO_1000 MT Desktop Adapter
COLNAME=OutputQueueLength,FIELD=0
COLNAME=PacketsReceivedErrors,FIELD=0
COLNAME=PacketsReceivedPersec,FIELD=13
COLNAME=PacketsSentPersec,FIELD=325
COLNAME=Timestamp_Sys100NS,FIELD=131310975140690000

Row Data Found OK
FIELDS (via Split):COLNAME=BytesReceivedPersec,FIELD=366342
COLNAME=BytesSentPersec,FIELD=462900
COLNAME=CurrentBandwidth,FIELD=1000000000
COLNAME=Frequency_Sys100NS,FIELD=10000000
COLNAME=Name,FIELD=Intel[R] PRO_1000 MT Desktop Adapter _2
COLNAME=OutputQueueLength,FIELD=0
COLNAME=PacketsReceivedErrors,FIELD=0
COLNAME=PacketsReceivedPersec,FIELD=2708
COLNAME=PacketsSentPersec,FIELD=2441
COLNAME=Timestamp_Sys100NS,FIELD=131310975140690000

Row Data Found OK
FIELDS (via Split):COLNAME=BytesReceivedPersec,FIELD=0
COLNAME=BytesSentPersec,FIELD=0
COLNAME=CurrentBandwidth,FIELD=100000
COLNAME=Frequency_Sys100NS,FIELD=10000000
COLNAME=Name,FIELD=isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}
COLNAME=OutputQueueLength,FIELD=0
COLNAME=PacketsReceivedErrors,FIELD=0
COLNAME=PacketsReceivedPersec,FIELD=0
COLNAME=PacketsSentPersec,FIELD=0
COLNAME=Timestamp_Sys100NS,FIELD=131310975140690000

Row Data Found OK
FIELDS (via Split):COLNAME=BytesReceivedPersec,FIELD=0
COLNAME=BytesSentPersec,FIELD=0
COLNAME=CurrentBandwidth,FIELD=100000
COLNAME=Frequency_Sys100NS,FIELD=10000000
COLNAME=Name,FIELD=isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}
COLNAME=OutputQueueLength,FIELD=0
COLNAME=PacketsReceivedErrors,FIELD=0
COLNAME=PacketsReceivedPersec,FIELD=0
COLNAME=PacketsSentPersec,FIELD=0
COLNAME=Timestamp_Sys100NS,FIELD=131310975140690000

Row Data Found OK
WMI DATA:$VAR1 = [
          [
            {
              'PacketsReceivedPersec' => '13',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131310975140690000',
              '_ChecksOK' => 1,
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '33056',
              '_ItemCount' => 4,
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
              'PacketsSentPersec' => '325',
              'BytesReceivedPersec' => '2047',
              'CurrentBandwidth' => '1000000000'
            },
            {
              'PacketsReceivedPersec' => '2708',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131310975140690000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '462900',
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
              'PacketsSentPersec' => '2441',
              'BytesReceivedPersec' => '366342',
              'CurrentBandwidth' => '1000000000'
            },
            {
              'PacketsReceivedPersec' => '0',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131310975140690000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
              'PacketsSentPersec' => '0',
              'BytesReceivedPersec' => '0',
              'CurrentBandwidth' => '100000'
            },
            {
              'PacketsReceivedPersec' => '0',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131310975140690000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
              'PacketsSentPersec' => '0',
              'BytesReceivedPersec' => '0',
              'CurrentBandwidth' => '100000'
            }
          ]
        ];
Performing Join on MWI data using Name (\W) to match to Description (\W) in data from select ipaddress,description,macaddress,ipsubnet,defaultipgateway,dhcpenabled,dhcpserver,dnsdomain,servicename from win32_networkadapterconfiguration where macaddress like '%:%'
Round #1 of 1
QUERY: /usr/bin/wmic '-U' 'USER%PASS' '--namespace' 'root/cimv2' '//192.168.100.56' 'select ipaddress,description,macaddress,ipsubnet,defaultipgateway,dhcpenabled,dhcpserver,dnsdomain,servicename from win32_networkadapterconfiguration where macaddress like "%:%"'
OUTPUT: CLASS: Win32_NetworkAdapterConfiguration
DefaultIPGateway|Description|DHCPEnabled|DHCPServer|DNSDomain|Index|IPAddress|IPSubnet|MACAddress|ServiceName
(10.0.2.2)|Intel(R) PRO/1000 MT Desktop Adapter|True|10.0.2.2|(null)|10|(10.0.2.15,fe80::81c5:5b60:1886:4b0)|(255.255.255.0,64)|08:00:27:B1:3C:D6|E1G60
NULL|Intel(R) PRO/1000 MT Desktop Adapter #2|False|(null)|(null)|13|(192.168.100.56,fe80::58b8:2343:9f57:84a6)|(255.255.255.0,64)|08:00:27:96:C6:01|E1G60

COLUMNS(last index=9):DefaultIPGateway|Description|DHCPEnabled|DHCPServer|DNSDomain|Index|IPAddress|IPSubnet|MACAddress|ServiceName
Now looking for (.*?)\n (use_split=1)
FIELDS (via Split):COLNAME=DefaultIPGateway,FIELD=(10.0.2.2)
COLNAME=Description,FIELD=Intel(R) PRO/1000 MT Desktop Adapter
COLNAME=DHCPEnabled,FIELD=True
COLNAME=DHCPServer,FIELD=10.0.2.2
COLNAME=DNSDomain,FIELD=(null)
COLNAME=Index,FIELD=10
COLNAME=IPAddress,FIELD=(10.0.2.15,fe80::81c5:5b60:1886:4b0)
COLNAME=IPSubnet,FIELD=(255.255.255.0,64)
COLNAME=MACAddress,FIELD=08:00:27:B1:3C:D6
COLNAME=ServiceName,FIELD=E1G60

Row Data Found OK
FIELDS (via Split):COLNAME=DefaultIPGateway,FIELD=NULL
COLNAME=Description,FIELD=Intel(R) PRO/1000 MT Desktop Adapter #2
COLNAME=DHCPEnabled,FIELD=False
COLNAME=DHCPServer,FIELD=(null)
COLNAME=DNSDomain,FIELD=(null)
COLNAME=Index,FIELD=13
COLNAME=IPAddress,FIELD=(192.168.100.56,fe80::58b8:2343:9f57:84a6)
COLNAME=IPSubnet,FIELD=(255.255.255.0,64)
COLNAME=MACAddress,FIELD=08:00:27:96:C6:01
COLNAME=ServiceName,FIELD=E1G60

Row Data Found OK
WMI DATA:$VAR1 = [
          [
            {
              'IPSubnet' => '(255.255.255.0,64)',
              'DefaultIPGateway' => '(10.0.2.2)',
              'ServiceName' => 'E1G60',
              'MACAddress' => '08:00:27:B1:3C:D6',
              'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
              'Index' => '10',
              '_ChecksOK' => 1,
              'DHCPEnabled' => 'True',
              'DNSDomain' => '(null)',
              '_ItemCount' => 2,
              'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
              'DHCPServer' => '10.0.2.2'
            },
            {
              'IPSubnet' => '(255.255.255.0,64)',
              'DefaultIPGateway' => 'NULL',
              'ServiceName' => 'E1G60',
              'MACAddress' => '08:00:27:96:C6:01',
              'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
              'Index' => '13',
              'DHCPEnabled' => 'False',
              'DNSDomain' => '(null)',
              'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
              'DHCPServer' => '(null)'
            }
          ]
        ];
Processing Query #0:
Will be looking for Extra Results in $VAR1 = [
          {
            'IPSubnet' => '(255.255.255.0,64)',
            'DefaultIPGateway' => '(10.0.2.2)',
            'ServiceName' => 'E1G60',
            'MACAddress' => '08:00:27:B1:3C:D6',
            'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
            'Index' => '10',
            '_ChecksOK' => 1,
            'DHCPEnabled' => 'True',
            'DNSDomain' => '(null)',
            '_ItemCount' => 2,
            'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
            'DHCPServer' => '10.0.2.2'
          },
          {
            'IPSubnet' => '(255.255.255.0,64)',
            'DefaultIPGateway' => 'NULL',
            'ServiceName' => 'E1G60',
            'MACAddress' => '08:00:27:96:C6:01',
            'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
            'Index' => '13',
            'DHCPEnabled' => 'False',
            'DNSDomain' => '(null)',
            'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
            'DHCPServer' => '(null)'
          }
        ];
Applying Regex \W on intel_r__pro_1000_mt_desktop_adapter and replacing with _ gives intel_r__pro_1000_mt_desktop_adapter
Applying Regex \W on intel_r__pro_1000_mt_desktop_adapter__2 and replacing with _ gives intel_r__pro_1000_mt_desktop_adapter__2
Extra Lookup Index for Query Number 0: $VAR1 = {
          'intel_r__pro_1000_mt_desktop_adapter__2' => 1,
          'intel_r__pro_1000_mt_desktop_adapter' => 0
        };
Processing Base Row #0: $VAR1 = {
          'PacketsReceivedPersec' => '13',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131310975140690000',
          '_ChecksOK' => 1,
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '33056',
          '_ItemCount' => 4,
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
          'PacketsSentPersec' => '325',
          'BytesReceivedPersec' => '2047',
          'CurrentBandwidth' => '1000000000'
        };

Applying Regex \W on intel_r__pro_1000_mt_desktop_adapter and replacing with _ gives intel_r__pro_1000_mt_desktop_adapter
Looking for intel_r__pro_1000_mt_desktop_adapter in Extra Data
Found Matching Data in Extra Row: 0
Giving: $VAR1 = {
          'DefaultIPGateway' => '(10.0.2.2)',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '13',
          'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          '_ChecksOK' => 1,
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          '_ItemCount' => 4,
          'BytesReceivedPersec' => '2047',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:B1:3C:D6',
          'Index' => '10',
          'Timestamp_Sys100NS' => '131310975140690000',
          'DHCPEnabled' => 'True',
          'BytesSentPersec' => '33056',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
          'DHCPServer' => '10.0.2.2',
          'PacketsSentPersec' => '325'
        };

Processing Base Row #1: $VAR1 = {
          'PacketsReceivedPersec' => '2708',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131310975140690000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '462900',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
          'PacketsSentPersec' => '2441',
          'BytesReceivedPersec' => '366342',
          'CurrentBandwidth' => '1000000000'
        };

Applying Regex \W on intel_r__pro_1000_mt_desktop_adapter__2 and replacing with _ gives intel_r__pro_1000_mt_desktop_adapter__2
Looking for intel_r__pro_1000_mt_desktop_adapter__2 in Extra Data
Found Matching Data in Extra Row: 1
Giving: $VAR1 = {
          'DefaultIPGateway' => 'NULL',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '2708',
          'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          'BytesReceivedPersec' => '366342',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:96:C6:01',
          'Index' => '13',
          'Timestamp_Sys100NS' => '131310975140690000',
          'DHCPEnabled' => 'False',
          'BytesSentPersec' => '462900',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
          'DHCPServer' => '(null)',
          'PacketsSentPersec' => '2441'
        };

Processing Base Row #2: $VAR1 = {
          'PacketsReceivedPersec' => '0',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131310975140690000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '0',
          'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
          'PacketsSentPersec' => '0',
          'BytesReceivedPersec' => '0',
          'CurrentBandwidth' => '100000'
        };

Applying Regex \W on isatap__ed08290f_f2a7_43e5_88f4_49f460368d14_ and replacing with _ gives isatap__ed08290f_f2a7_43e5_88f4_49f460368d14_
Looking for isatap__ed08290f_f2a7_43e5_88f4_49f460368d14_ in Extra Data
Could not match the base value isatap__ed08290f_f2a7_43e5_88f4_49f460368d14_ to an extra value
Processing Base Row #3: $VAR1 = {
          'PacketsReceivedPersec' => '0',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131310975140690000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '0',
          'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
          'PacketsSentPersec' => '0',
          'BytesReceivedPersec' => '0',
          'CurrentBandwidth' => '100000'
        };

Applying Regex \W on isatap__639f5095_6f42_42ea_93ad_046fb66e1fdc_ and replacing with _ gives isatap__639f5095_6f42_42ea_93ad_046fb66e1fdc_
Looking for isatap__639f5095_6f42_42ea_93ad_046fb66e1fdc_ in Extra Data
Could not match the base value isatap__639f5095_6f42_42ea_93ad_046fb66e1fdc_ to an extra value
Performing Join on MWI data using MACAddress () to match to MACAddress () in data from select macaddress,netconnectionID from win32_networkadapter where netconnectionid like '%'
Round #1 of 1
QUERY: /usr/bin/wmic '-U' 'USER%PASS' '--namespace' 'root/cimv2' '//192.168.100.56' 'select macaddress,netconnectionID from win32_networkadapter where netconnectionid like "%"'
OUTPUT: CLASS: Win32_NetworkAdapter
DeviceID|MACAddress|NetConnectionID
10|08:00:27:B1:3C:D6|Ethernet
13|08:00:27:96:C6:01|Ethernet 2

COLUMNS(last index=2):DeviceID|MACAddress|NetConnectionID
Now looking for (.*?)\n (use_split=1)
FIELDS (via Split):COLNAME=DeviceID,FIELD=10
COLNAME=MACAddress,FIELD=08:00:27:B1:3C:D6
COLNAME=NetConnectionID,FIELD=Ethernet

Row Data Found OK
FIELDS (via Split):COLNAME=DeviceID,FIELD=13
COLNAME=MACAddress,FIELD=08:00:27:96:C6:01
COLNAME=NetConnectionID,FIELD=Ethernet 2

Row Data Found OK
WMI DATA:$VAR1 = [
          [
            {
              '_ChecksOK' => 1,
              'DeviceID' => '10',
              'MACAddress' => '08:00:27:B1:3C:D6',
              'NetConnectionID' => 'Ethernet',
              '_ItemCount' => 2
            },
            {
              'DeviceID' => '13',
              'MACAddress' => '08:00:27:96:C6:01',
              'NetConnectionID' => 'Ethernet 2'
            }
          ]
        ];
Processing Query #0:
Will be looking for Extra Results in $VAR1 = [
          {
            '_ChecksOK' => 1,
            'DeviceID' => '10',
            'MACAddress' => '08:00:27:B1:3C:D6',
            'NetConnectionID' => 'Ethernet',
            '_ItemCount' => 2
          },
          {
            'DeviceID' => '13',
            'MACAddress' => '08:00:27:96:C6:01',
            'NetConnectionID' => 'Ethernet 2'
          }
        ];
Extra Lookup Index for Query Number 0: $VAR1 = {
          '08:00:27:96:c6:01' => 1,
          '08:00:27:b1:3c:d6' => 0
        };
Processing Base Row #0: $VAR1 = {
          'DefaultIPGateway' => '(10.0.2.2)',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '13',
          'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          '_ChecksOK' => 1,
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          '_ItemCount' => 4,
          'BytesReceivedPersec' => '2047',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:B1:3C:D6',
          'Index' => '10',
          'Timestamp_Sys100NS' => '131310975140690000',
          'DHCPEnabled' => 'True',
          'BytesSentPersec' => '33056',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
          'DHCPServer' => '10.0.2.2',
          'PacketsSentPersec' => '325'
        };

Looking for 08:00:27:b1:3c:d6 in Extra Data
Found Matching Data in Extra Row: 0
Giving: $VAR1 = {
          'DefaultIPGateway' => '(10.0.2.2)',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '13',
          'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          '_ChecksOK' => 1,
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          'NetConnectionID' => 'Ethernet',
          '_ItemCount' => 4,
          'BytesReceivedPersec' => '2047',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:B1:3C:D6',
          'Index' => '10',
          'Timestamp_Sys100NS' => '131310975140690000',
          'DeviceID' => '10',
          'DHCPEnabled' => 'True',
          'BytesSentPersec' => '33056',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
          'DHCPServer' => '10.0.2.2',
          'PacketsSentPersec' => '325'
        };

Processing Base Row #1: $VAR1 = {
          'DefaultIPGateway' => 'NULL',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '2708',
          'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          'BytesReceivedPersec' => '366342',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:96:C6:01',
          'Index' => '13',
          'Timestamp_Sys100NS' => '131310975140690000',
          'DHCPEnabled' => 'False',
          'BytesSentPersec' => '462900',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
          'DHCPServer' => '(null)',
          'PacketsSentPersec' => '2441'
        };

Looking for 08:00:27:96:c6:01 in Extra Data
Found Matching Data in Extra Row: 1
Giving: $VAR1 = {
          'DefaultIPGateway' => 'NULL',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '2708',
          'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          'NetConnectionID' => 'Ethernet 2',
          'BytesReceivedPersec' => '366342',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:96:C6:01',
          'Index' => '13',
          'Timestamp_Sys100NS' => '131310975140690000',
          'DeviceID' => '13',
          'DHCPEnabled' => 'False',
          'BytesSentPersec' => '462900',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
          'DHCPServer' => '(null)',
          'PacketsSentPersec' => '2441'
        };

Processing Base Row #2: $VAR1 = {
          'PacketsReceivedPersec' => '0',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131310975140690000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '0',
          'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
          'PacketsSentPersec' => '0',
          'BytesReceivedPersec' => '0',
          'CurrentBandwidth' => '100000'
        };

Looking for  in Extra Data
Could not match the base value  to an extra value
Processing Base Row #3: $VAR1 = {
          'PacketsReceivedPersec' => '0',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131310975140690000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '0',
          'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
          'PacketsSentPersec' => '0',
          'BytesReceivedPersec' => '0',
          'CurrentBandwidth' => '100000'
        };

Looking for  in Extra Data
Could not match the base value  to an extra value
Looking for a match to  in 'Intel[R] PRO_1000 MT Desktop Adapter' or 'Ethernet' or '(10.0.2.15,fe80::81c5:5b60:1886:4b0)' or '08:00:27:B1:3C:D6'
Looking for a match to  in 'Intel[R] PRO_1000 MT Desktop Adapter _2' or 'Ethernet 2' or '(192.168.100.56,fe80::58b8:2343:9f57:84a6)' or '08:00:27:96:C6:01'
Looking for a match to  in 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}' or '' or '' or ''
Looking for a match to  in 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}' or '' or '' or ''

rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Issue in wmi plus with nagios

Post by rkennedy »

What happens if you specify a specific adapter?

Code: Select all

/omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56  -u wmiagent -p WMI@mci -w 20 -c 70  -a 'Intel[R] PRO_1000 MT Desktop Adapter'
Again, we are limited on the support we can provide here since this is a third party plugin, so you may need to do a bit of testing.
Former Nagios Employee
jeraldsm
Posts: 7
Joined: Tue Feb 07, 2017 8:40 am

Re: Issue in wmi plus with nagios

Post by jeraldsm »

Same as earilier , checknetwork has no output with the following command also.

Code: Select all

[root@nagios ~]# /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56  -u wmiagent -p WMI@mci -w 20 -c 70  -a 'Intel[R] PRO_1000 MT Desktop Adapter'
Collecting first WMI sample because the previous state data file (/tmp/cwpss_checknetwork__19216810056_IntelRPRO_1000MTDesktopAdapter__.state) contained no data. Results will be shown the next time the plugin runs.
[root@nagios ~]# 
[root@nagios ~]# 
[root@nagios ~]# /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56  -u wmiagent -p WMI@mci -w 20 -c 70  -a 'Intel[R] PRO_1000 MT Desktop Adapter'
Here is the debug mode for the same:

Code: Select all

[root@nagios ~]# /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56  -u wmiagent -p WMI@mci -w 20 -c 70  -a 'Intel[R] PRO_1000 MT Desktop Adapter' -d
Command Line (v1.62): /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56 -u USER -p PASS -w 20 -c 70 -a Intel[R] PRO_1000 MT Desktop Adapter -d
Base Dir: /opt/omd/sites/jsm/lib/nagios/plugins/
Conf File Dir: /etc/check_wmi_plus
Loaded Conf File /etc/check_wmi_plus/check_wmi_plus.conf
WMI Ini Dir: /etc/check_wmi_plus/check_wmi_plus.d
Starting Keep State Mode
STATE FILE: /tmp/cwpss_checknetwork__19216810056_IntelRPRO_1000MTDesktopAdapter__.state
Checking previous data's expiry - Timestamp 1486711099 vs Expiry After 1486708444 (Keep State Expiry setting is 3600sec)
Using Existing WMI DATA of:$VAR1 = [
          [
            {
              'PacketsReceivedPersec' => '5',
              'Frequency_Sys100NS' => '10000000',
              'OutputQueueLength' => '0',
              'Timestamp_Sys100NS' => '131311559006230000',
              '_KeepStateCreateTimestamp' => 1486711099,
              '_ChecksOK' => 1,
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '14692',
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
              '_ItemCount' => '4',
              'CurrentBandwidth' => '1000000000',
              'BytesReceivedPersec' => '882',
              'PacketsSentPersec' => '165'
            },
            {
              'PacketsReceivedPersec' => '115',
              'Frequency_Sys100NS' => '10000000',
              'OutputQueueLength' => '0',
              'Timestamp_Sys100NS' => '131311559006230000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '28108',
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
              'CurrentBandwidth' => '1000000000',
              'BytesReceivedPersec' => '14965',
              'PacketsSentPersec' => '213'
            },
            {
              'PacketsReceivedPersec' => '0',
              'Frequency_Sys100NS' => '10000000',
              'OutputQueueLength' => '0',
              'Timestamp_Sys100NS' => '131311559006230000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
              'CurrentBandwidth' => '100000',
              'BytesReceivedPersec' => '0',
              'PacketsSentPersec' => '0'
            },
            {
              'PacketsReceivedPersec' => '0',
              'Frequency_Sys100NS' => '10000000',
              'OutputQueueLength' => '0',
              'Timestamp_Sys100NS' => '131311559006230000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
              'CurrentBandwidth' => '100000',
              'BytesReceivedPersec' => '0',
              'PacketsSentPersec' => '0'
            }
          ]
        ];
Round #2 of 2
QUERY: /usr/bin/wmic '-U' 'USER%PASS' '--namespace' 'root/cimv2' '//192.168.100.56' 'select CurrentBandwidth,BytesReceivedPerSec,BytesSentPerSec,Name,Frequency_Sys100NS,OutputQueueLength,PacketsReceivedErrors,PacketsReceivedPerSec,PacketsSentPerSec,Timestamp_Sys100NS from Win32_PerfRawData_Tcpip_NetworkInterface'
OUTPUT: CLASS: Win32_PerfRawData_Tcpip_NetworkInterface
BytesReceivedPersec|BytesSentPersec|CurrentBandwidth|Frequency_Sys100NS|Name|OutputQueueLength|PacketsReceivedErrors|PacketsReceivedPersec|PacketsSentPersec|Timestamp_Sys100NS
882|17776|1000000000|10000000|Intel[R] PRO_1000 MT Desktop Adapter|0|0|5|183|131311568457050000
47580|67364|1000000000|10000000|Intel[R] PRO_1000 MT Desktop Adapter _2|0|0|384|453|131311568457050000
0|0|100000|10000000|isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}|0|0|0|0|131311568457050000
0|0|100000|10000000|isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}|0|0|0|0|131311568457050000

COLUMNS(last index=9):BytesReceivedPersec|BytesSentPersec|CurrentBandwidth|Frequency_Sys100NS|Name|OutputQueueLength|PacketsReceivedErrors|PacketsReceivedPersec|PacketsSentPersec|Timestamp_Sys100NS
Now looking for (.*?)\n (use_split=1)
FIELDS (via Split):COLNAME=BytesReceivedPersec,FIELD=882
COLNAME=BytesSentPersec,FIELD=17776
COLNAME=CurrentBandwidth,FIELD=1000000000
COLNAME=Frequency_Sys100NS,FIELD=10000000
COLNAME=Name,FIELD=Intel[R] PRO_1000 MT Desktop Adapter
COLNAME=OutputQueueLength,FIELD=0
COLNAME=PacketsReceivedErrors,FIELD=0
COLNAME=PacketsReceivedPersec,FIELD=5
COLNAME=PacketsSentPersec,FIELD=183
COLNAME=Timestamp_Sys100NS,FIELD=131311568457050000

Row Data Found OK
FIELDS (via Split):COLNAME=BytesReceivedPersec,FIELD=47580
COLNAME=BytesSentPersec,FIELD=67364
COLNAME=CurrentBandwidth,FIELD=1000000000
COLNAME=Frequency_Sys100NS,FIELD=10000000
COLNAME=Name,FIELD=Intel[R] PRO_1000 MT Desktop Adapter _2
COLNAME=OutputQueueLength,FIELD=0
COLNAME=PacketsReceivedErrors,FIELD=0
COLNAME=PacketsReceivedPersec,FIELD=384
COLNAME=PacketsSentPersec,FIELD=453
COLNAME=Timestamp_Sys100NS,FIELD=131311568457050000

Row Data Found OK
FIELDS (via Split):COLNAME=BytesReceivedPersec,FIELD=0
COLNAME=BytesSentPersec,FIELD=0
COLNAME=CurrentBandwidth,FIELD=100000
COLNAME=Frequency_Sys100NS,FIELD=10000000
COLNAME=Name,FIELD=isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}
COLNAME=OutputQueueLength,FIELD=0
COLNAME=PacketsReceivedErrors,FIELD=0
COLNAME=PacketsReceivedPersec,FIELD=0
COLNAME=PacketsSentPersec,FIELD=0
COLNAME=Timestamp_Sys100NS,FIELD=131311568457050000

Row Data Found OK
FIELDS (via Split):COLNAME=BytesReceivedPersec,FIELD=0
COLNAME=BytesSentPersec,FIELD=0
COLNAME=CurrentBandwidth,FIELD=100000
COLNAME=Frequency_Sys100NS,FIELD=10000000
COLNAME=Name,FIELD=isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}
COLNAME=OutputQueueLength,FIELD=0
COLNAME=PacketsReceivedErrors,FIELD=0
COLNAME=PacketsReceivedPersec,FIELD=0
COLNAME=PacketsSentPersec,FIELD=0
COLNAME=Timestamp_Sys100NS,FIELD=131311568457050000

Row Data Found OK
WMI DATA:$VAR1 = [
          [
            {
              'PacketsReceivedPersec' => '5',
              'Frequency_Sys100NS' => '10000000',
              'OutputQueueLength' => '0',
              'Timestamp_Sys100NS' => '131311559006230000',
              '_KeepStateCreateTimestamp' => 1486711099,
              '_KeepStateSamplePeriod' => 945,
              '_ChecksOK' => 2,
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '14692',
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
              '_ItemCount' => '4',
              'CurrentBandwidth' => '1000000000',
              'BytesReceivedPersec' => '882',
              'PacketsSentPersec' => '165'
            },
            {
              'PacketsReceivedPersec' => '115',
              'Frequency_Sys100NS' => '10000000',
              'OutputQueueLength' => '0',
              'Timestamp_Sys100NS' => '131311559006230000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '28108',
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
              'CurrentBandwidth' => '1000000000',
              'BytesReceivedPersec' => '14965',
              'PacketsSentPersec' => '213'
            },
            {
              'PacketsReceivedPersec' => '0',
              'Frequency_Sys100NS' => '10000000',
              'OutputQueueLength' => '0',
              'Timestamp_Sys100NS' => '131311559006230000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
              'CurrentBandwidth' => '100000',
              'BytesReceivedPersec' => '0',
              'PacketsSentPersec' => '0'
            },
            {
              'PacketsReceivedPersec' => '0',
              'Frequency_Sys100NS' => '10000000',
              'OutputQueueLength' => '0',
              'Timestamp_Sys100NS' => '131311559006230000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
              'CurrentBandwidth' => '100000',
              'BytesReceivedPersec' => '0',
              'PacketsSentPersec' => '0'
            }
          ],
          [
            {
              'PacketsReceivedPersec' => '5',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131311568457050000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '17776',
              '_ItemCount' => 4,
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
              'PacketsSentPersec' => '183',
              'BytesReceivedPersec' => '882',
              'CurrentBandwidth' => '1000000000'
            },
            {
              'PacketsReceivedPersec' => '384',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131311568457050000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '67364',
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
              'PacketsSentPersec' => '453',
              'BytesReceivedPersec' => '47580',
              'CurrentBandwidth' => '1000000000'
            },
            {
              'PacketsReceivedPersec' => '0',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131311568457050000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
              'PacketsSentPersec' => '0',
              'BytesReceivedPersec' => '0',
              'CurrentBandwidth' => '100000'
            },
            {
              'PacketsReceivedPersec' => '0',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131311568457050000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
              'PacketsSentPersec' => '0',
              'BytesReceivedPersec' => '0',
              'CurrentBandwidth' => '100000'
            }
          ]
        ];
Storing new WMI results in the state file $VAR1 = [
          [
            {
              'PacketsReceivedPersec' => '5',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131311568457050000',
              '_ChecksOK' => 1,
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '17776',
              '_ItemCount' => 4,
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
              'PacketsSentPersec' => '183',
              'BytesReceivedPersec' => '882',
              'CurrentBandwidth' => '1000000000'
            },
            {
              'PacketsReceivedPersec' => '384',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131311568457050000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '67364',
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
              'PacketsSentPersec' => '453',
              'BytesReceivedPersec' => '47580',
              'CurrentBandwidth' => '1000000000'
            },
            {
              'PacketsReceivedPersec' => '0',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131311568457050000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
              'PacketsSentPersec' => '0',
              'BytesReceivedPersec' => '0',
              'CurrentBandwidth' => '100000'
            },
            {
              'PacketsReceivedPersec' => '0',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131311568457050000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
              'PacketsSentPersec' => '0',
              'BytesReceivedPersec' => '0',
              'CurrentBandwidth' => '100000'
            }
          ]
        ];
Copying predefined fields to the last WMI result set [0] to [1]
NEW WMI DATA:$VAR1 = [
          [
            {
              'PacketsReceivedPersec' => '5',
              'Frequency_Sys100NS' => '10000000',
              'OutputQueueLength' => '0',
              'Timestamp_Sys100NS' => '131311559006230000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '14692',
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
              '_ItemCount' => '4',
              'CurrentBandwidth' => '1000000000',
              'BytesReceivedPersec' => '882',
              'PacketsSentPersec' => '165'
            },
            {
              'PacketsReceivedPersec' => '115',
              'Frequency_Sys100NS' => '10000000',
              'OutputQueueLength' => '0',
              'Timestamp_Sys100NS' => '131311559006230000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '28108',
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
              'CurrentBandwidth' => '1000000000',
              'BytesReceivedPersec' => '14965',
              'PacketsSentPersec' => '213'
            },
            {
              'PacketsReceivedPersec' => '0',
              'Frequency_Sys100NS' => '10000000',
              'OutputQueueLength' => '0',
              'Timestamp_Sys100NS' => '131311559006230000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
              'CurrentBandwidth' => '100000',
              'BytesReceivedPersec' => '0',
              'PacketsSentPersec' => '0'
            },
            {
              'PacketsReceivedPersec' => '0',
              'Frequency_Sys100NS' => '10000000',
              'OutputQueueLength' => '0',
              'Timestamp_Sys100NS' => '131311559006230000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
              'CurrentBandwidth' => '100000',
              'BytesReceivedPersec' => '0',
              'PacketsSentPersec' => '0'
            }
          ],
          [
            {
              'PacketsReceivedPersec' => '5',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131311568457050000',
              '_KeepStateCreateTimestamp' => 1486711099,
              '_KeepStateSamplePeriod' => 945,
              '_ChecksOK' => 2,
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '17776',
              '_ItemCount' => 4,
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
              'PacketsSentPersec' => '183',
              'BytesReceivedPersec' => '882',
              'CurrentBandwidth' => '1000000000'
            },
            {
              'PacketsReceivedPersec' => '384',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131311568457050000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '67364',
              'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
              'PacketsSentPersec' => '453',
              'BytesReceivedPersec' => '47580',
              'CurrentBandwidth' => '1000000000'
            },
            {
              'PacketsReceivedPersec' => '0',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131311568457050000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
              'PacketsSentPersec' => '0',
              'BytesReceivedPersec' => '0',
              'CurrentBandwidth' => '100000'
            },
            {
              'PacketsReceivedPersec' => '0',
              'OutputQueueLength' => '0',
              'Frequency_Sys100NS' => '10000000',
              'Timestamp_Sys100NS' => '131311568457050000',
              'PacketsReceivedErrors' => '0',
              'BytesSentPersec' => '0',
              'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
              'PacketsSentPersec' => '0',
              'BytesReceivedPersec' => '0',
              'CurrentBandwidth' => '100000'
            }
          ]
        ];
Performing Join on MWI data using Name (\W) to match to Description (\W) in data from select ipaddress,description,macaddress,ipsubnet,defaultipgateway,dhcpenabled,dhcpserver,dnsdomain,servicename from win32_networkadapterconfiguration where macaddress like '%:%'
Round #1 of 1
QUERY: /usr/bin/wmic '-U' 'USER%PASS' '--namespace' 'root/cimv2' '//192.168.100.56' 'select ipaddress,description,macaddress,ipsubnet,defaultipgateway,dhcpenabled,dhcpserver,dnsdomain,servicename from win32_networkadapterconfiguration where macaddress like "%:%"'
OUTPUT: CLASS: Win32_NetworkAdapterConfiguration
DefaultIPGateway|Description|DHCPEnabled|DHCPServer|DNSDomain|Index|IPAddress|IPSubnet|MACAddress|ServiceName
(10.0.2.2)|Intel(R) PRO/1000 MT Desktop Adapter|True|10.0.2.2|(null)|10|(10.0.2.15,fe80::81c5:5b60:1886:4b0)|(255.255.255.0,64)|08:00:27:B1:3C:D6|E1G60
NULL|Intel(R) PRO/1000 MT Desktop Adapter #2|False|(null)|(null)|13|(192.168.100.56,fe80::58b8:2343:9f57:84a6)|(255.255.255.0,64)|08:00:27:96:C6:01|E1G60

COLUMNS(last index=9):DefaultIPGateway|Description|DHCPEnabled|DHCPServer|DNSDomain|Index|IPAddress|IPSubnet|MACAddress|ServiceName
Now looking for (.*?)\n (use_split=1)
FIELDS (via Split):COLNAME=DefaultIPGateway,FIELD=(10.0.2.2)
COLNAME=Description,FIELD=Intel(R) PRO/1000 MT Desktop Adapter
COLNAME=DHCPEnabled,FIELD=True
COLNAME=DHCPServer,FIELD=10.0.2.2
COLNAME=DNSDomain,FIELD=(null)
COLNAME=Index,FIELD=10
COLNAME=IPAddress,FIELD=(10.0.2.15,fe80::81c5:5b60:1886:4b0)
COLNAME=IPSubnet,FIELD=(255.255.255.0,64)
COLNAME=MACAddress,FIELD=08:00:27:B1:3C:D6
COLNAME=ServiceName,FIELD=E1G60

Row Data Found OK
FIELDS (via Split):COLNAME=DefaultIPGateway,FIELD=NULL
COLNAME=Description,FIELD=Intel(R) PRO/1000 MT Desktop Adapter #2
COLNAME=DHCPEnabled,FIELD=False
COLNAME=DHCPServer,FIELD=(null)
COLNAME=DNSDomain,FIELD=(null)
COLNAME=Index,FIELD=13
COLNAME=IPAddress,FIELD=(192.168.100.56,fe80::58b8:2343:9f57:84a6)
COLNAME=IPSubnet,FIELD=(255.255.255.0,64)
COLNAME=MACAddress,FIELD=08:00:27:96:C6:01
COLNAME=ServiceName,FIELD=E1G60

Row Data Found OK
WMI DATA:$VAR1 = [
          [
            {
              'IPSubnet' => '(255.255.255.0,64)',
              'DefaultIPGateway' => '(10.0.2.2)',
              'ServiceName' => 'E1G60',
              'MACAddress' => '08:00:27:B1:3C:D6',
              'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
              'Index' => '10',
              '_ChecksOK' => 1,
              'DHCPEnabled' => 'True',
              'DNSDomain' => '(null)',
              '_ItemCount' => 2,
              'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
              'DHCPServer' => '10.0.2.2'
            },
            {
              'IPSubnet' => '(255.255.255.0,64)',
              'DefaultIPGateway' => 'NULL',
              'ServiceName' => 'E1G60',
              'MACAddress' => '08:00:27:96:C6:01',
              'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
              'Index' => '13',
              'DHCPEnabled' => 'False',
              'DNSDomain' => '(null)',
              'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
              'DHCPServer' => '(null)'
            }
          ]
        ];
Processing Query #1:
Will be looking for Extra Results in $VAR1 = undef;
Applying Regex \W on intel_r__pro_1000_mt_desktop_adapter and replacing with _ gives intel_r__pro_1000_mt_desktop_adapter
Applying Regex \W on intel_r__pro_1000_mt_desktop_adapter__2 and replacing with _ gives intel_r__pro_1000_mt_desktop_adapter__2
Extra Lookup Index for Query Number 1: $VAR1 = {
          'intel_r__pro_1000_mt_desktop_adapter__2' => 1,
          'intel_r__pro_1000_mt_desktop_adapter' => 0
        };
Processing Base Row #0: $VAR1 = {
          'PacketsReceivedPersec' => '5',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131311568457050000',
          '_KeepStateCreateTimestamp' => 1486711099,
          '_KeepStateSamplePeriod' => 945,
          '_ChecksOK' => 2,
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '17776',
          '_ItemCount' => 4,
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
          'PacketsSentPersec' => '183',
          'BytesReceivedPersec' => '882',
          'CurrentBandwidth' => '1000000000'
        };

Applying Regex \W on intel_r__pro_1000_mt_desktop_adapter and replacing with _ gives intel_r__pro_1000_mt_desktop_adapter
Looking for intel_r__pro_1000_mt_desktop_adapter in Extra Data
Found Matching Data in Extra Row: 0
Giving: $VAR1 = {
          'DefaultIPGateway' => '(10.0.2.2)',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '5',
          'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          '_KeepStateCreateTimestamp' => 1486711099,
          '_KeepStateSamplePeriod' => 945,
          '_ChecksOK' => 2,
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          '_ItemCount' => 4,
          'BytesReceivedPersec' => '882',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:B1:3C:D6',
          'Index' => '10',
          'Timestamp_Sys100NS' => '131311568457050000',
          'DHCPEnabled' => 'True',
          'BytesSentPersec' => '17776',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
          'DHCPServer' => '10.0.2.2',
          'PacketsSentPersec' => '183'
        };

Processing Base Row #1: $VAR1 = {
          'PacketsReceivedPersec' => '384',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131311568457050000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '67364',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
          'PacketsSentPersec' => '453',
          'BytesReceivedPersec' => '47580',
          'CurrentBandwidth' => '1000000000'
        };

Applying Regex \W on intel_r__pro_1000_mt_desktop_adapter__2 and replacing with _ gives intel_r__pro_1000_mt_desktop_adapter__2
Looking for intel_r__pro_1000_mt_desktop_adapter__2 in Extra Data
Found Matching Data in Extra Row: 1
Giving: $VAR1 = {
          'DefaultIPGateway' => 'NULL',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '384',
          'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          'BytesReceivedPersec' => '47580',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:96:C6:01',
          'Index' => '13',
          'Timestamp_Sys100NS' => '131311568457050000',
          'DHCPEnabled' => 'False',
          'BytesSentPersec' => '67364',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
          'DHCPServer' => '(null)',
          'PacketsSentPersec' => '453'
        };

Processing Base Row #2: $VAR1 = {
          'PacketsReceivedPersec' => '0',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131311568457050000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '0',
          'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
          'PacketsSentPersec' => '0',
          'BytesReceivedPersec' => '0',
          'CurrentBandwidth' => '100000'
        };

Applying Regex \W on isatap__ed08290f_f2a7_43e5_88f4_49f460368d14_ and replacing with _ gives isatap__ed08290f_f2a7_43e5_88f4_49f460368d14_
Looking for isatap__ed08290f_f2a7_43e5_88f4_49f460368d14_ in Extra Data
Could not match the base value isatap__ed08290f_f2a7_43e5_88f4_49f460368d14_ to an extra value
Processing Base Row #3: $VAR1 = {
          'PacketsReceivedPersec' => '0',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131311568457050000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '0',
          'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
          'PacketsSentPersec' => '0',
          'BytesReceivedPersec' => '0',
          'CurrentBandwidth' => '100000'
        };

Applying Regex \W on isatap__639f5095_6f42_42ea_93ad_046fb66e1fdc_ and replacing with _ gives isatap__639f5095_6f42_42ea_93ad_046fb66e1fdc_
Looking for isatap__639f5095_6f42_42ea_93ad_046fb66e1fdc_ in Extra Data
Could not match the base value isatap__639f5095_6f42_42ea_93ad_046fb66e1fdc_ to an extra value
Performing Join on MWI data using MACAddress () to match to MACAddress () in data from select macaddress,netconnectionID from win32_networkadapter where netconnectionid like '%'
Round #1 of 1
QUERY: /usr/bin/wmic '-U' 'USER%PASS' '--namespace' 'root/cimv2' '//192.168.100.56' 'select macaddress,netconnectionID from win32_networkadapter where netconnectionid like "%"'
OUTPUT: CLASS: Win32_NetworkAdapter
DeviceID|MACAddress|NetConnectionID
10|08:00:27:B1:3C:D6|Ethernet
13|08:00:27:96:C6:01|Ethernet 2

COLUMNS(last index=2):DeviceID|MACAddress|NetConnectionID
Now looking for (.*?)\n (use_split=1)
FIELDS (via Split):COLNAME=DeviceID,FIELD=10
COLNAME=MACAddress,FIELD=08:00:27:B1:3C:D6
COLNAME=NetConnectionID,FIELD=Ethernet

Row Data Found OK
FIELDS (via Split):COLNAME=DeviceID,FIELD=13
COLNAME=MACAddress,FIELD=08:00:27:96:C6:01
COLNAME=NetConnectionID,FIELD=Ethernet 2

Row Data Found OK
WMI DATA:$VAR1 = [
          [
            {
              '_ChecksOK' => 1,
              'DeviceID' => '10',
              'MACAddress' => '08:00:27:B1:3C:D6',
              'NetConnectionID' => 'Ethernet',
              '_ItemCount' => 2
            },
            {
              'DeviceID' => '13',
              'MACAddress' => '08:00:27:96:C6:01',
              'NetConnectionID' => 'Ethernet 2'
            }
          ]
        ];
Processing Query #1:
Will be looking for Extra Results in $VAR1 = undef;
Extra Lookup Index for Query Number 1: $VAR1 = {
          '08:00:27:96:c6:01' => 1,
          '08:00:27:b1:3c:d6' => 0
        };
Processing Base Row #0: $VAR1 = {
          'DefaultIPGateway' => '(10.0.2.2)',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '5',
          'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          '_KeepStateCreateTimestamp' => 1486711099,
          '_KeepStateSamplePeriod' => 945,
          '_ChecksOK' => 2,
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          '_ItemCount' => 4,
          'BytesReceivedPersec' => '882',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:B1:3C:D6',
          'Index' => '10',
          'Timestamp_Sys100NS' => '131311568457050000',
          'DHCPEnabled' => 'True',
          'BytesSentPersec' => '17776',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
          'DHCPServer' => '10.0.2.2',
          'PacketsSentPersec' => '183'
        };

Looking for 08:00:27:b1:3c:d6 in Extra Data
Found Matching Data in Extra Row: 0
Giving: $VAR1 = {
          'DefaultIPGateway' => '(10.0.2.2)',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '5',
          'IPAddress' => '(10.0.2.15,fe80::81c5:5b60:1886:4b0)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          '_KeepStateCreateTimestamp' => 1486711099,
          '_KeepStateSamplePeriod' => 945,
          '_ChecksOK' => 2,
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          'NetConnectionID' => 'Ethernet',
          '_ItemCount' => 4,
          'BytesReceivedPersec' => '882',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:B1:3C:D6',
          'Index' => '10',
          'Timestamp_Sys100NS' => '131311568457050000',
          'DeviceID' => '10',
          'DHCPEnabled' => 'True',
          'BytesSentPersec' => '17776',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter',
          'DHCPServer' => '10.0.2.2',
          'PacketsSentPersec' => '183'
        };

Processing Base Row #1: $VAR1 = {
          'DefaultIPGateway' => 'NULL',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '384',
          'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          'BytesReceivedPersec' => '47580',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:96:C6:01',
          'Index' => '13',
          'Timestamp_Sys100NS' => '131311568457050000',
          'DHCPEnabled' => 'False',
          'BytesSentPersec' => '67364',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
          'DHCPServer' => '(null)',
          'PacketsSentPersec' => '453'
        };

Looking for 08:00:27:96:c6:01 in Extra Data
Found Matching Data in Extra Row: 1
Giving: $VAR1 = {
          'DefaultIPGateway' => 'NULL',
          'IPSubnet' => '(255.255.255.0,64)',
          'PacketsReceivedPersec' => '384',
          'IPAddress' => '(192.168.100.56,fe80::58b8:2343:9f57:84a6)',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'PacketsReceivedErrors' => '0',
          'DNSDomain' => '(null)',
          'NetConnectionID' => 'Ethernet 2',
          'BytesReceivedPersec' => '47580',
          'CurrentBandwidth' => '1000000000',
          'ServiceName' => 'E1G60',
          'MACAddress' => '08:00:27:96:C6:01',
          'Index' => '13',
          'Timestamp_Sys100NS' => '131311568457050000',
          'DeviceID' => '13',
          'DHCPEnabled' => 'False',
          'BytesSentPersec' => '67364',
          'Description' => 'Intel(R) PRO/1000 MT Desktop Adapter #2',
          'Name' => 'Intel[R] PRO_1000 MT Desktop Adapter _2',
          'DHCPServer' => '(null)',
          'PacketsSentPersec' => '453'
        };

Processing Base Row #2: $VAR1 = {
          'PacketsReceivedPersec' => '0',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131311568457050000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '0',
          'Name' => 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}',
          'PacketsSentPersec' => '0',
          'BytesReceivedPersec' => '0',
          'CurrentBandwidth' => '100000'
        };

Looking for  in Extra Data
Could not match the base value  to an extra value
Processing Base Row #3: $VAR1 = {
          'PacketsReceivedPersec' => '0',
          'OutputQueueLength' => '0',
          'Frequency_Sys100NS' => '10000000',
          'Timestamp_Sys100NS' => '131311568457050000',
          'PacketsReceivedErrors' => '0',
          'BytesSentPersec' => '0',
          'Name' => 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}',
          'PacketsSentPersec' => '0',
          'BytesReceivedPersec' => '0',
          'CurrentBandwidth' => '100000'
        };

Looking for  in Extra Data
Could not match the base value  to an extra value
Looking for a match to Intel[R] PRO_1000 MT Desktop Adapter in 'Intel[R] PRO_1000 MT Desktop Adapter' or 'Ethernet' or '(10.0.2.15,fe80::81c5:5b60:1886:4b0)' or '08:00:27:B1:3C:D6'
Looking for a match to Intel[R] PRO_1000 MT Desktop Adapter in 'Intel[R] PRO_1000 MT Desktop Adapter _2' or 'Ethernet 2' or '(192.168.100.56,fe80::58b8:2343:9f57:84a6)' or '08:00:27:96:C6:01'
Looking for a match to Intel[R] PRO_1000 MT Desktop Adapter in 'isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}' or '' or '' or ''
Looking for a match to Intel[R] PRO_1000 MT Desktop Adapter in 'isatap.{639F5095-6F42-42EA-93AD-046FB66E1FDC}' or '' or '' or ''

rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Issue in wmi plus with nagios

Post by rkennedy »

I noticed two things here, the error message, and your version. Looking at a stock XI system I have, the current version is 1.6 - I would update yours.

Code: Select all

#==============================================================================
#================================= DECLARATIONS ===============================
#==============================================================================

our $VERSION=1.60;

Then, from what it mentions here, I'm not understanding why it's not matching. From what I can tell, this should be, so it could be a possible bug -

Code: Select all

Looking for a match to Intel[R] PRO_1000 MT Desktop Adapter in 'Intel[R] PRO_1000 MT Desktop Adapter' or 'Ethernet' or '(10.0.2.15,fe80::81c5:5b60:1886:4b0)' or '08:00:27:B1:3C:D6'
From what I can tell it's polling the data properly.

There could be problems with the WMI configurations provided with OMD as well. Again, we did not develop the plugin so we're a bit limited on the support we can provide here. It may be worth reaching out here - http://www.edcint.co.nz/checkwmiplus/?q=Support - but again, you'll see one of the stipulations -

Code: Select all

Make sure you are using the latest version - we only support the latest version.
Former Nagios Employee
jeraldsm
Posts: 7
Joined: Tue Feb 07, 2017 8:40 am

Re: Issue in wmi plus with nagios

Post by jeraldsm »

Thanks for the support,
I have contacted wmi support, will update the solution here, if my issue gets fixed.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Issue in wmi plus with nagios

Post by dwhitfield »

jeraldsm wrote: will update the solution here, if my issue gets fixed.
Yes, please do. WMI seems to be causing a lot of problems recently. Our devs are thinking about doing something with WMI, but no solid plans and certainly no ETA yet.
jeraldsm
Posts: 7
Joined: Tue Feb 07, 2017 8:40 am

Re: Issue in wmi plus with nagios

Post by jeraldsm »

Hi,

I got reply from the WMI support, The checknetwork issue was actually a bug in the script where they missed an "=" sign in plugin_output variable.
They provided me another script and it is working now.

These are the difference between the current version and fix version scripts.

Code: Select all

diff check_wmi_plus.pl check_wmi_plus.pl.back

< our $VERSION=1.621;
---
> our $VERSION=1.62;
3655d3654
< $debug && print "Data Join on the Name to find the MAC address\n";
3663d3661
< $debug && print "Data Join on the MAC Address to find the NetConnectionID (Windows friendly name)\n";
3686c3684
<    $debug && print "Looking for a match to the command line argument '$the_arguments{'_arg1'}' in Name:'$$row{'Name'}' or NetConnectionID:'$$row{'NetConnectionID'}' or IPAddress:'$$row{'IPAddress'}' or MACAddress:'$$row{'MACAddress'}'\n";
---
>    $debug && print "Looking for a match to $the_arguments{'_arg1'} in '$$row{'Name'}' or '$$row{'NetConnectionID'}' or '$$row{'IPAddress'}' or '$$row{'MACAddress'}'\n";
3755c3753
<    $plugin_output.="No Network Interfaces specified. Valid Interface Names are:\n" . list_collected_values_from_all_rows(\@collected_data,['Name','NetConnectionID','IPAddress','MACAddress'],"\n",', ',0) . "\nSpecify the -a parameter with an adapter name. Use ' ' around the adapter name.\n";
---
>    $plugin_output."No Network Interfaces specified. Valid Interface Names are:\n" . list_collected_values_from_all_rows(\@collected_data,['Name','NetConnectionID','IPAddress','MACAddress'],"\n",', ',0) . "\nSpecify the -a parameter with an adapter name. Use ' ' around the adapter name.\n";
5494c5492
<       $debug && print "Looking for $base_value (of type $base_field) in Extra Data\n";
---
>       $debug && print "Looking for $base_value in Extra Data\n";


Following is the output now:

Code: Select all

[root@nagios plugins]# /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56  -u wmiagent -p WMI@mci 
No Network Interfaces specified. Valid Interface Names are:
Intel[R] PRO_1000 MT Desktop Adapter, Ethernet, (10.0.2.15,fe80::81c5:5b60:1886:4b0), 08:00:27:B1:3C:D6
Intel[R] PRO_1000 MT Desktop Adapter _2, Ethernet 2, (192.168.100.56,fe80::58b8:2343:9f57:84a6), 08:00:27:96:C6:01
isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}, , 
isatap.mindcurv.com, , 
Specify the -a parameter with an adapter name. Use ' ' around the adapter name.

[root@nagios plugins]# /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56  -u wmiagent -p WMI@mci -w 20 -c 70  -a 'Intel[R] PRO_1000 MT Desktop Adapter'
No Network Interfaces specified. Valid Interface Names are:
Intel[R] PRO_1000 MT Desktop Adapter
Intel[R] PRO_1000 MT Desktop Adapter _2
isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}
isatap.mindcurv.com
Intel[R] PRO_1000 MT Desktop Adapter, Ethernet, (10.0.2.15,fe80::81c5:5b60:1886:4b0), 08:00:27:B1:3C:D6
Intel[R] PRO_1000 MT Desktop Adapter _2, Ethernet 2, (192.168.100.56,fe80::58b8:2343:9f57:84a6), 08:00:27:96:C6:01
isatap.{ED08290F-F2A7-43E5-88F4-49F460368D14}, , 
isatap.mindcurv.com, , 
Specify the -a parameter with an adapter name. Use ' ' around the adapter name.
[root@nagios plugins]# 
[root@nagios plugins]# 
[root@nagios plugins]# /omd/sites/jsm/lib/nagios/plugins/check_wmi_plus.pl -m checknetwork -H 192.168.100.56  -u wmiagent -p WMI@mci -w 20 -c 70  -a '8:00:27:B1:3C:D6'
CRITICAL (Sample Period 56 sec) - [Triggered by CurrentBandwidth>70] - Number of Interfaces=1. Interface Details - CRITICAL - [Triggered by CurrentBandwidth>70] - Interface:Ethernet, IP Address:(10.0.2.15,fe80::81c5:5b60:1886:4b0), MAC Address 08:00:27:B1:3C:D6, Speed:1Gbit/s, DHCPEnabled=True, Byte Send Rate=6B/sec (Utilisation=0.00%), Byte Receive Rate=0B/sec(Utilisation=0.00%) Packet Send Rate=0packet/sec, Packet Receive Rate=0packet/sec, Output Queue Length=0, Packets Received Errors=0    |'Ethernet BytesSentPersec'=6; 'Ethernet Send Utilisation'=0.00%; 'Ethernet BytesReceivedPersec'=0; 'Ethernet Receive Utilisation'=0.00%; 'Ethernet PacketsSentPersec'=0; 'Ethernet PacketsReceivedPersec'=0; 'Ethernet OutputQueueLength'=0; 'Ethernet PacketsReceivedErrors'=0; 
[root@nagios plugins]# 
[root@nagios plugins]# 

It still does not work while specifying Network adapter, but mac address and IP works, which is enougn for me now.
Locked