I have been having some interesting issues with WMIC and was wondering where the source lived and if anyone was actively owning the code. Having different panic traps and get different results when querying with a FQDN vs IP address. When I use the debug switches it seems to attempt to connect to the wrong interface. Seems related to Samba and I cannot seem to find anyone who is a Samba expert. I'm sure it's my environment but it really shouldn't be that hard to get Samba to use DNS for address resolution.
UNKNOWN - The WMI query had problems. The error text from wmic is: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
INTERNAL ERROR: Signal 6 in pid 16339 (4.0.0alpha3-GIT-UNKNOWN)
Please read the file BUGS.txt in the distribution
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
PANIC: internal error
BACKTRACE: 20 stack frames:
#0 /usr/bin/wmic(call_backtrace+0x2b) [0x85f15a3]
#1 /usr/bin/wmic(smb_panic+0x266) [0x85f18dd]
#2 /usr/bin/wmic [0x85f1a78]
#3 /usr/bin/wmic(fault_setup+0) [0x85f1aad]
#4 [0xa72420]
#5 /lib/libc.so.6(abort+0x101) [0x82b701]
#6 /usr/bin/wmic [0x863b167]
#7 /usr/bin/wmic [0x863b23c]
#8 /usr/bin/wmic [0x863b447]
#9 /usr/bin/wmic [0x863b794]
#10 /usr/bin/wmic(talloc_named_const+0x1f) [0x863c476]
#11 /usr/bin/wmic(ndr_pull_WbemQualifiers+0x194) [0x80b9431]
#12 /usr/bin/wmic(ndr_pull_WbemClass+0x26b) [0x80bbd82]
#13 /usr/bin/wmic(ndr_pull_DataWithStack+0xd3) [0x80b97f0]
#14 /usr/bin/wmic(ndr_pull_WbemClassObject+0x30b) [0x80bacaf]
#15 /usr/bin/wmic(WBEMDATA_Parse+0xef6) [0x80b7693]
#16 /usr/bin/wmic(IEnumWbemClassObject_SmartNext+0x4e7) [0x80b7dc5]
#17 /usr/bin/wmic(main+0x50b) [0x80b45cf]
#18 /lib/libc.so.6(__libc_start_main+0xdc) [0x816e9c]
#19 /usr/bin/wmic [0x80b3a91]
WMIC source site
WMIC source site
Grumpy Olde IT Guy
Re: WMIC source site
Just an example of what I'm trying to solve. WMIC produces different results if the hostname is specified vs an IP address one being a panic trap.
[root@nagios libexec]# /usr/bin/wmic -U user%pass //procman2.vca.com 'select Name,IDProcess,PercentProcessorTime,Timestamp_Sys100NS from Win32_PerfRawData_PerfProc_Process WHERE Name like "%" and Name != "Idle" and Name != "_Total"'
CLASS: Win32_PerfRawData_PerfProc_Process
IDProcess|Name|PercentProcessorTime|Timestamp_Sys100NS
4|System|173750000|129570417645674460
260|smss|312500|129570417645674460
...
3816|WmiPrvSE#2|11718750|129570417645674460
[root@nagios libexec]# /usr/bin/wmic -U user%pass //10.1.5.47 'select Name,IDProcess,PercentProcessorTime,Timestamp_Sys100NS from Win32_PerfRawData_PerfProc_Process WHERE Name like "%" and Name != "Idle" and Name != "_Total"'
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
INTERNAL ERROR: Signal 6 in pid 15237 (4.0.0alpha3-GIT-UNKNOWN)
Please read the file BUGS.txt in the distribution
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
PANIC: internal error
BACKTRACE: 20 stack frames:
#0 /usr/bin/wmic(call_backtrace+0x2b) [0x85f15a3]
#1 /usr/bin/wmic(smb_panic+0x266) [0x85f18dd]
#2 /usr/bin/wmic [0x85f1a78]
#3 /usr/bin/wmic(fault_setup+0) [0x85f1aad]
#4 [0x61e420]
#5 /lib/libc.so.6(abort+0x101) [0x82b701]
#6 /usr/bin/wmic [0x863b167]
#7 /usr/bin/wmic [0x863b23c]
#8 /usr/bin/wmic [0x863b447]
#9 /usr/bin/wmic [0x863b794]
#10 /usr/bin/wmic(talloc_named_const+0x1f) [0x863c476]
#11 /usr/bin/wmic(ndr_pull_WbemQualifiers+0x194) [0x80b9431]
#12 /usr/bin/wmic(ndr_pull_WbemClass+0x26b) [0x80bbd82]
#13 /usr/bin/wmic(ndr_pull_DataWithStack+0xd3) [0x80b97f0]
#14 /usr/bin/wmic(ndr_pull_WbemClassObject+0x30b) [0x80bacaf]
#15 /usr/bin/wmic(WBEMDATA_Parse+0xef6) [0x80b7693]
#16 /usr/bin/wmic(IEnumWbemClassObject_SmartNext+0x4e7) [0x80b7dc5]
#17 /usr/bin/wmic(main+0x50b) [0x80b45cf]
#18 /lib/libc.so.6(__libc_start_main+0xdc) [0x816e9c]
#19 /usr/bin/wmic [0x80b3a91]
Aborted
[root@nagios libexec]# ping procman2
PING procman2.vca.com (10.1.5.47) 56(84) bytes of data.
64 bytes from procman2.vca.com (10.1.5.47): icmp_seq=1 ttl=128 time=1.78 ms
64 bytes from procman2.vca.com (10.1.5.47): icmp_seq=2 ttl=128 time=0.752 ms
--- procman2.vca.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.752/1.266/1.780/0.514 ms
[root@nagios libexec]#
[root@nagios libexec]# /usr/bin/wmic -U user%pass //procman2.vca.com 'select Name,IDProcess,PercentProcessorTime,Timestamp_Sys100NS from Win32_PerfRawData_PerfProc_Process WHERE Name like "%" and Name != "Idle" and Name != "_Total"'
CLASS: Win32_PerfRawData_PerfProc_Process
IDProcess|Name|PercentProcessorTime|Timestamp_Sys100NS
4|System|173750000|129570417645674460
260|smss|312500|129570417645674460
...
3816|WmiPrvSE#2|11718750|129570417645674460
[root@nagios libexec]# /usr/bin/wmic -U user%pass //10.1.5.47 'select Name,IDProcess,PercentProcessorTime,Timestamp_Sys100NS from Win32_PerfRawData_PerfProc_Process WHERE Name like "%" and Name != "Idle" and Name != "_Total"'
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
INTERNAL ERROR: Signal 6 in pid 15237 (4.0.0alpha3-GIT-UNKNOWN)
Please read the file BUGS.txt in the distribution
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
PANIC: internal error
BACKTRACE: 20 stack frames:
#0 /usr/bin/wmic(call_backtrace+0x2b) [0x85f15a3]
#1 /usr/bin/wmic(smb_panic+0x266) [0x85f18dd]
#2 /usr/bin/wmic [0x85f1a78]
#3 /usr/bin/wmic(fault_setup+0) [0x85f1aad]
#4 [0x61e420]
#5 /lib/libc.so.6(abort+0x101) [0x82b701]
#6 /usr/bin/wmic [0x863b167]
#7 /usr/bin/wmic [0x863b23c]
#8 /usr/bin/wmic [0x863b447]
#9 /usr/bin/wmic [0x863b794]
#10 /usr/bin/wmic(talloc_named_const+0x1f) [0x863c476]
#11 /usr/bin/wmic(ndr_pull_WbemQualifiers+0x194) [0x80b9431]
#12 /usr/bin/wmic(ndr_pull_WbemClass+0x26b) [0x80bbd82]
#13 /usr/bin/wmic(ndr_pull_DataWithStack+0xd3) [0x80b97f0]
#14 /usr/bin/wmic(ndr_pull_WbemClassObject+0x30b) [0x80bacaf]
#15 /usr/bin/wmic(WBEMDATA_Parse+0xef6) [0x80b7693]
#16 /usr/bin/wmic(IEnumWbemClassObject_SmartNext+0x4e7) [0x80b7dc5]
#17 /usr/bin/wmic(main+0x50b) [0x80b45cf]
#18 /lib/libc.so.6(__libc_start_main+0xdc) [0x816e9c]
#19 /usr/bin/wmic [0x80b3a91]
Aborted
[root@nagios libexec]# ping procman2
PING procman2.vca.com (10.1.5.47) 56(84) bytes of data.
64 bytes from procman2.vca.com (10.1.5.47): icmp_seq=1 ttl=128 time=1.78 ms
64 bytes from procman2.vca.com (10.1.5.47): icmp_seq=2 ttl=128 time=0.752 ms
--- procman2.vca.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.752/1.266/1.780/0.514 ms
[root@nagios libexec]#
Last edited by rseiwert on Mon Aug 08, 2011 12:55 pm, edited 1 time in total.
Grumpy Olde IT Guy
Re: WMIC source site
continued
So you say change the command not to use IP addresses and use HOSTNAME. That works for some hosts but then I have a WMIC name resolution issue. Eng has SMB bound to one interface. This one interface resolves from DNS and WINS. The machine also has SAN connections which have no protos bound. WMIC seems to find these interfaces sometimes working sometimes timing out.
[root@nagios libexec]# ping eng.vca.com
PING eng.vca.com (10.1.5.45) 56(84) bytes of data.
64 bytes from eng.vca.com (10.1.5.45): icmp_seq=1 ttl=128 time=1.67 ms
64 bytes from eng.vca.com (10.1.5.45): icmp_seq=2 ttl=128 time=0.607 ms
--- eng.vca.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.607/1.141/1.675/0.534 ms
[root@nagios libexec]# dig eng
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> eng
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 19378
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;eng. IN A
;; Query time: 1 msec
;; SERVER: 10.1.5.45#53(10.1.5.45)
;; WHEN: Fri Aug 5 14:30:51 2011
;; MSG SIZE rcvd: 21
[root@nagios libexec]# /usr/bin/wmic -U user%pass //eng.vca.com 'select Name,IDProcess,PercentProcessorTime,Timestamp_Sys100NS from Win32_PerfRawData_PerfProc_Process WHERE Name like "%" and Name != "Idle" and Name != "_Total"'
Failed to connect host 10.20.3.93 on port 1153 - NT_STATUS_IO_TIMEOUT
Failed to connect host 10.20.3.93 ((null)) on port 1153 - NT_STATUS_IO_TIMEOUT.
Failed to connect host 10.20.3.92 on port 1153 - NT_STATUS_IO_TIMEOUT
Failed to connect host 10.20.3.92 ((null)) on port 1153 - NT_STATUS_IO_TIMEOUT.
CLASS: Win32_PerfRawData_PerfProc_Process
...
So you say change the command not to use IP addresses and use HOSTNAME. That works for some hosts but then I have a WMIC name resolution issue. Eng has SMB bound to one interface. This one interface resolves from DNS and WINS. The machine also has SAN connections which have no protos bound. WMIC seems to find these interfaces sometimes working sometimes timing out.
[root@nagios libexec]# ping eng.vca.com
PING eng.vca.com (10.1.5.45) 56(84) bytes of data.
64 bytes from eng.vca.com (10.1.5.45): icmp_seq=1 ttl=128 time=1.67 ms
64 bytes from eng.vca.com (10.1.5.45): icmp_seq=2 ttl=128 time=0.607 ms
--- eng.vca.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.607/1.141/1.675/0.534 ms
[root@nagios libexec]# dig eng
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> eng
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 19378
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;eng. IN A
;; Query time: 1 msec
;; SERVER: 10.1.5.45#53(10.1.5.45)
;; WHEN: Fri Aug 5 14:30:51 2011
;; MSG SIZE rcvd: 21
[root@nagios libexec]# /usr/bin/wmic -U user%pass //eng.vca.com 'select Name,IDProcess,PercentProcessorTime,Timestamp_Sys100NS from Win32_PerfRawData_PerfProc_Process WHERE Name like "%" and Name != "Idle" and Name != "_Total"'
Failed to connect host 10.20.3.93 on port 1153 - NT_STATUS_IO_TIMEOUT
Failed to connect host 10.20.3.93 ((null)) on port 1153 - NT_STATUS_IO_TIMEOUT.
Failed to connect host 10.20.3.92 on port 1153 - NT_STATUS_IO_TIMEOUT
Failed to connect host 10.20.3.92 ((null)) on port 1153 - NT_STATUS_IO_TIMEOUT.
CLASS: Win32_PerfRawData_PerfProc_Process
...
Last edited by rseiwert on Mon Aug 08, 2011 12:54 pm, edited 1 time in total.
Grumpy Olde IT Guy
Re: WMIC source site
The wmic source code can be found here, licensed under GPLv2.
Re: WMIC source site
Just an FYI, new version solved the Panic Traps from WMI.
downloaded WMI from http://dev.zenoss.org/trac/browser/trun ... 13.tar.bz2 and made the executable. Seems to have solved the panic traps from the version I downloaded from the link in the Using WMI with Nagios PDF document.
Note the make file puts the new one in /bin and the one in the Nagios XI doc installs into /usr/bin.. So you have two copies installed if you did both. Both report version 4.0.0 fyi.
downloaded WMI from http://dev.zenoss.org/trac/browser/trun ... 13.tar.bz2 and made the executable. Seems to have solved the panic traps from the version I downloaded from the link in the Using WMI with Nagios PDF document.
Note the make file puts the new one in /bin and the one in the Nagios XI doc installs into /usr/bin.. So you have two copies installed if you did both. Both report version 4.0.0 fyi.
Grumpy Olde IT Guy
Re: WMIC source site
Glad to see you got everything working!