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
Pilly
Posts: 29
Joined: Thu Dec 18, 2008 6:26 am

Post by Pilly »

erwan.l wrote:Hi Pilly,
Almost there.

Lets switch to the 32 bits version as I cannot debug the 64bits one these days (the 32 bits will work fine on you 64bits platform).

1.Stop snmp service.
2.Delete the old reg key (HKEY_LOCAL_MACHINE\SOFTWARE\snmptools)
3.Use the snmptools.dll 32 bits version by using regagentWow6432.reg and copy this DLL file to the windows folder then, not system32.

Once the reg has been merged, put debug=1 again.

Restart snmp service and try again.

Regards,
Erwan.

Code: Select all

10:46:38:496 , counters=c:\counters.ini
10:46:38:496 , Traps=
10:46:38:496 , SnmpExtensionInit
10:46:38:496 , start
10:46:38:496 , Platform : win32
10:46:38:496 , OSVersion: osVista
10:46:38:496 , LOCALE_SDECIMAL: .
10:46:44:330 , SnmpExtensionQueryEx
10:46:44:330 , nRequestType=SNMP_EXTENSION_GET_NEXT
10:46:44:330 , GetNextRequest:1.3.6.1.4.1.15.6(8)
10:46:44:330 , value=2 length=1
10:46:44:330 , Next OID: 1.3.6.1.4.1.15.10.1 idlength=9
10:46:44:330 , GetNextRequest OK
10:46:44:346 , SnmpExtensionQueryEx
10:46:44:346 , nRequestType=SNMP_EXTENSION_GET
10:46:44:346 , GetRequest: OID=1.3.6.1.4.1.15.6 (8)
10:46:44:377 , GetPerf: path=Processor\% Idle Time\_Total
10:46:44:393 , GetPerf: pdh_counter_path=\Processor(_Total)\% Idle Time
10:46:45:407 , GetPerf: vartype=Double
10:46:45:407 , GetRequest: value=99.8089731344432 asn_type=4
10:46:45:407 , GetRequest: OK
10:46:45:407 , SnmpExtensionQueryEx
10:46:45:407 , nRequestType=SNMP_EXTENSION_GET
10:46:45:407 , GetRequest: OID=1.3.6.1.4.1.15.6 (8)
10:46:45:422 , GetPerf: path=Processor\% Idle Time\_Total
10:46:45:422 , GetPerf: pdh_counter_path=\Processor(_Total)\% Idle Time
10:46:46:436 , GetPerf: vartype=Double
10:46:46:436 , GetRequest: value=100 asn_type=2
10:46:46:436 , GetRequest: OK
This gave a result that i was expecting. String : 99.8089731344432

Ok, I can live with this.

next question is im doing counter=ProcessorPerformance\Percentage\_Total which gives a value of "Null" which is right as its doing nothing at the moment. When i poll that with cacti the poller complains that null is not a valid result. ?
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Hi Pilly,

Nice to see the 32bits snmptools is working on your xp64.

About ProcessorPerformance\Percentage\_Total, are sure about that counter?
Null as a result is not good : it should always be a string of numeric.

Can you display the logfile for that counter?
Is it a specific vista counter? I have never met that counter before.

Regards,
Erwan.
Pilly
Posts: 29
Joined: Thu Dec 18, 2008 6:26 am

Post by Pilly »

erwan.l wrote:Hi Pilly,

Nice to see the 32bits snmptools is working on your xp64.

About ProcessorPerformance\Percentage\_Total, are sure about that counter?
Null as a result is not good : it should always be a string of numeric.

Can you display the logfile for that counter?
Is it a specific vista counter? I have never met that counter before.

Regards,
Erwan.

Code: Select all

10:10:44:274 , SnmpExtensionQueryEx
10:10:44:274 , nRequestType=SNMP_EXTENSION_GET_NEXT
10:10:44:274 , GetNextRequest:1.3.6.1.4.1.15.2(8)
10:10:44:274 , GetPerf: path=MSExchange Database\I/O Database Reads Average Latency\*
10:10:44:289 , GetPerf: pdh_counter_path=\MSExchange Database(*)\I/O Database Reads Average Latency
10:10:45:303 , PdhGetFormattedCounterValue: ret=C0000BC6
10:10:45:303 , GetPerf: vartype=String
10:10:45:303 , value=null length=4
10:10:45:303 , Next OID: 1.3.6.1.4.1.15.3 idlength=8
10:10:45:303 , GetNextRequest OK
10:10:45:303 , SnmpExtensionQueryEx
10:10:45:303 , nRequestType=SNMP_EXTENSION_GET_NEXT
10:10:45:303 , GetNextRequest:1.3.6.1.4.1.15.2(8)
10:10:45:319 , GetPerf: path=MSExchange Database\I/O Database Reads Average Latency\*
10:10:45:319 , GetPerf: pdh_counter_path=\MSExchange Database(*)\I/O Database Reads Average Latency
10:10:46:333 , PdhGetFormattedCounterValue: ret=C0000BC6
10:10:46:333 , GetPerf: vartype=String
10:10:46:333 , value=null length=4
10:10:46:333 , Next OID: 1.3.6.1.4.1.15.3 idlength=8
10:10:46:333 , GetNextRequest OK
10:10:46:333 , SnmpExtensionQueryEx
10:10:46:333 , nRequestType=SNMP_EXTENSION_GET
10:10:46:333 , GetRequest: OID=1.3.6.1.4.1.15.2 (8)
10:10:46:349 , GetPerf: path=ProcessorPerformance\percentage\*
10:10:46:349 , GetPerf: pdh_counter_path=\ProcessorPerformance(*)\percentage
10:10:47:363 , GetPerf: vartype=Integer
10:10:47:363 , GetRequest: value=0 asn_type=2
10:10:47:363 , GetRequest: OK
10:10:47:363 , SnmpExtensionQueryEx
10:10:47:363 , nRequestType=SNMP_EXTENSION_GET
10:10:47:363 , GetRequest: OID=1.3.6.1.4.1.15.2 (8)
10:10:47:378 , GetPerf: path=ProcessorPerformance\percentage\*
10:10:47:378 , GetPerf: pdh_counter_path=\ProcessorPerformance(*)\percentage


Image

I did

Code: Select all

snmpwalk -v 1 -c public <host> 1.3.6.1.4.1.15.2

results : INTEGER :0

Code: Select all

[1.3.6.1.4.1.15.2]
counter=ProcessorPerformance\percentage\*
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

C0000BC6 means " performance counter not found".

The "*" generic char may not be supported as an instance name.
You may need to give the specific instance name, here "PPM_Processor_0" for example.
Although in that case the snmp get seems to works ok?

Same goes with "MSExchange Database(*)" : sicne you get "perf counter not found", you may have to give the exchange DB name instead of "*" ?

Let me know if it works out.

One thing for sure : if snmpget from command line works fine, cacti will accomodate as it is gets its datas from snmp get as well.

Regards,
Erwan.
Pilly
Posts: 29
Joined: Thu Dec 18, 2008 6:26 am

Post by Pilly »

erwan.l wrote:C0000BC6 means " performance counter not found".

The "*" generic char may not be supported as an instance name.
You may need to give the specific instance name, here "PPM_Processor_0" for example.
Although in that case the snmp get seems to works ok?
Ok, lets work on this processor one first. when i add the counter to the perfmon, it says <All instances> when i add it to perfmon it puts instances = *

I added the perfmon image so you could see what i expected (70), although like you say the snmp get seems to work.

When i put

Code: Select all

[1.3.6.1.4.1.15.2]
counter=ProcessorPerformance\percentage\PPM_Processor_0
The snmp walk is 70. so why wont it take the * as all instances?
wvankuyk
Posts: 14
Joined: Mon Dec 22, 2008 1:23 pm

Post by wvankuyk »

erwan.l wrote:
can you tell me more about your xp? lang? 32/64 bits?
also give me the perf32 command line.

Regards,
Erwan.
32bit sp3 XP professional english

Code: Select all

perf32.exe" "Processor\% Processor Time\_Total"
perf.init:Error -1073741772:Unable read MULTI_SZ value
null
Pilly
Posts: 29
Joined: Thu Dec 18, 2008 6:26 am

Post by Pilly »

Sorry, this is windows server 2008 64 bit.

Code: Select all

C:\temp\snmptools2>perf32 "ProcessorPerformance\percentage\*"
null
C:\temp\snmptools2>

Code: Select all

C:\temp\snmptools2>perf32 "ProcessorPerformance\percentage\PPM_Processor_0"
70
C:\temp\snmptools2>
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Pilly,
I'll see how I can handle the "*" char.
Snmptools does not manage it for now (dit not know that).

wvankuyk,
I'll work on that error.
MULTI_SZ error indicates an error when retrieving the perf counter list from registy. (this one Software\Microsoft\Windows NT\CurrentVersion\Perflib).

Regards,
Erwan

edit : wvankuyk, would it possible for you to export the reg key above and attach it as a txt file? this way I can debug much faster.
benzo
Posts: 14
Joined: Wed Aug 13, 2008 6:58 am

Concurrent queries?

Post by benzo »

Hi Erwan,

Very nice tool - I'm putting it to use monitoring a bunch of Windows servers, both 32-bit and 64-bit.

I've noticed that using your tool can make SNMP stop responding to subsequent queries, which can degrade the ability to monitor the server. I've had to set the per-host SNMP timeout in Cacti to 10 seconds.

I'm only using perfmon counters, no scripts. The problem is particularly bad when trying to use indexed SNMP queries from Cacti

Have you seen this before?

Ben.
benzo
Posts: 14
Joined: Wed Aug 13, 2008 6:58 am

Maximum number of counters

Post by benzo »

Hi again,

Is there a hard limit of 256 counters?

If I have more than 256 counters in my INI file snmpwalk fails with an "End of MIB" error on every OID I try to walk.

I'm trying to set up indexes of logical drives, and to cover all possible options I need to use a minimum of 3 x 24 (index, description, and value for letters C thru Z), which means I'm using 72 for every statistic. I'm also monitoring a stack of other counters which I would like to create indexes for as well, so I'm going to need a lot more defined.

Is there a way around this?

Thanks,

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

Post by erwan.l »

Hi benzo,
About the 256 limit, I probably used a byte variable (0-255).
I will change it to word (255^2) later this evening and will release it then.

Must be quite a big ini file ! :)

About your previous post, are you using cactid?
If not, that could be the solution to snmp stop responding when you have numerous queries.

Thanks for the feedback,
Erwan.

PS :
I did not use yet snmp indexed queries.
Would you have an example / screenshot?

ps2: snmptools.zip reuploaded with 256 limit (hopefully) fixed.
now the ini files can contain more than 256 sections.
shanecentre
Posts: 9
Joined: Tue Oct 02, 2007 10:53 am

Post by shanecentre »

This may be a dumb question, but how do I get and snmpget to return a float. When I run an snmpget against an oid in my counter.ini file it returns an integer. When I run the iptools and check the counter it is always a float. I've tried adding "type=float" to my counter.ini file but that returns and error. I would really like to get 3.74 instead of 4 for example.

Great tool, I plan to use it quite a bit!
benzo
Posts: 14
Joined: Wed Aug 13, 2008 6:58 am

performance

Post by benzo »

Hi Erwan,

The updated DLL does the trick - I don't have any more problems with the number of counters in the INI file.

I've attached a screen shot of my indexed disk query. It basically looks at the drive letters from C-Z and shows their size, so that only actual disks can be selected (I can't find a way to only return the disks which exist). I can then make disk space, IO, and queue graphs.

I've also attached an excerpt from my INI which shows the disk counters. I use a VB script to get the disk size, free space, and available space, as these counters aren't available in bytes through the PerfMon counters.

We are using spine for polling, and the behaviour I'm seeing is that if simultaneous SNMP walks or queries are run against SNMPTool counters, the results are returned very slowly, and the queries often time out. This happens quite a lot as spine is very good at running queries simultaneously.

Do you think it would be possible to improve the performance of your DLL so it can handle multiple queries more efficiently?

Many thanks for the great work.

Ben.
Attachments
Capture.JPG
Capture.JPG (26.29 KiB) Viewed 5258 times
counters.txt
(25.72 KiB) Downloaded 229 times
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Hi Shanecentre : can you tell me which os version you use? xp/2003? 32/64bits? what snmptools version?

Hi Benzo : i'll see how i can simulate workload.
How many servers * counters do you (roughly) query?

About this "as these counters aren't available in bytes through the PerfMon counters", why dont you use a cdef counter in cacti (div 1024*1024) ?

Regards,
Erwan.
benzo
Posts: 14
Joined: Wed Aug 13, 2008 6:58 am

Post by benzo »

erwan.l wrote:About this "as these counters aren't available in bytes through the PerfMon counters", why dont you use a cdef counter in cacti (div 1024*1024) ?
I tried that, but I also wanted to plot used space and total space, which I needed a script for, and I could get in Bytes. I wanted the free space to be as precise as the used and total space counters so I just implemented a script to gather it in Bytes. Incidentally, the script returns faster than the PerfMon counter.

Ben.
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests