SnmpTools
SnmpTools is an snmp agent servicing all windows performance counters thus allowing tools such as MRTG or Cacti to retrieve windows performance values (cpu, memory, disk, etc.). Discussion takes place here
Index
Installation
Usage
SNMP Get Next support
Value Types
Debug
Traps
Windows 64 bits support
Download
- Copy snmptools.dll to system32 (on x32) or windows (on x64)
- Register the snmp agent by using the regagent.reg file
- Create your ini file (an example is provided)
- Restart the snmp service
- Test that the agent is running by issue a snmpget command on 1.3.6.1.4.1.15 : it should return the string ‘snmptools’
Create a definition file (c:\counters.ini for example as defined by default in the reg file) where you will define your oid’s and the value that should be returned (a counter, a string, or the output of an executable).
Note: Counters have to be in english.
Example :
[1.3.6.1.4.1.15.1]
counter=LogicalDisk\Free Megabytes\_Total
[1.3.6.1.4.1.15.2]
type=string
counter=this is a test
[1.3.6.1.4.1.15.3]
type=exec
counter=cscript /nologo c:\test.vbs
SNMP Get Next support
snmpwalk -v 2c -c public 127.0.0.1 1.3.6.1.4.1.15 will walk to the first defined in the definition file (here above 1.3.6.1.4.1.15.1).
snmpwalk -v 2c -c public 127.0.0.1 1.3.6.1.4.1.15.1 will walk to the next oid (here above 1.3.6.1.4.1.15.1.2).
Note : the next oid means the next one in the definition file (snmptools will not re order them for you).
Whole numbers will be sent as snmp type=asn_integer32 (2) or type=asn_counter64 (3) (only with snmpv2 and up).
Other value types will be sent as snmp type=asn_string (4).
Float values will always use ‘.’ as separator.
Return value should not have a line return.
Debug
Put debug= »1″ (string) under [HKEY_LOCAL_MACHINE\SOFTWARE\snmptools\currentversion] to debug to c:\log.txt.
Traps
SnmpTools agent can (this is an option) send trap to trap listeners (udp port 162).
1. configure the MS SNMP service (in the traps tab, add the ip of the snmp workstations that should receive the traps).
2. add the following registry key under [HKEY_LOCAL_MACHINE\SOFTWARE\snmptools\currentversion] :
traps = « c:\traps.ini » (string)
Optionally, you may add trap_delay = 60000 (dword) if you wish to set the delay between each run to 60 secs (15 secs by default)
3. Create a traps.ini like this :
[1.3.6.1.4.1.15.10.1]
script=cscript /nologo c:\trap1.vbs
[1.3.6.1.4.1.15.10.2]
script=cscript /nologo c:\trap2.vbs
Note : then VBS can return either a string or an integer. If the returned value is empty, the agent will send a varbindlist with len=0.
Use the snmptools.dll 32 bits version on windows 64 bits platform by using regagentWow6432.reg and copy the DLL file to the syswow64 folder then, not system32.
The registry configuration key on x64 systems is [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\snmptools\currentversion] and no more [HKEY_LOCAL_MACHINE\SOFTWARE\snmptools\currentversion].
Version: 2.0.0.18
Size: 290 Kb
Download (zip) : snmptools2.zip
Download (setup) : snmptools32.exe
History: history.txt
Author: Erwan
Last Released on: Nov-2012