. * * @package LibreNMS * @link http://librenms.org * @copyright 2019 KanREN, Inc. * @author */ namespace LibreNMS\Snmptrap\Handlers; use App\Models\Device; use LibreNMS\Interfaces\SnmptrapHandler; use LibreNMS\Snmptrap\Trap; use Log; class JnxPowerSupplyFailure 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) { $powerSupply = $trap->getOidData($trap->findOid('JUNIPER-MIB::jnxContentsDescr')); $state = $trap->getOidData($trap->findOid('JUNIPER-MIB::jnxOperatingState')); Log::event("Power Supply $powerSupply is $state", $device->device_id, 'trap', 5); } }