Google

SNMP::Session

SNMP::Session provides methods communicating with SNMP agents.

Super Class:

Object

Class Methods:

open(host_name, community)
Create a SNMP instance. 'hostname' is a name of agent's host. 'community' is SNMPv1 community string.

Methods:

close()
Close and free an SNMPSession instance.
get([obj_name_1, obj_name_2, .., obj_name_n])
Request SNMP GET message for SNMP objects obj_name_1, .., obj_name_n. The argument must be represnted as an array of strings. It returns an array of SNMPVAR instances.
getnext([obj_name_1, obj_name_2, .., obj_name_n])
Request SNMP GETNEXT message for SNMP objects obj_name_1, .., obj_name_n. The argument must be represented as an array of strings. It returns an array of SNMPVAR instances.
walk([obj_name_1, .. ,obj_name_n]) ruby_block
Do SNMP walk. It evaluates a ruby_block with an array of SNMPVAR instances. It terminates when a return value of the SNMP getnext reuest is outside of a given object's OID.
community!(new_community)
Change community string defined by open method.
timeout!(timeout_sec)
Change default timeout setting (sec). Default timeout is 5 sec.
retries!(number_of_retry)
Change default retries setting. Default retries number is 2.

Nobuhiko Tsuruoka
Last modified: Thu Jul 6 18:30:01 JST 2000