Windows performance counters & VBS/WMI via SNMP

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

uhm, if the query to the enterprise oid reports "snmptools" then it means the agent is loaded and running.
Besides, I see in your second screenshot that snmpwalk works too.

Having the log file would definetely help.

Put debug="1" (string) under [HKEY_LOCAL_MACHINE\SOFTWARE\snmptools\currentversion] to debug to c:\log.txt and restart the snmp service.

Also, what tool are you using to query 1.3.6.1.4.1.15.17.4.2.2 ?

In iptools (i see you used it to list the perf objects), use the snmpget screen to confirm the OID, as the screenshot attached.

Regards,
Erwan.

ps :
or you can use the snmpget command line tool :
snmpget -v 1 127.0.0.1 public .1.3.6.1.4.1.15.17.4.2.2
Attachments
perf.jpg
perf.jpg (164.31 KiB) Viewed 11112 times
Bgardner007
Posts: 9
Joined: Wed Feb 13, 2008 10:16 am
Location: Tampa, Florida
Contact:

Log Results

Post by Bgardner007 »

Had a syntax error in the Reg File I was merging. Here are the results of the SNMP Query from both the tools in IPTools and iReasoning MIB Browser:

13:54:42:414,SnmpExtensionQuery
13:54:42:414,SNMP_PDU_GET
13:54:42:414,GetRequest:1.3.6.1.4.1.15.17.4.2.2(11)
13:54:42:414,length(str_result)=0
13:55:08:852,SnmpExtensionQuery
13:55:08:852,SNMP_PDU_GET
13:55:08:852,GetRequest:1.3.6.1.4.1.15.17.4.2.2(11)
13:55:08:852,length(str_result)=0
13:58:56:796,SnmpExtensionQuery
13:58:56:796,SNMP_PDU_GETNEXT
13:58:56:796,GetNextRequest:1.3.6.1.2.1.31.1.1.1.1(11)
13:58:56:796,comparemem=false
13:58:56:812,SnmpExtensionQuery
13:58:56:812,SNMP_PDU_GETNEXT
13:58:56:812,GetNextRequest:1.3.6.1.2.1.31.1.1.1.18(11)
13:58:56:812,comparemem=false
13:59:30:860,SnmpExtensionQuery
13:59:30:860,SNMP_PDU_GET
13:59:30:860,GetRequest:1.3.6.1.4.1.15.17.4.2.2(11)
13:59:30:860,length(str_result)=0

Thanks again for the help.
Attachments
SNMP Results.zip
(10.27 KiB) Downloaded 392 times
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

uhm indeed, something is wrong.
senquery failed / status 3 means means "bad_value".

my log file looks like this :
20:32:32:406,GetRequest:1.3.6.1.4.1.15.26.4.2.2(11)
20:32:32:828,result=0.0115173761448088 asn_type=4 oid=1.3.6.1.4.1.15.26.4.2.2
20:32:32:828,GetRequest OK

yours:
13:59:30:860,GetRequest:1.3.6.1.4.1.15.17.4.2.2(11)
13:59:30:860,length(str_result)=0

looks like my internal getperf(oid) function returns an empty string...
will have a look right away to fix it.

in the mean time can you try these oid's :
1.3.6.1.4.1.15.17.4.2.1 (you should get "_Total")
1.3.6.1.4.1.15.17.4.2.3 (you should get "PhysicalDisk\Avg. Disk Queue Length\_Total")

also, second question can you copy the 3 first lines of log.xt ?
you should see something like this :
20:54:45:625,SnmpExtensionInit
20:54:45:625,start
20:54:49:437,objectcount=57

Thanks for the debugging :)

Regards,
Erwan.
Last edited by erwan.l on Tue Feb 19, 2008 3:16 pm, edited 2 times in total.
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

I have put version 1.0.0.4 here : http://erwan.l.free.fr/snmptools/snmptools.zip .

No major changes but more debug output to help tracing bugs.

Replace the old one by this one.

Regards,
Erwan.
Bgardner007
Posts: 9
Joined: Wed Feb 13, 2008 10:16 am
Location: Tampa, Florida
Contact:

Post by Bgardner007 »

Here is the logfile in it's entirety after the new DLL was copied in and registerd:

16:19:57:299,SnmpExtensionInit
16:19:57:299,start
16:19:57:689,objectcount=48
16:20:07:955,SnmpExtensionQuery
16:20:07:955,PduType:SNMP_PDU_GETNEXT
16:20:07:955,GetNextRequest:1.3.6.1.4.1.11.2.3.1.6.1.1.2.1.6(16)
16:20:07:955,comparemem=false
16:20:07:955,PduType:SNMP_PDU_GETNEXT
16:20:07:955,GetNextRequest:1.3.6.1.4.1.11.2.3.1.6.1.1.2.1.6(16)
16:20:07:955,comparemem=false
16:20:07:955,SnmpExtensionQuery
16:20:07:955,PduType:SNMP_PDU_GETNEXT
16:20:07:955,GetNextRequest:1.3.6.1.4.1.11.2.3.1.6.1.1.2.1.6(16)
16:20:07:955,comparemem=false
16:20:41:269,SnmpExtensionQuery
16:20:41:269,PduType:SNMP_PDU_GET
16:20:41:269,GetRequest:1.3.6.1.4.1.15.17.4.2.1(11)
16:20:41:269,length(str_result)=0
16:20:41:284,GetRequest Failed
16:20:54:003,SnmpExtensionQuery
16:20:54:003,PduType:SNMP_PDU_GET
16:20:54:003,GetRequest:1.3.6.1.4.1.15.17.4.2.2(11)
16:20:54:003,length(str_result)=0
16:20:54:003,GetRequest Failed
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Oki, thanks a lot for your patience.
I know where to look now.

I will come back with a (hopefully) working version.
Day is ending over here :)

I am wondering if this is has to do with the float number.
Try with a round number like Memory\availalable kbytes (oid=1.3.6.1.4.1.15.33.29.0.2 on my home computer).

Thanks,
Erwan.

ps:by the way, this is not linked to our topic, but did you notice you computer is getting snmp requests for 1.3.6.1.4.1.11.2.3.1.6.1.1.2.1.6 (HP-UX) ?
Bgardner007
Posts: 9
Joined: Wed Feb 13, 2008 10:16 am
Location: Tampa, Florida
Contact:

Post by Bgardner007 »

Seriously, I really appreciate your help with this. Our company would definitely like to have the ability to capture Windows Counters. The following is from the log after I ran the next OID:

16:49:02:089,SnmpExtensionQuery
16:49:02:089,PduType:SNMP_PDU_GET
16:49:02:089,GetRequest:1.3.6.1.4.1.15.33.29.0.2(11)
16:49:02:089,length(str_result)=0
16:49:02:089,GetRequest Failed

Anything else I can help with please let me know and I will be happy to assist.
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

last one for the day :
to assert that the issue is with sending back perf values,
lets try description values.

try this :
1.3.6.1.4.1.15.17.4.2.1 (you should get "_Total")
1.3.6.1.4.1.15.17.4.2.3 (you should get "PhysicalDisk\Avg. Disk Queue Length\_Total")

Malken (see previous posts) was a great help already in debugging.
I am confident we will sort this issue at your place.

/erwan
Bgardner007
Posts: 9
Joined: Wed Feb 13, 2008 10:16 am
Location: Tampa, Florida
Contact:

Post by Bgardner007 »

Yes that one worked: (Talk to you tomorrow, thanks again)

