. * * @package LibreNMS * @link http://librenms.org * @copyright 2018 KanREN, Inc. * @author Neil Kahle */ namespace LibreNMS\Snmptrap\Handlers; use App\Models\Device; use LibreNMS\Interfaces\SnmptrapHandler; use LibreNMS\Snmptrap\Trap; use LibreNMS\Snmptrap\Handlers\JnxDomAlarmId; use Log; class JnxDomAlarmSet 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) { $currentAlarm = $trap->getOidData($trap->findOid('JUNIPER-DOM-MIB::jnxDomCurrentAlarms')); $ifDescr = $trap->getOidData($trap->findOid('IF-MIB::ifDescr')); $alarmList = JnxDomAlarmId::getAlarms($currentAlarm); Log::event("DOM alarm set for interface $ifDescr. Current alarm(s): $alarmList", $device->device_id, 'trap', 5); } }