NAME

App::Netdisco::Transport::SNMP

DESCRIPTION

Singleton for SNMP connections. Returns cached SNMP::Info instance for a given device IP, or else undef. All methods are class methods, for example:

App::Netdisco::Transport::SNMP->reader_for( ... );

reader_for( $ip, $useclass? )

Given an IP address, returns an SNMP::Info instance configured for and connected to that device. The IP can be any on the device, and the management interface will be connected to.

If the device is known to Netdisco and there is a cached SNMP community string, that community will be tried first, and then other community strings from the application configuration will be tried.

If $useclass is provided, it will be used as the SNMP::Info device class instead of the class in the Netdisco database.

Returns undef if the connection fails.

test_connection( $ip )

Similar to reader_for but will use the literal IP address passed, and does not support specifying the device class. The purpose is to test the SNMP connectivity to the device before a renumber.

Attempts to have no side effect, however there will be a stored SNMP authentication hint (tag) in the database if the connection is successful.

Returns undef if the connection fails.

writer_for( $ip, $useclass? )

Same as reader_for but uses the read-write community strings from the application configuration file.

Returns undef if the connection fails.