16:59:11:561,SnmpExtensionQuery
16:59:11:561,PduType:SNMP_PDU_GET
16:59:11:561,GetRequest:1.3.6.1.4.1.15.17.4.2.1(11)
16:59:11:561,result=_Total asn_type=4 oid=1.3.6.1.4.1.15.17.4.2.1
16:59:11:561,GetRequest OK
16:59:44:312,SnmpExtensionQuery
16:59:44:312,PduType:SNMP_PDU_GET
16:59:44:312,GetRequest:1.3.6.1.4.1.15.17.4.2.3(11)
16:59:44:312,result=PhysicalDisk\Avg. Disk Queue Length\_Total asn_type=4 oid=1.3.6.1.4.1.15.17.4.2.3
16:59:44:312,GetRequest OK
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Hi Bgardner007,

I have updated the dll on http://erwan.l.free.fr/snmptools/snmptools.zip .

No major changes yet except more debug details (again) to spot the issue.
Simply overwrite the old one with this new one.

Now a snmp query should look like this in the log.txt :
11:51:55:296 , SnmpExtensionQuery
11:51:55:296 , PduType=SNMP_PDU_GET
11:51:55:296 , GetRequest: OID=1.3.6.1.4.1.15.26.4.2.2 (11)
11:51:55:296 , GetPerf: Retrieving performance datas...
11:51:55:703 , formatvalue: VarType=Double
11:51:55:703 , result=0.000725530689519034 asn_type=4
11:51:55:703 , GetRequest OK

1. we acknowledge the snmpquery
2. we determine the query type (get or getnext)
3. we retrieve the oid within the request
4. we get the perf value for object x.y.z (here 26.4.2)
5. we format the value (by simply replacing comma with dot)
6 & 7. send back the value to the snmp requester

I suspect the formatvalue line (step 5) will differ at your place (vartype null or empty?).

Regards,
Erwan.
Bgardner007
Posts: 9
Joined: Wed Feb 13, 2008 10:16 am
Location: Tampa, Florida
Contact:

Post by Bgardner007 »

Latest Log after the Latest SNMPTOOLS was applied:

08:56:57:716,DLL_PROCESS_DETACH
08:56:57:716,clean
08:58:03:407 , SnmpExtensionInit
08:58:03:407 , start
08:58:03:782 , objectcount=48
08:58:13:080 , SnmpExtensionQuery
08:58:13:080 , PduType=SNMP_PDU_GETNEXT
08:58:13:080 , GetNextRequest:1.3.6.1.4.1.11.2.3.1.6.1.1.2.1.3(16)
08:58:13:080 , comparemem=false
08:58:13:080 , PduType=SNMP_PDU_GETNEXT
08:58:13:080 , GetNextRequest:1.3.6.1.4.1.11.2.3.1.6.1.1.2.1.3(16)
08:58:13:080 , comparemem=false
08:58:13:080 , SnmpExtensionQuery
08:58:13:080 , PduType=SNMP_PDU_GETNEXT
08:58:13:080 , GetNextRequest:1.3.6.1.4.1.11.2.3.1.6.1.1.2.1.3(16)
08:58:13:080 , comparemem=false
08:58:53:207 , SnmpExtensionQuery
08:58:53:207 , PduType=SNMP_PDU_GET
08:58:53:207 , GetRequest: OID=1.3.6.1.4.1.15.17.4.2.3 (11)
08:58:53:207 , GetPerf: no condition match
08:58:53:207 , length(str_result)=0
08:58:53:207 , GetRequest Failed
08:58:57:629 , SnmpExtensionQuery
08:58:57:629 , PduType=SNMP_PDU_GET
08:58:57:629 , GetRequest: OID=1.3.6.1.4.1.15.17.4.2.2 (11)
08:58:57:645 , GetPerf: no condition match
08:58:57:645 , length(str_result)=0
08:58:57:645 , GetRequest Failed
08:59:06:395 , SnmpExtensionQuery
08:59:06:395 , PduType=SNMP_PDU_GET
08:59:06:395 , GetRequest: OID=1.3.6.1.4.1.15.17.4.2.1 (11)
08:59:06:395 , GetPerf: no condition match
08:59:06:395 , length(str_result)=0
08:59:06:395 , GetRequest Failed
08:59:11:849 , SnmpExtensionQuery
08:59:11:849 , PduType=SNMP_PDU_GET
08:59:11:849 , GetRequest: OID=1.3.6.1.4.1.15.33.29.0.2 (11)
08:59:11:849 , GetPerf: Retrieving performance datas...
08:59:11:895 , result=null asn_type=4
08:59:11:895 , GetRequest OK
08:59:20:974 , SnmpExtensionQuery
08:59:20:974 , PduType=SNMP_PDU_GET
08:59:20:974 , GetRequest: OID=1.3.6.1.4.1.15 (7)
08:59:20:974 , result=snmptools by erwan.l@free.fr asn_type=4
08:59:20:974 , GetRequest OK
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Getting closer, at least the "no condition match" is giving me a fair idea of what is happening :)

