TNPM/dataload sym
Contents
How to use `simTool` to simulate and load a device to a Collector
Technote (FAQ)
Question
How to use `simTool` to create a 'virtual' device and load it to a collector?
Answer
We can use `simTool` to 'walk' the MIB structure of an SNMP agent on a device, redirect it to a file and then load it on to Collector for further analysis, such as troubleshooting Discovery formulae.
1) Create the file by running `simTool` against the device and redirect the output:
$ ../dataload/contribs/simTool walk {IP} 1 -c {[[Read Community]]} -V V2c -b > simtool_file.txt
the above command would 'walk' the entire MIB on the device
For a full list of command options, please check the 'help' page by typing:
$ ../dataload/contribs/simTool -?
- 2) load the file
- Place the simulation fil under $PVMHOME/tmp
Full path will be (in our example): /opt/dataload/tmp/simCiscoIPT.txt
- Naming of the file is not important. The IP address, SNMP port, and read community will be set by the format of the key, the simulation will be attached to. Changing the SNMP port, or the community is required by some use case around Discovery server, but does not serve any purpose for formula testing. This will be left to the default values (port=161, community=public). The key will then only be the IP address we want to simulate (could be different from the original IP adress the simulation was taken from)
- We'll use IP = 10.0.0.1 in that example
$ ../dataload/contribs/simTool load 10.0.0.1 /opt/dataload/tmp/simtool_file -S localhost -P 3002 file '/opt/dataload/tmp/simtool_file.txt' sucessfully loaded into key '10.0.0.1'.
Verify that the simulation is present with the 'show' command
$ ../dataload/contribs/simTool show -S localhost -P 3002 10.0.0.1 /opt/dataload/tmp/simtool_file.txt
- Note that if the SNMP collector is at debug level 6, you'll start seeing messages
1228334100 2008.12.03-19.55.00 SNMP.1.1-10782:1917 4 ELECTED_SNMPJOB About to start Big SNMPJob on agent 10.0.0.1:161 with: SIMULATED, R/W='public/private', t/r=2.00/2
in the SNMP.log.
The word SIMULATED indicates that NO SNMP traffic will take place for that task (even on IPs that are/were valid for the network), and that all data will be taken from the simulations currently loaded.
In this example, if IP 9.34.239.114 does not match a key from the 'simTool show' command, then a SNMP_TIMEOUT will be assumed, and very likely, no data will be produced by the formulas.
- 3) Test the 'virtual' device by running `snmpGet sysName.0`
$ snmpGet 10.0.0.1 sysName.0
Caveats:
Virtual devices created by `simTool` are useful for Discovery formulae testing and development, but not recommended if we want to run collections against them, as it only support 'static' OIDs, and won't work with SNMP timetick based ones, such as deltas for 'sysUpTime.0'