sub Read_DOCSIS_SNMP { my %DOCSISResults = (); my ($OIDName, $MACTableResult) = ""; my ($Session, $Error ) = Net::SNMP->session( -hostname => $IPAddress, -community => $ReadCommunityString, -retries => 3, -timeout => 5, -mtu => 1544, -nonblocking => 0x1 ); if (!defined($Session) ) { &ErrorOut("Error starting SNMP Session [DEBUG 1]: $Error"); } $Session->get_request( -callback => [\&DOCSIS_Callback, \%DOCSISResults], -varbindlist => [$SystemDescription, $SystemUptime, $MACAddress, $BootFile, $NumberOfInterfaces, $DSFrequency, $DSPowerLevel, $DSModulationType, $DSSNR, $USFrequency, $USPowerLevel, $USChannelWidth, $USChannelID, $UnerroredCodewords, $CorrectedCodewords, $UncorrectableCodewords, $Microreflections, $InterfaceResets, $LostSyncs, $InvalidMaps, $InvalidUCDs, $T1Timeouts, $T2Timeouts, $T3Timeouts, $T4Timeouts, $InvalidRangeRsp, $InvalidRegRsp, $SerialNumber, $SystemName, $SystemLocation] ); foreach $OIDName (keys %MACTableOIDs) { $MACTableResult = $Session->get_table( -callback => [ \&MACTable_Callback, $MACTableOIDs{$OIDName}, $OIDName, \%MACTableResults, ], -baseoid => $MACTableOIDs{$OIDName}, ); } if (!$MACTableResult) { &ErrorOut("SNMP Error while performing MAC table Callback routine: $Error"); } snmp_dispatcher(); $Session->close(); if (!defined($ModemResults{DSPowerLevel})) { &ErrorOut("Unable to communicate with device, or it's not a cable modem."); } }