I am only wondering why these 2 oid's fail when it was working in your previous posts.
08:58:53:207 , GetRequest: OID=1.3.6.1.4.1.15.17.4.2.3 (11)
08:58:53:207 , GetPerf: no condition match
08:59:06:395 , GetRequest: OID=1.3.6.1.4.1.15.17.4.2.1 (11)
08:59:06:395 , GetPerf: no condition match

to "emulate" the same perf counters on my environement, could you export it (xml file) and attach it here?
see attached screenshot. (save all name).

Thanks,
Erwan.
Attachments
perf.jpg
perf.jpg (58.72 KiB) Viewed 11015 times
Bgardner007
Posts: 9
Joined: Wed Feb 13, 2008 10:16 am
Location: Tampa, Florida
Contact:

Post by Bgardner007 »

Thanks for the followup, sorry I didnt get back to you earlier got sidetracked. Anyway, now I am back on top of this. I have attached the Export as requested. Thanks again!
Byron
Attachments
Export to XML.XML
(177.62 KiB) Downloaded 1477 times
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

oki that will help.

in the meantime, you can try these "simpler" objects :
1.3.6.1.4.1.15.26.4.2.2 (should give you Available Bytes in memory),
1.3.6.1.4.1.15.16.3.1.2 (should give you Free Megabytes on C: memory).

Is this a vmware machine?
Do you get the same issue on other servers?

Edit : I put a new version on my web site (still 1.0.0.4 as no big change so far).
As I know where exactly it goes wrong, I have put some more debug details.
Now you should see something like this :

20:58:18:781 , GetRequest: OID=1.3.6.1.4.1.15.33.2.1.2 (11)
20:58:18:781 , GetPerf: no condition match
20:58:18:781 , counter=2/30 instance=1/-1
20:58:18:781 , length(str_result)=0
20:58:18:781 , GetRequest Failed

Here I have requested an instance (1) which does not exist (it should be 0).
I have also did some (very) minor memory cleanup in the code.
Let me know the result.
Still I must say I am very puzzled by this wierd behavior ! :)

Regards,
Erwan.

PS : I realise it was not mentionned : be aware that the perf counters will differ from one server to the other.
Therefore the OID's will also change from one server to the other.
A working OID on my test computer or on your local computer may not work on your production server.
Brashquido
Cacti User
Posts: 99
Joined: Sat Feb 28, 2004 10:16 pm
Location: Melbourne, Australia
Contact:

Post by Brashquido »

Brilliant tool! I've found an odd thing or two with it though where some values are not reported correctly and I don't seem to be able to find a consistent pattern. For instance if I goto process->thread count->_Total I get a value which is very low (3 in my case). However if I goto system->threads I get around 670 which from as far as I can tell using Task Manager is correct. If I actually open up PerfMon and load these two counters then they both report the same value (around the 670 mark) so it seems that it is just snmptools that isn't getting the correct value. There might be others, I don't know yet. Once again, really top work on this DLL! I used to use a perl script to do a similar thing with PerfMon, but this is far far far more elegant. :D
Dominic Ryan
www.iis-aid.com
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest