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
AZEng
Posts: 2
Joined: Wed Sep 09, 2009 10:01 am

Number format returned as snmp type=asn_string (4).

Post by AZEng »

Hi erwan,

I am using snmptools version 2.0.0.15 and have a curious issue. Values returned from a VBScript as numbers are being returned as as snmp type=asn_string (4).

This confuses our monitoring package (IPMonitor) as at times it will interpret the value as text or hex.

I have tried setting type=raw, cdbl and raw,cdbl to no avail.

Have any suggestions?

-L
AZEng
Posts: 2
Joined: Wed Sep 09, 2009 10:01 am

Never Mind

Post by AZEng »

I figured it out. :lol:
michasalz
Posts: 2
Joined: Tue Sep 15, 2009 8:30 am

Problems with full oid path

Post by michasalz »

the tool is very good, but i have a little problem regarding the full oid path.

I got the following numbers for PhysicalDisk\Avg. Disk Queue Lenght\_Total:

object_index: 52
counter_index: 4
instance_index: 2

When i try to use a snmpget (in other case snmpwalk) i got the following error:

snmpget -v 2c -c public x.x.x.x 1.3.6.1.4.1.15.52.4.2.2 (for the value)

Error in packet
Reason: (badValue) The value given has the wrong type or length.
Failed object: SNMPv2-SMI::enterprises.15.52.4.2.1

I got this by a bulkwalk:

SNMPv2-SMI::enterprises.15.52.1 = STRING: "PhysicalDisk"
SNMPv2-SMI::enterprises.15.52.2 = STRING: "31"
SNMPv2-SMI::enterprises.15.52.3 = STRING: "2"

Can i extend the snmp configuration that i will get the whole oid path?

If there is no chance, i will change it to hardcoded oids!

if there is any solution it will be cool!
michasalz
Posts: 2
Joined: Tue Sep 15, 2009 8:30 am

Problems with full oid path

Post by michasalz »

Problem solved.

Another question: When i query a hardcoded oid (e.g. returns a value from a script) many times in short intervalls the snmp agent on the server will stop. Is there a possibility for a workaround?

Further informations:
A small bug: When the script returns with a line break the windows snmp agent will stop after ca. ten times.

Is this fixable?
fzdmp
Posts: 2
Joined: Mon Oct 12, 2009 4:42 am

Post by fzdmp »

Hello,

first off all, sorry if its the wrong thread, i am totally new to cacti, so not quite sure where my problem lies, might be unrelated to snmptools, if so, my apologize.

I installed snmptools according to the instructions.

if i query now with

Code: Select all

snmpget -v 1 -c dell x.x.x.x public .1.3.6.1.4.1.15.1
i get as result

Code: Select all

Cannot find module (NOTIFICATION-LOG-MIB): At line 1 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 1 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 1 in (none)
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: SNMP-USER-BASED-SM-MIB::usmUserPublic

SNMPv2-SMI::enterprises.15.1 = STRING: "0.000699986560258043"
the oid i definded in the counters.ini as avg disk queue length, and the string value in the last line matches the performance counter value, the error in the lines above do however make me a bit unsure if thats right, especially the error in packet.

the log file of snmptools shows

Code: Select all

14:33:03:332 , SnmpExtensionQueryEx
14:33:03:332 , nRequestType=SNMP_EXTENSION_GET
14:33:03:332 , GetRequest: OID=1.3.6.1.4.1.15.1 (8)
14:33:03:348 , GetPerf: path=PhysicalDisk\Avg. Disk Queue Length\_Total
14:33:03:348 , GetPerf: pdh_counter_path=\Physikalischer Datenträger(_Total)\Durchschnittl. Warteschlangenlänge des Datenträgers
14:33:04:348 , GetPerf: vartype=Double
14:33:04:348 , GetRequest: value=0.00349993280129022 asn_type=4
14:33:04:348 , GetRequest: OK
which looks ok to me.

in cacti however, after i defined the device (snmp community like query, smnp v1, port 161), the data source (generic oid template, max value 1, type gauge) and a graph using that data source, the graph doesnt show any values.

