. * * @link https://www.librenms.org * * @copyright 2022 Andy Norwood * @author Andy Norwood */ namespace LibreNMS\Snmptrap\Handlers; use App\Models\Device; use LibreNMS\Interfaces\SnmptrapHandler; use LibreNMS\Snmptrap\Trap; class CiscoMacViolation implements SnmptrapHandler { /** * Handle snmptrap. * Data is pre-parsed and delivered as a Trap. * * @param Device $device * @param Trap $trap * @return void */ public function handle(Device $device, Trap $trap) { $ifName = $trap->getOidData($trap->findOid('IF-MIB::ifName')); $mac = $trap->getOidData($trap->findOid('CISCO-PORT-SECURITY-MIB::cpsIfSecureLastMacAddress')); $trap->log("SNMP Trap: Secure MAC Address Violation on port $ifName. Last MAC address: $mac", 4); } }