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
MadX
Posts: 31
Joined: Wed Apr 23, 2008 7:10 pm

Post by MadX »

i have the another problem with the DLL, every thing seems ok, but the graph is not showing any thing, when i try to retrive a counter like "PhysicalDisk\\Avg. Disk Queue Length" with the snmpwalk.exe and snmpget.exe with the proper command using the right OID "1.3.6.1.4.1.15.20.4.2.2" in my server and the respons from such command is
SNMPv2-SMI::enterprises.15.20.4.2.2 = STRING: "0.00295783067119575"

in the log of the DLL it`s showing that is ok
05:14:27:312 , SnmpExtensionInit
05:14:27:312 , start
05:14:27:703 , objectcount=56
05:14:40:953 , SnmpExtensionQuery
05:14:40:953 , PduType=SNMP_PDU_GETNEXT
05:14:40:953 , GetNextRequest:1.3.6.1.4.1.15.20.4.2.2(11)
05:14:40:953 , result= length=0 idlength=11
05:14:40:953 , length(str_result)=0
05:14:41:031 , SnmpExtensionQuery
05:14:41:031 , PduType=SNMP_PDU_GET
05:14:41:031 , GetRequest: OID=1.3.6.1.4.1.15.20.4.2.2 (11)
05:14:41:031 , GetPerf: Retrieving performance datas...
05:14:41:031 , formatvalue: VarType=Double
05:14:41:031 , result=0.0139895098963121 asn_type=4
05:14:41:031 , GetRequest OK
05:20:10:109 , SnmpExtensionQuery
05:20:10:109 , PduType=SNMP_PDU_GETNEXT
05:20:10:109 , GetNextRequest:1.3.6.1.4.1.15.20.4.0.2(11)
05:20:10:109 , result= length=0 idlength=11
05:20:10:109 , length(str_result)=0
05:20:10:187 , SnmpExtensionQuery
05:20:10:187 , PduType=SNMP_PDU_GET
05:20:10:187 , GetRequest: OID=1.3.6.1.4.1.15.20.4.0.2 (11)
05:20:10:187 , GetPerf: Retrieving performance datas...
05:20:10:187 , formatvalue: VarType=Double
05:20:10:187 , result=0.0012765973560219 asn_type=4
05:20:10:187 , GetRequest OK

and the command
snmpwalk.exe -v 2c -c public "server" "OID"

but still in the graph for this OID template is empty and not showing any thing.
even the debug result for that one graph is not giving any error or somthing.

in the cacti log it is giving me
04/24/2008 04:23:02 AM - CMDPHP: Poller[0] Host[5] DS[85] WARNING: Result from SNMP not valid. Partial Result:

and recording to BSOD2600 reply to this question in this topic http://forums.cacti.net/viewtopic.php?p=133951

that cacti can't handle a number in a string.

however your DLL file is a very brilliant idea, i`m looking to see it working with me.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

I was wrong, cacti CAN handle integers in a String. But I think the problem lays with yours is not a whole number...
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Hello Madx,

Your log file looks ok to me.

At my place it looks the same :

21:27:51:750 , SnmpExtensionQuery
21:27:51:750 , PduType=SNMP_PDU_GET
21:27:51:750 , GetRequest: OID=1.3.6.1.4.1.15.25.7.2.2 (11)
21:27:51:750 , GetPerf: Retrieving performance datas...
21:27:52:171 , formatvalue: VarType=Double
21:27:52:171 , result=0.315889167463277 asn_type=4
21:27:52:171 , GetRequest OK

The internal perf counters reports a value type double and the snmp agent sends back a value type 4 (string) which is (to my knowledge) the way to send back decimals in snmp world.
You only have to make sure that the "." is your system decimal separator.

Eventually, check this oid 1.3.6.1.4.1.15.20.4.2.3 which should reports something like this : PhysicalDisk\Avg. Disk Read Queue Length\_Total (type:4) to be sure you are addressing the right OID.

Also I have attached my cacti templates in case you want to test them.
It is a very simply snmp template modified.

Regards,
Erwan.
Attachments
templates.zip
(3.86 KiB) Downloaded 572 times
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

To Brashquido:
Make sure to check the counter name by terminating your oid with a 3 instead of a 2 to be sure you are querying the right OID :

1.3.6.1.4.1.15.26.7.1.3 will output PhysicalDisk\Avg. Disk Read Queue Length\0 C: (type:4) and I therefore know I have to query 1.3.6.1.4.1.15.26.7.1.3 to get my value.

Regards,
Erwan.
MadX
Posts: 31
Joined: Wed Apr 23, 2008 7:10 pm

Post by MadX »

frist i thank you for giving some times to support your plugin and for helping us too.

i did import the templates, and with the right tested OID
1.3.6.1.4.1.15.20.4.2.2

and yes 1.3.6.1.4.1.15.20.4.2.3 is giving "PhysicalDisk\\Avg. Disk Queue Length\\_Total"

but still nothing in the graph.
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Hi MadX,
What is your cacti version?

Did you manage to graph other oid's such as used memory for example?
Testing this one could exclude an issue with the decimals.

Regards,
Erwan.
MadX
Posts: 31
Joined: Wed Apr 23, 2008 7:10 pm

Post by MadX »

well, when i was about to test other OID like the memory OIDs, i found another problem but this time not from cacti and here is the details:

when i use snmpwalk for 1.3.6.1.4.1.15 i get the list for the counters so i take the memory sub-OID witch is 27 and for the memory Pages/Sec the sub-OID is 9, Now the OID 1.3.6.1.4.1.15.27.9.1 is replaying

"Pages/sec"

and the log is
02:57:05:093 , SnmpExtensionInit
02:57:05:093 , start
02:57:05:562 , objectcount=54
02:57:41:765 , SnmpExtensionQuery
02:57:41:765 , PduType=SNMP_PDU_GETNEXT
02:57:41:765 , GetNextRequest:1.3.6.1.4.1.15.27.9.1(10)
02:57:41:765 , result=Pages Input/sec length=15 idlength=10
02:57:41:765 , GetNextRequest OK
02:57:41:843 , SnmpExtensionQuery
02:57:41:843 , PduType=SNMP_PDU_GET
02:57:41:843 , GetRequest: OID=1.3.6.1.4.1.15.27.9.1 (10)
02:57:41:843 , result=Pages/sec asn_type=4
02:57:41:843 , GetRequest OK


But here is the problem, The OID 1.3.6.1.4.1.15.27.9.2 is replaying
Error in packet.
Reason: (genError) A general failure occured
Failed object: SNMPv2-SMI::enterprises.15.27.9.2

SNMPv2-SMI::enterprises.15.27.9.2 = STRING: "Memory\\Pages/sec"

And the log is
02:59:09:515 , SnmpExtensionQuery
02:59:09:515 , PduType=SNMP_PDU_GETNEXT
02:59:09:515 , GetNextRequest:1.3.6.1.4.1.15.27.9.2(10)
02:59:09:515 , result= length=0 idlength=10
02:59:09:515 , length(str_result)=0
02:59:09:593 , SnmpExtensionQuery
02:59:09:593 , PduType=SNMP_PDU_GET
02:59:09:593 , GetRequest: OID=1.3.6.1.4.1.15.27.9.2 (10)
02:59:09:593 , result=Memory\Pages/sec asn_type=4
02:59:09:593 , GetRequest OK

when trying with snmpget for OID 1.3.6.1.4.1.15.27.9.2 it is giving
Error in packet
Reason: (badValue) The value given has the wrong type or length.
Failed object: SNMPv2-SMI::enterprises.15.27.9.1.2

and the log is
03:02:56:296 , DLL_PROCESS_DETACH
03:02:56:296 , clean
03:02:56:890 , SnmpExtensionInit
03:02:56:890 , start
03:02:57:359 , objectcount=54
03:03:03:859 , SnmpExtensionQuery
03:03:03:859 , PduType=SNMP_PDU_GET
03:03:03:859 , GetRequest: OID=1.3.6.1.4.1.15.27.9.1.2 (11)
03:03:03:859 , GetPerf: no condition match
03:03:03:859 , counter=9/31 instance=1/-1
03:03:03:859 , length(str_result)=0
03:03:03:859 , GetRequest Failed



any way i found another "working" OID 1.3.6.1.4.1.15.40.2.2.2 for the network interface "Packets/sec" and in the cacti is still not showing any thing in the graph where the logs and the replay from snmpget is well and OK.

Operating System: Windows XP Sp2
Webserver: Apache Http server 2.0.63
Cacti: Version 0.8.7b
Spine: Version 0.8.7a that comes with the latest beta installer of cacti
MySQL: version 5 that comes with the latest beta installer of cacti
PHP: 5.2 that comes with the latest beta installer of cacti
RRDTool (Cygwin or Win32 version): that comes with the latest beta installer of cacti
Net-SNMP: version 5.4.1.3 that comes with the latest beta installer of cacti
Plugin Architecture: 2.1

in the log of cacti it`s always showing
04/27/2008 05:46:02 AM - CMDPHP: Poller[0] Host[4] DS[93] WARNING: Result from SNMP not valid. Partial Result:

where DS[93] is our template no matter what OID i try.

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

Post by erwan.l »

* The snmp get next support is very limited so far so it is not to be trusted.
I still need to work on that.
So lets skip the snmpwalk for now.

* Regarding this OID of yours : 1.3.6.1.4.1.15.27.9.1.2.
I believe I know where the errors come from :
It should be 1.3.6.1.4.1.15.27.9.0.2.

Indeed, for this particular counter Memory\\Pages/sec, there is no instance.
This is why you get
03:03:03:859 , GetPerf: no condition match
03:03:03:859 , counter=9/31 instance=1/-1

instance=1/-1 means you have requested instance number 1 whereas there is no instance (and therefore you should use 0).

I realise these logs are a bit obscure for anybody else but me :)

* Coming back to your issue, I really feel like the issue is the float value with your cacti.
If you manage to get a working value with snmpget, the issue can only be in cacti.

I am convinced 1.3.6.1.4.1.15.27.9.0.2 will work for you (pages/sec) but it is still a float value.
Try this oid at your place which a whole number : 1.3.6.1.4.1.15.27.2.0.2 which should give you the 'available bytes'.

* about browsing OID's, you can use another of my software to query perf counters and get the oid path easier.
see picture below.
you can found this form under tools\ms networks\perf counters.

Regards,
Erwan.
Attachments
perf.jpg
perf.jpg (54.62 KiB) Viewed 9522 times
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Note that you can test the perf object, the snmp oid and the graph output in the same tool (you must have rrdtool.exe in the same folder).

In the picture below, I test my "avg disk queue length" perf object, identify my "oid path" (here 26.4.2), then test it via snmp get (1.3.6.1.4.1.15.26.4.2.2) and decide to see what the RRD graph will look like.

Beware that IpTools is a bit of a geek tool : not documented and not always user friendly...

Tool is there : http://erwan.l.free.fr/sniffer.zip .

/Erwan
Attachments
rrdtool.JPG
rrdtool.JPG (212.17 KiB) Viewed 9516 times
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

I installed latest cacti :

Cacti Version 0.8.7b
Cacti OS win32
SNMP Version net-snmp 5.4.1-3
RRDTool Version RRDTool 1.0.x

I used this oid .1.3.6.1.4.1.15.34.29.0.2 which is at my place results in "Memory\Available KBytes".

The snmp log reports this :
16:41:03:125 , SnmpExtensionQuery
16:41:03:125 , PduType=SNMP_PDU_GET
16:41:03:125 , GetRequest: OID=1.3.6.1.4.1.15.34.29.0.2 (11)
16:41:03:125 , GetPerf: Retrieving performance datas...
16:41:03:546 , formatvalue: VarType=Double
16:41:03:546 , result=118004 asn_type=2
16:41:03:546 , GetRequest OK

Cacti reports this :
04/27/2008 04:41:03 PM - CMDPHP: Poller[0] Host[2] DS[15] SNMP: v2: 127.0.0.1, dsname: snmp_oid, oid: .1.3.6.1.4.1.15.34.29.0.2, output: 118004

And graph is displayed ok (see below).

So at least I know for sure that latest cacti version is ok with my snmp agent.

Now trying a float value.

/Erwan
Attachments
graph_image.php.png
graph_image.php.png (3.52 KiB) Viewed 9510 times
Last edited by erwan.l on Sun Apr 27, 2008 2:52 pm, edited 1 time in total.
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Float values look to be fine as well.

I used that oid 1.3.6.1.4.1.15.27.4.2.2 = PhysicalDisk\Avg. Disk Queue Length\_Total.

Snmp agent log reports:
17:06:06:437 , SnmpExtensionQuery
17:06:06:437 , PduType=SNMP_PDU_GET
17:06:06:437 , GetRequest: OID=1.3.6.1.4.1.15.27.4.2.2 (11)
17:06:06:437 , GetPerf: Retrieving performance datas...
17:06:06:859 , formatvalue: VarType=Double
17:06:06:859 , result=2.45797742575789 asn_type=4
17:06:06:859 , GetRequest OK

Cacti reports:
04/27/2008 05:06:06 PM - CMDPHP: Poller[0] Host[2] DS[17] SNMP: v2: 127.0.0.1, dsname: snmp_oid, oid: .1.3.6.1.4.1.15.27.4.2.2, output: 2.45797742575789

And graph looks fine (see below).

/Erwan

Note : I am not using spine but the regular cmd.php poller.
Attachments
graph_image.php.png
graph_image.php.png (3 KiB) Viewed 9505 times
MadX
Posts: 31
Joined: Wed Apr 23, 2008 7:10 pm

Post by MadX »

i can't beleive that, i notice you typed the OID onec up there with "." befor
so this OID for memory pages/secondes
1.3.6.1.4.1.15.27.9.0.2
will be
.1.3.6.1.4.1.15.27.9.0.2

when i try using the "." evrey thing workd up. and all the counters worked thanks for helping out, i really appreciate your help.

my mistake.

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

Post by erwan.l »

Hi Madx,
No problem : I'm glad I could help !

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

Post by lacteolus »

Hi
It's a great idea to get Windows PerfMon counters through SNMP from Unix machines. But the only problem is the difference between OIDs from different machines. 1stComp OIDs is not the same as the 2ndComp OIDs. It's sad.
erwan.l, did you think about it? Any ideas?
Best regards!
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Hi lacteolus,
Indeed, this is bothering me as well.

I am thinking of redesigning this agent so that it would get its oids from an external xml file.
A tool would help you extract the perf counters and shape the xml file.

This way you could focus on specifics perf counters and not the whole package and also you would have the same set with identical oids on all servers.

I now need to answer some questions :
should it be a different dll, should it be an option, should it replace the previous dll, etc...

Suggestions are welcome.

Regards,
Erwan.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests