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

FusionInventory::Agent::SNMP - An SNMP query extension

DESCRIPTION

This is the object used by the agent to perform SNMP queries.

METHODS

new(%params)

The constructor. The following parameters are allowed, as keys of the %params hash:

version (mandatory)

Can be one of:

'1'
'2c'
'3'
hostname (mandatory)
community
username
authpassword
authprotocol
privpassword
privprotocol

get($oid)

This method returns a single value, corresponding to a single OID. The value is normalised to remove any control character, and hexadecimal mac addresses are translated into plain ascii.

walk($oid)

This method returns an hashref of values, indexed by their OIDs, starting from the given one. The values are normalised to remove any control character, and hexadecimal mac addresses are translated into plain ascii.

getSerialNumber($oid)

Wraps get($oid), assuming the value is a serial number and sanitizing it accordingly.

getMacAddress($oid)

Wraps get($oid), assuming the value is a mac address and sanitizing it accordingly.

walkMacAddresses($oid)

Wraps walk($oid), assuming the values are mac addresses and sanitizing them accordingly.

FUNCTIONS

getSanitizedSerialNumber($value)

Return a sanitized serial number.

getSanitizedMacAddress($value)

Return a sanitized mac address.

getElement($oid, $index)

return the $index element of an oid.

getLastElement($oid)

return the last element of an oid.

getNextToLastElement($oid)

return the next to last element of an oid.