[solved] SNMP Troubles

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
AndyChaos
Posts: 2
Joined: Thu Jul 04, 2013 12:58 am

[solved] SNMP Troubles

Post by AndyChaos »

Hi, I am trying to get specific application snap counters out of windows using snap tools.

My server OS is Windows 2008 R2 x64 bit

I can see snap packets hitting the server and returning (the returned values are null - in wireshark.

The community strings are not OS default, I have checked are are correct.

I seem to be able get OS SNMP ok, just not my custom ones through snap tools.

using SnmpUtilG I can get the value (a.b.c.d) the the IP address

a.b.c.d, .1.3.6.1.2.1.25.2.3.1.6.2, 377426, INTEGER, host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.2

I used to use perfmib.dll under windows 2000 32bit ok

counters.ini
-----------------

;this file is optional
;you can define here the hardcoded oid for specific ms counters

[1.3.6.1.4.1.15.1]
type=string
counter=this is a test

[1.3.6.1.4.1.15.2]
type=exec
counter=cmd /c ver

;The entry under permib.dll was just 25.1 below is a guess
[1.3.6.1.4.1.15.25.1]
counter=My App counter 2

;The entry under permib.dll was just 25.1 below is a guess
[1.3.6.1.4.1.15.25.1.0]
counter=My App counter 3

;The offical OID for application
[1.3.6.1.4.1.311.1.1.3.1.1.26.1.0]
Counter=My App Counter 1

;you need a pseudo end of file so that snmp_get_next does not end with a no_such_name error on last oid
[1.3.6.1.4.1.15.9999]
type=string
counter=EOF

----------------------------------------------

Log File after start

----------------------------------------------

06:28:07:136 , DLL_PROCESS_DETACH
06:28:07:136 , clean
06:28:07:807 , counters=c:\counters.ini
06:28:07:807 , Traps=
06:28:07:807 , SnmpExtensionInit
06:28:07:807 , start
06:28:07:807 , Platform : win32
06:28:07:807 , OSVersion: osWin7
06:28:07:807 , LOCALE_SDECIMAL: .
06:28:07:807 , OID: 1.3.6.1.4.1.15

--------------------------------------------

Log file after several SNMP gets in counter.ini order

--------------------------------------------

06:28:07:136 , DLL_PROCESS_DETACH
06:28:07:136 , clean
06:28:07:807 , counters=c:\counters.ini
06:28:07:807 , Traps=
06:28:07:807 , SnmpExtensionInit
06:28:07:807 , start
06:28:07:807 , Platform : win32
06:28:07:807 , OSVersion: osWin7
06:28:07:807 , LOCALE_SDECIMAL: .
06:28:07:807 , OID: 1.3.6.1.4.1.15
06:29:56:114 , SnmpExtensionQueryEx, len:1
06:29:56:114 , nRequestType=SNMP_EXTENSION_GET
06:29:56:114 , GetRequest: OID=1.3.6.1.4.1.15.1 (8)
06:29:56:114 , GetRequest: value=this is a test asn_type=4
06:29:56:114 , GetRequest: OK
06:31:01:445 , SnmpExtensionQueryEx, len:1
06:31:01:445 , nRequestType=SNMP_EXTENSION_GET
06:31:01:445 , GetRequest: OID=1.3.6.1.4.1.15.2 (8)
06:31:01:445 , GetPerf: executing cmd /c ver
06:31:01:617 , GetRequest: value=Microsoft Windows [Version 6.1.7601] asn_type=4
06:31:01:617 , GetRequest: OK
06:31:23:394 , SnmpExtensionQueryEx, len:1
06:31:23:394 , nRequestType=SNMP_EXTENSION_GET
06:31:23:394 , GetRequest: OID=1.3.6.1.4.1.15.25.1 (9)
06:31:23:394 , GetPerf: path=My App counter 2
06:31:24:142 , English2Local: no match
06:31:24:142 , GetPerf: pdh_counter_path=My App counter 2
06:31:24:158 , PdhAddCounter: ret=C0000BC0
06:31:24:158 , GetPerf: vartype=Null
06:31:24:158 , length(str_result)=0
06:31:24:158 , GetRequest Failed
06:31:50:817 , SnmpExtensionQueryEx, len:1
06:31:50:817 , nRequestType=SNMP_EXTENSION_GET
06:31:50:817 , GetRequest: OID=1.3.6.1.4.1.15.25.1.0 (10)
06:31:50:833 , GetPerf: path=My App counter 3
06:31:51:301 , English2Local: no match
06:31:51:301 , GetPerf: pdh_counter_path=My App counter 3
06:31:51:301 , PdhAddCounter: ret=C0000BC0
06:31:51:301 , GetPerf: vartype=Null
06:31:51:301 , length(str_result)=0
06:31:51:301 , GetRequest Failed
06:32:05:621 , SnmpExtensionQueryEx, len:1
06:32:05:621 , nRequestType=SNMP_EXTENSION_GET
06:32:05:621 , GetRequest: OID=1.3.6.1.4.1.15.25.1.0 (10)
06:32:05:621 , GetPerf: path=My App counter 3
06:32:06:105 , English2Local: no match
06:32:06:105 , GetPerf: pdh_counter_path=My App counter 3
06:32:06:105 , PdhAddCounter: ret=C0000BC0
06:32:06:105 , GetPerf: vartype=Null
06:32:06:105 , length(str_result)=0
06:32:06:105 , GetRequest Failed


-----------------------------------------

Help would be greatly appreciated.
AndyChaos
Posts: 2
Joined: Thu Jul 04, 2013 12:58 am

Re: SNMP Troubles

Post by AndyChaos »

Fixed it :) I think
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest