|
NAMEMon::SNMP - decode SNMP trap SYNOPSIS use Mon::SNMP;
$trap = new Mon::SNMP;
$trap->buffer($snmptrap);
%traphash = $trap->decode;
$error = $trap->error;
DESCRIPTIONMon::SNMP provides methods to decode SNMP trap PDUs. It is based on Graham Barr's Convert::BER module, and its purpose is to provide SNMP trap handling to "mon". METHODS
ERRORSAll methods return a hash with no elements upon errors which they detect, and the detail of the error is available from the EXAMPLES use Mon::SNMP;
$trap = new Mon::SNMP;
$trap->buffer($snmptrap);
%traphash = $trap->decode;
foreach $oid (keys $traphash{"varbindlist"}) {
$val = $traphash{"varbindlist"}{$oid};
print "oid($oid) = val($val)\n";
}
ENVIRONMENTNone. SEE ALSOGraham Barr's Convert::BER module. NOTESCAVEATSMon::SNMP depends upon Convert::BER to do the real work.
|