now i wonder as cacti newbie if i missed something in cacti, or if the "error in packet" in the snmpget indicates my problem is there despite the string getting reported correct and the log says the query was ok. (the rrd file gets created in the cacti rra folder, and it does get writen to it regulary, so it looks like cacti is pulling something).

grateful for any pointers

Florian
fzdmp
Posts: 2
Joined: Mon Oct 12, 2009 4:42 am

Post by fzdmp »

think i solved some things, but still get an empty graph

if i execute

Code: Select all

snmpget -v 1 -c dell x.x.x.x 1.3.6.1.4.1.15.1
i get

Code: Select all

SNMPv2-SMI::enterprises.15.1 = STRING: "0.00068921312537476"
in the meantime after adjusting the path settings for mibs.
this is executed on the polling machine where cacti is running.

when i check cacti log after setting it to high, i see this

Code: Select all

10/16/2009 11:09:19 AM - CMDPHP: Poller[0] Host[16] DS[353] WARNING: Result from SNMP not valid.  Partial Result: 
10/16/2009 11:09:19 AM - CMDPHP: Poller[0] Host[16] DS[353] SNMP: v1: x.x.x.x, dsname: snmp_oid, oid: 1.3.6.1.4.1.15.1, output: U
10/16/2009 11:09:19 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id,rrd_name,time,output) values (353,'snmp_oid','2009-10-16 11:09:00','U')"
so now i know why the graph is empty, though i have no idea why the returned result is partial, as the snmpget command seems to return something ok.

any ideas what i could try next? i increased the snmp timeout to 1000 ms after reading this could be an issue (though was mentioned as being an issue with disk size querys)
crimson
Posts: 2
Joined: Mon Mar 10, 2008 9:32 am
Location: The Netherlands

Problem with values greater than 100 with certain counters

Post by crimson »

I have a counter: PhysicalDisk\% Disk Read Time\_Total
This counter never returns anything greater than 100 although in perfmon it can be a lot higher. Running on Windows 2000 SP4. Log:

09:22:57:885 , counters=c:\counters.ini
09:22:57:995 , Traps=
09:22:58:057 , SnmpExtensionInit
09:22:58:198 , start
09:22:58:291 , Platform : win32
09:22:58:385 , OSVersion: osWin2k
09:22:58:416 , LOCALE_SDECIMAL: ,
09:22:58:541 , OID: 1.3.6.1.4.1.15
09:23:10:790 , SnmpExtensionQueryEx
09:23:10:977 , nRequestType=SNMP_EXTENSION_GET
09:23:11:352 , GetRequest: OID=1.3.6.1.4.1.15.4.2 (9)
09:23:11:712 , GetPerf: path=PhysicalDisk\% Disk Read Time\_Total
09:23:11:868 , GetPerf: pdh_counter_path=\PhysicalDisk(_Total)\% Disk Read Time
09:23:12:836 , GetPerf: vartype=Double
09:23:12:977 , GetRequest: value=100 asn_type=2
09:23:13:024 , GetRequest: OK
thenrique
Posts: 5
Joined: Sun Dec 20, 2009 3:04 pm

snmpget error !

Post by thenrique »

I am trying to install the snmp2 in W2K3 Enterprise, the instalation steps is done. But when i do a snmpget i got this error:

Code: Select all

cactihost:/usr/share/cacti # snmpget -c XXXX -v 2c XX.XX.XX.XX .1.3.6.1.4.1.15.1
SNMPv2-SMI::enterprises.15.1 = STRING: "null"
The file counters.ini have this content:
  • [1.3.6.1.4.1.15.1]
    counter=HP EVA DR Tunnels\Copy in KB/s
Anybody can help ?

PS. Attached to this message log.txt (debug log)
Attachments
log.txt
Debug log for snmptools.dll
(22.48 KiB) Downloaded 3152 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Somewhat related to what this package does...

Recently came across a commandline tool that Windows computers should have, which can spit out performance counters from local/remote machines. Wouldn't take much to wrap it up into a simple/expandable script for Cacti... typeperf
admwby1hy
Posts: 2
Joined: Mon Feb 01, 2010 1:40 am

