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
wvankuyk
Posts: 14
Joined: Mon Dec 22, 2008 1:23 pm

Post by wvankuyk »

erwan.l wrote:1/
The Script part (batch, vbs, executable or any process than output a result) will be run on the client part, not on the server part.
So there is no overhead on the server part.
That is good to hear, are the script executed at a regular interval before hand or at the time the OID is queried by the cacti server?
erwan.l wrote:2/
My initial goal was to benefit from windows features (perf counters, vbs, wmi, etc) with a linux cacti server.

For the non wmi perfmon counters, the agent natively supports it : just indicate the path in the ini file.
This was actually the first feature of this agent.
But us windows cacti implementors can also benefit :) good work. The perfmon counters within the world of WMI are usually called with a Win32_PerfRawData_PerfDisk_LogicalDisk class, how do I represent the same class with your config file?
erwan.l wrote:3/
You can graph anything you can think of : by the end, cacti will always receive it as an snmp value, so only regular snmp templates are necessary.
Could you attach a standard SNMP template? as I purged all of mine from the default install thinking I would not need them.... :oops:

I also was looking at some of your documentation, you said you support SNMP walk, but correct me if I am wrong, to setup something like an snmp query template, I would have to taylor the ini file to include all the instances of say drives on my system, you have no automated fuctions for that. Maybe something for me to script as part of a deployment for my servers....
erwan.l wrote:4/
For the rolling out, copy paste the dll to system32, register a reg file and your are done.
This could easily be automated and/or I could do an installation setup.
I also advise you make one unique ini file for your company defining your own OID list.
All I would need is a slightly modified INI files for those servers that have more then one of the following, Network cards, CPUs and Disks is that also a correct statement?
erwan.l wrote:5/
This agent will be hosted by the MS snmp service : all snmp aspects are managed by the MS service (community, traps, security, etc ...).
The only specific to my snmp agent is the enterprise OID.
Great news! Should make some of my IT security guys happy that MS still would control the access to the counters.

Question: If someone were to be "nasty" could they not interject some nasty exe string into the ini file causing a lot of problems? Could I lock that INI file down, to where only the local system account as well as my account or another admin has access, or are there additional rights needed?

Thanks!


I hope this answered your questions :)

Regards,
Erwan.
wvankuyk
Posts: 14
Joined: Mon Dec 22, 2008 1:23 pm

IP Tools -> MS networks -> Perf Counters error message

Post by wvankuyk »

erwan.l ,

IP Tools -> MS networks -> Perf Counters error message

I have a strange error message, which I do not understand when I launch your tool against my windows XP machine: -1073741772 "unable to read multi_sz value". this incidently is the same error I get when I run.... perf32.exe which is included with your snmptools download....

Any insight?

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

Post by erwan.l »

That is good to hear, are the script executed at a regular interval before hand or at the time the OID is queried by the cacti server?
at the time cacti sends a query.

But us windows cacti implementors can also benefit good work. The perfmon counters within the world of WMI are usually called with a Win32_PerfRawData_PerfDisk_LogicalDisk class, how do I represent the same class with your config file?
[1.3.6.1.4.1.15.1]
counter=PhysicalDisk\Avg. Disk Queue Length\_Total
Could you attach a standard SNMP template? as I purged all of mine from the default install thinking I would not need them....

I also was looking at some of your documentation, you said you support SNMP walk, but correct me if I am wrong, to setup something like an snmp query template, I would have to taylor the ini file to include all the instances of say drives on my system, you have no automated fuctions for that. Maybe something for me to script as part of a deployment for my servers....
Best is to duplicate a snmp template.
SNMP walk is supported indeed and you can configure your ini file like this to support snmp data query:

;here below if you want to build a data query from cacti
; Index
[1.3.6.1.4.1.15.10.1]
type=string
counter=2
[1.3.6.1.4.1.15.10.1.1]
type=string
counter=1
[1.3.6.1.4.1.15.10.1.2]
type=string
counter=2

; Name / description (input field)
[1.3.6.1.4.1.15.10.2]
type=string
counter=2
[1.3.6.1.4.1.15.10.2.1]
type=string
counter=Available Bytes
[1.3.6.1.4.1.15.10.2.2]
type=string
counter=Committed Bytes

; data to send back (output field)
[1.3.6.1.4.1.15.10.3]
type=string
counter=2
; Available Bytes
[1.3.6.1.4.1.15.10.3.1]
counter=memory\Available Bytes
; Committed Bytes
[1.3.6.1.4.1.15.10.3.2]
counter=memory\Committed Bytes
All I would need is a slightly modified INI files for those servers that have more then one of the following, Network cards, CPUs and Disks is that also a correct statement?
Yes.
Question: If someone were to be "nasty" could they not interject some nasty exe string into the ini file causing a lot of problems? Could I lock that INI file down, to where only the local system account as well as my account or another admin has access, or are there additional rights needed?
the ini file, being on your server is as safe as any other files

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

Post by erwan.l »

Hi wvankuyk,
I have a strange error message, which I do not understand when I launch your tool against my windows XP machine: -1073741772 "unable to read multi_sz value". this incidently is the same error I get when I run.... perf32.exe which is included with your snmptools download....
can you tell me more about your xp? lang? 32/64 bits?
also give me the perf32 command line.

Regards,
Erwan.
lacteolus
Posts: 12
Joined: Tue Jul 15, 2008 2:55 am

Post by lacteolus »

Hi, erwan.l
I used your snmptools.dll v.1.0.0.8. A few days ago I replaced it with snmptools.dll v.2.0.0.8. And now I have growing C:\log.txt with records like this:
13:45:08:679 , GetPerf: executing cscript /nologo c:\Windows\snmptools.vbs -t "0 C: D:"
But HKLM\SOFTWARE\Snmptools\CurrentVersion\debug="0". I don't understand where I can turn it off.
Can you help me?
Best regards.
Pilly
Posts: 29
Joined: Thu Dec 18, 2008 6:26 am

Post by Pilly »

Hi,

Ive been playing with this.

Im running the 64bit version on windows server 2008.

Code: Select all

[1.3.6.1.4.1.15.1]
counter=PhysicalDisk\Avg. Disk Queue Length\_Total

[1.3.6.1.4.1.15.2]
counter=LogicalDisk\% Free Space\_Total

[1.3.6.1.4.1.15.3]
type=string 
counter=this is a message 

[1.3.6.1.4.1.15.4]
counter=ProcessorPerformance\Percentage\*

[1.3.6.1.4.1.15.5]
counter=Memory\Available MBytes\_Total

[1.3.6.1.4.1.15.6]
counter=Processor\% Idle Time\_Total
Any ideas why when i walk these, it always comes up with Counter64 : 0??
If i do it manually
C:\temp\snmptools2>perf32 "Processor\% idle time\_total" i get 100 returned?
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Lactelous : it was a bug.
Now fixed.
Download snmptools2.zip and it should be ok.

Thanks for the bug report ! :)

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

Post by erwan.l »

Hi Pilly,
Can you enable the debug log and copy paste here or send it me?

I have never tested snmptools and win2008 and am eager to make it work.
Which version are you using? the 64bits or the 32bits?
To start with, I suggest you try the 32bits to address one issue at the time.

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

Post by erwan.l »

wvankuyk : looks like you get an error related to rights or sharename not available?
Can you copy paste the perf32 command line?

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

Post by Pilly »

erwan.l wrote:Hi Pilly,
Can you enable the debug log and copy paste here or send it me?

I have never tested snmptools and win2008 and am eager to make it work.
Which version are you using? the 64bits or the 32bits?
To start with, I suggest you try the 32bits to address one issue at the time.

Thanks,
Erwan.
Hi,
How do I turn on debug mode. Also Ive registered the 64 bit one, how can i swap to the 32bit version?
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Hi Pilly,
Lets stick to the 64bits version for now.
Enable debug that way :
Put debug="1" (string) under [HKEY_LOCAL_MACHINE\SOFTWARE\snmptools\currentversion] to debug to c:\log.txt.

/Erwan
mterry
Posts: 3
Joined: Fri Nov 24, 2006 2:17 pm
Location: San Antonio, TX

Post by mterry »

Can someone post some simple steps on how to get a graph working in cacti from this tool?

For example, if I try to graph the first entry in the sample ini file:

[1.3.6.1.4.1.15.1]
counter=PhysicalDisk\Avg. Disk Queue Length\_Total

I've installed the dll and reg entries. I can query the values manually.
I go to the host, add a graph, select Generic SNMP, add the OID 1.3.6.1.4.1.15.1 and get a graph with no values. If I use snmpget, I do get values from the OID.

I suspect I'm missing a step, or doing something wrong.

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

Post by erwan.l »

Hi mterry,
Once you have validated that snmpget works ok, it is all about using cacti

In cacti, did you make sure you included the "." before the oid?
It should be .1.3.6.1.4.1.15.1 , not 1.3.6.1.4.1.15.1 .

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

Post by Pilly »

erwan.l wrote:Hi Pilly,
Lets stick to the 64bits version for now.
Enable debug that way :
Put debug="1" (string) under [HKEY_LOCAL_MACHINE\SOFTWARE\snmptools\currentversion] to debug to c:\log.txt.

/Erwan
Results:

Code: Select all

09:17:44:798 , SnmpExtensionQueryEx
09:17:44:798 , nRequestType=SNMP_EXTENSION_GET_NEXT
09:17:44:798 , GetNextRequest:1.3.6.1.4.1.15.6(8)
09:17:44:798 , value=2 length=1
09:17:44:798 , Next OID: 1.3.6.1.4.1.15.10.1 idlength=9
09:17:44:798 , GetNextRequest OK
09:17:44:798 , SnmpExtensionQueryEx
09:17:44:798 , nRequestType=SNMP_EXTENSION_GET
09:17:44:798 , GetRequest: OID=1.3.6.1.4.1.15.6 (8)
09:17:44:798 , GetPerf: path=Processor\% Idle Time\_Total
09:17:44:813 , GetPerf: pdh_counter_path=\Processor(_Total)\% Idle Time
09:17:45:827 , GetPerf: vartype=Int64
09:17:45:827 , GetRequest: value=429496729600 asn_type=70
09:17:45:827 , GetRequest: OK
09:17:45:827 , SnmpExtensionQueryEx
09:17:45:827 , nRequestType=SNMP_EXTENSION_GET
09:17:45:827 , GetRequest: OID=1.3.6.1.4.1.15.6 (8)
09:17:45:827 , GetPerf: path=Processor\% Idle Time\_Total
09:17:45:827 , GetPerf: pdh_counter_path=\Processor(_Total)\% Idle Time
09:17:46:841 , GetPerf: vartype=Int64
09:17:46:841 , GetRequest: value=425201762304 asn_type=70
09:17:46:841 , GetRequest: OK
This results in Counter64:0
Im expecting 100%
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest