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 »

Hi Benzo,
Oki I understand.
What you may want to investigate is one script only to retrieve multiple values.
I know that cacti can handle such things (with a pipe between each value?).

If this works, this shall boots performances a lot.

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

Post by benzo »

erwan.l wrote:Hi Benzo,
Oki I understand.
What you may want to investigate is one script only to retrieve multiple values.
I know that cacti can handle such things (with a pipe between each value?).

If this works, this shall boots performances a lot.

Regards,
Erwan.
The problem with using scripts on the Cacti side is that with large numbers of monitored hosts this significantly increases the load on the Cacti server. By using your SNMP tool I can move the script processing to the monitored host, and the Cacti server only has to use SNMP to get the data, which greatly reduces the load on the Cacti server.

The performance problems I'm seeing aren't necessarily to do with using scripts for the counters - I see contention issues if all I'm retrieving is the string index data.

Ben.
shanecentre
Posts: 9
Joined: Tue Oct 02, 2007 10:53 am

Post by shanecentre »

Sorry,

I'm using snmptools 32bit 2.0.0.5 (latest from your site) on Windows 2003 64 to retrieve Exchange 2007 counters. I have used IP Tools (latest from your site) on the machine to confirm the counter names and results.

My Cacti server is Linux (RHEL 5) and when I do snmpget I always get an Int. I have tried it from an snmp tool on WinXP with the same results.

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

Post by erwan.l »

Hi Shanecentre,
It could be a bug with the snmptools version (2.0.0.5).
This is an old one.
Can you download it again (it should be 2.0.0.10).

If you get the bug again, post the debug log file and I will fix the issue.

Regards,
Erwan.
shanecentre
Posts: 9
Joined: Tue Oct 02, 2007 10:53 am

Post by shanecentre »

Typo on my part I did have 2.0.0.10

He is my log.txt

13:52:21:181 , SnmpExtensionQueryEx
13:52:21:181 , nRequestType=SNMP_EXTENSION_GET
13:52:21:181 , GetRequest: OID=1.3.6.1.4.1.15.4 (8)
13:52:21:197 , GetPerf: path=MSExchange OWA\Requests/sec
13:52:21:197 , GetPerf: pdh_counter_path=\MSExchange OWA\Requests/sec
13:52:22:197 , GetPerf: vartype=Integer
13:52:22:197 , GetRequest: value=6 asn_type=2
13:52:22:197 , GetRequest: OK
13:52:22:197 , SnmpExtensionQueryEx
13:52:22:197 , nRequestType=SNMP_EXTENSION_GET
13:52:22:197 , GetRequest: OID=1.3.6.1.4.1.15.4 (8)
13:52:22:212 , GetPerf: path=MSExchange OWA\Requests/sec
13:52:22:212 , GetPerf: pdh_counter_path=\MSExchange OWA\Requests/sec
13:52:23:213 , GetPerf: vartype=Integer
13:52:23:213 , GetRequest: value=1 asn_type=2
13:52:23:213 , GetRequest: OK

I've tried snmpget with -v 1 and -v 2c from linux and windows.

Look like it is coming as type=asn_integer32
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Hi Shanecentre,
Strange behavior indeed.

Snmptools adapts the asn_type depending on the value type, and this for each requests.
So it could be that you got "unlucky" and than there was no float to return when you did your queries (unlikely hypothesis).

Also you can try this :
add flag=raw just above the counter line.
or flag=cdbl, or a flag=raw,cdbl .

Regards,
Erwan.
Last edited by erwan.l on Fri Feb 27, 2009 2:58 am, edited 1 time in total.
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Benzo,
About the performance issue, when you query a perf counter, by default the perf datas will be collected twice with a one second delay.
This is mandatory for interval counters (bytes/sec, reqs/sec, etc ...).
How ever this is not mandatory for plain counters, like disk size, etc.

For these counters, you can add flag=norefresh just above the counter line.

I know this not applicable to you since you use vbs scripts and not counters but I thought you may (or others) use that information.

Still looking at the vbs perf issue.

I will also come with an example where you can have one unique vbs script returning multiple values.
That might be one way to speed up things : call one time a script for a disk instead of 3 times.

Regards,
Erwan.
mphuie
Posts: 11
Joined: Wed Feb 18, 2009 2:56 pm

Post by mphuie »

I'm using the "SNMP - Generic OID Template " that comes with cacti.

Max Value = 1000000
Data Source Type = GAUGE
OID = 1.3.6.1.4.1.15.2

I've tested the OID with snmpget to get free space on two servers which seem to work fine.

c:\net-snmp\bin\snmpwalk -v 1 -c public 127.0.0.1
1.3.6.1.4.1.15.2

SNMPv2-SMI::enterprises.15.2 = INTEGER: 23643

However, I'm getting no data in my graphs (-1.#J) and this is showing up in the log file. Other built in SNMP graphs (CPU, storage, NIC traffic) are working

local machine query

02/27/2009 11:55:04 AM - CMDPHP: Poller[0] Host[2] DS[12] WARNING: Result from SNMP not valid. Partial Result: U

another machine query

02/27/2009 11:55:04 AM - CMDPHP: Poller[0] ASSERT: '85357526<23108' failed. Recaching host '10.43.0.98', data query #8

Any ideas?

Cacti on WinXP PHP/MySQL. Net-SNMP 5.4.2.1
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Hello mphuie,
The error lays there I would say : ASSERT: '85357526<23108' .

But I am not a cacti specialist and cannot understand what it means.
To me it has to do with your graph or data template.
Could it be because of the gauge type?

Instead of snmpwalk, have you tested snmpget -v 1 -c public 127.0.0.1 ?

Regards,
Erwan.
mphuie
Posts: 11
Joined: Wed Feb 18, 2009 2:56 pm

Post by mphuie »

For some reason it started working. Now I'm having this issue:

counters.ini

counter=MSMQ Queue\Messages in Queue\fcev02\private$\enterprise vault storage archive

C:\net-snmp\bin>snmpget -v 1 -c public fcev02 .1.3.6.1.4.1.15.4
SNMPv2-SMI::enterprises.15.4 = STRING: "null"

snmpget is giving me NULL when the correct value is 0. Using IP tools to query that object gives me 0. A powershell query also gives 0.

Am I formatting the counter incorrectly? I tried quotes around the whole string as well as a quotes around the instance: "fcev02\private$\enterprise vault storage archive"

IP tools lists the object this way:

Objects
MSMQ Queue
Counters
Messages in Queue
Instances
fcev02\private$\enterprise vault storage archive
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Hi Mphuie,
Uhm I am not sure I manage correctly the "\" character, like the "*" mentionned a previous post.

Could you display the log file?

Thanks,
Erwan.
temak82
Cacti User
Posts: 59
Joined: Tue May 02, 2006 3:00 pm

Post by temak82 »

Hi Erwan,

Great script here. We will most likely be using it on a Win 2k3 Enterprise 64bit servers on.

I looked at your iptools page and had a few questions:

1. How do you know what to put into the definition ini file and do you use a simple word editor (notepad) to create it? Do we download your IPsniffer.zip to use the perf counter and get the values from it?

2. We just need to copy the snmptools64.dll to the system32 folder on the system to be monitored and then run the regagent64 to get it going? Or do we need to copy all of the contents in the zipped file?

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

Post by erwan.l »

Hi Temak82,

For the ini file, you can use any editor to do it.
You can define NT counters or vbs scripts.
Iptools will not make the ini file for you, but it will help you find the counter you are looking for.

Example :
[1.3.6.1.4.1.15.1]
counter=LogicalDisk\Free Megabytes\_Total

How to install it is detailed here : http://erwan.labalec.fr/snmptools/ .
Stick to the 32bits version for now, even on 64bits system as I have less time to support the 64bits version of snmptools.

Double click on regagentWow6432.reg and copy the DLL file to the windows folder then, not system32.
Restart snmp service and you are settled.

Regards,
Erwan.
Last edited by erwan.l on Wed Apr 11, 2012 10:58 am, edited 1 time in total.
Stone_ll
Posts: 16
Joined: Thu Mar 05, 2009 2:15 am

Post by Stone_ll »

Hi,erwan
I use snmptools for a while,but there is a problem.It is that it lead to snmp service down (stopped automatically).
Even it can lead to snmp service falling apart(It cann't be started manually unless the server rebooted)

Mabye there is something wrong.
The value is that returned by an executable I used.
The executable can get the tracker's online number. (The trackers run on our servers serviced to our customers)

I often run the executable on our server normally, it can get the people's number on the tracker running on the server .But sometimes it display the information :

[root@bbs]/usr/local/etc/nagios/object#snmpwalk -v 2c -c public 61.155.8.31 1.3.6.1.4.1.15
Error in packet.
Reason: (genError) A general failure occured
Failed object: SNMPv2-SMI::enterprises.15

SNMPv2-SMI::enterprises.15 = STRING: "snmptools by erwan.l@free.fr"



how do I do for this error?
waiting for your reply ..thanks a lot !
ps:I have sent a mail to your mailbox----erwan.l@free.fr
erwan.l
Cacti User
Posts: 138
Joined: Tue Jan 22, 2008 4:36 am
Contact:

Post by erwan.l »

Hi Stone_II,
What O.S and snmptools version are you running?

Regards,
Erwan.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests