The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::Netdisco::Util::Snapshot

DESCRIPTION

Helper functions for SNMP::Info instances.

There are no default exports, however the :all tag will export all subroutines.

EXPORT_OK

load_cache_for_device( $device )

Tries to find a device cache in database or on disk, or build one from a net-snmp snmpwalk on disk. Returns a cache.

snmpwalk_to_cache ( %oids )

Take the snmpwalk of the device which is numeric (no MIB translateObj), resolve to MIB identifiers using netdisco-mibs data, then return as an SNMP::Info instance cache.

gather_every_mib_object( $device, $snmp, @extramibs? )

Gathers evey MIB Object in the MIBs loaded for the device and store to the database for SNMP browser.

Optionally add a list of vendors, MIBs, or SNMP:Info class for extra MIB Objects from the netdisco-mibs bundle.

The passed SNMP::Info instance has its cache update with the data.

dump_cache_to_browserdata( $device, $snmp )

Dumps any valid MIB leaf from the passed SNMP::Info instance's cache into the Netdisco database SNMP Browser table.

Ideally the leafs are fully qualified, but if not then a best effort will be made to find their correct MIB.

add_snmpinfo_aliases( $snmp_info_instance | $snmp_info_cache )

Add in any GLOBALS and FUNCS aliases from the SNMP::Info device class or else a set of defaults that allow device discovery. Returns the cache.

get_leaf_to_qleaf_map( )

get_oidmap_from_database( @mibs? )

get_oidmap_from_mibs_files( @vendors? )

Read in netdisco-mibs translation report and make an OID -> leafname map this is an older version of get_oidmap which uses disk file test on my laptop shows this version is four seconds and the database takes two.

get_mibs_for( @extra )

get_munges( $snmpinfo )