July 2010
Intermediate to advanced
588 pages
13h 25m
English
Now that we have performed SNMP queries using TkIned, we can move on to using Scotty from Tcl directly to communicate over SNMP.
The Tnm package offers a large number of features. Main part of its functionality is related to SNMP and MIB.
A quick example to query SNMPv2-MIB::sysContact value over SNMP can be as follows:
set session [Tnm::snmp generator] $session configure -address "192.168.2.2" \ -version "SNMPv1" -community "private" puts [$session get SNMPv2-MIB::sysContact.0]
This will create a connection handle, configure it to query the IP 192.168.2.2 over SNMPv1 protocol and get sysContact value. This will print out something like the following:
{1.3.6.1.2.1.1.4.0 {OCTET STRING} root@router} ...Read now
Unlock full access