help

Post by admwby1hy »

I can not download snmptools.zip in out country. who can email to me

admwby1hy@msn.com

thinks
ascendo
Posts: 21
Joined: Wed Dec 05, 2007 12:25 pm

Post by ascendo »

I've managed to get this working for perf counters, but when running scripts (vbscript), I'm getting 'U' output on the poller.

With snmpget, I'm getting this:

Reason: (badValue) The value given has the wrong type or length.
Failed object: SNMPv2-SMI::enterprises.15.1.1.1

The script runs fine from a command prompt and outputs a number.

Any ideas?
krypsys
Posts: 44
Joined: Thu Jul 06, 2006 4:30 pm

kudos

Post by krypsys »

Kudos to everyone in this thread, particularly Erwan for the app and quick response to bugs/requests.

I've been working/reading through this thread since Monday and think I have everything working. Here is my experience:

1. downloaded the app from the only link I could find (the first page of the thread)

2. the version on the website says 2.0.0.8 which confused me for awhile, since the thread went up to ver2.0.0.15. it wasn't until i read flukester's comment about reading 2.0.0.14 in the history (and, later, realized I could check the version number on the dll itself) that I realized i did, in fact, have 2.0.0.15

3. I have a difficult time building data templates (snmp indexed) - but that's probably because I am ignorant. i wish there was a clear walkthrough on 'how to build an indexed snmp xml template when you do not have a prebuilt index.' That is, I want to build 1 graph with, say, 3 different OID values and an indexed snmp xml file would be gangsta - but, I had a hella time trying to build one, so I ended up building (in this case) 3 separate SNMP data templates (individual OID values) and cross-referencing them in graphs.

4. once my graphs were built, I continually received intermittent values (output: U in the logs) back and so my graphs were missing tons of plot points. I finally read about the collect_delay reg key, but it wasn't clear that I had to (a) manually add it and (b) to add it in the snmptools key (not the currentversion key). I mean, it was implied.

5. the 'flag=norefresh' value in counters.ini seemed like another hidden gem. While I'm not sure if this or the collect_delay key did the trick, once I set both up (I did them at the same time) my graphs cleaned up significantly (see below...it should be obvious where I made the change).

Suggestions:
1. update the website to say v2.0.0.15
2. update history.txt to say 'user has to add collect_delay key in the snmptools key'

In the end, though, I just wanted to say thank you. A good example of a solid app improved by peer review and with enough threaded-conversation to have trouble-shooting without my having to post redundant questions.

(EDIT - I tried adding the images of my graphs but they didn't go...weird...I've done *png files before....so, I guess, just disregard my 'see below' comment above...which, I guess, I could just delete instead of explaining it here...doh!)
krypsys
Posts: 44
Joined: Thu Jul 06, 2006 4:30 pm

just my luck...

Post by krypsys »

well, sure enough, just after I hit submit, I started getting output:U results again...

anyone have some thoughts on basic troubleshooting these?
-the snmpwalk command works from the command line\
-all counters have 'flag=norefresh' added, with the exceptions of the '/sec' ones.
- reg key collect_delay is set to 2000 (decimal).

drats...
AlanTang
Posts: 13
Joined: Sat Oct 23, 2004 7:07 am
Location: Hong Kong

Post by AlanTang »

I am begineer, may I know after create the OID "1.3.6.1.4.1.15.1".
How can I use Cacti to make a graph?

Counters.ini
[1.3.6.1.4.1.15.1]
counter=Memory\Available Bytes

I have try to use tools to test and I can get the data from OID "1.3.6.1.4.1.15.1"

Thanks!
krypsys
Posts: 44
Joined: Thu Jul 06, 2006 4:30 pm

Post by krypsys »

hello, Alan.

the way i have created graphs is as follows:
1. verify the oid value returns data (manually using snmpwalk to poll the oid value)
2. build data template using 'Get SNMP Data' and adding the OID value next to OID in the 'custom fields' section
3. build graph template using that data template
4. add data source
5. add graph

L
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests