2021-09-19 15:21:31 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace LibreNMS\Snmptrap\Handlers;
|
|
|
|
|
|
|
|
use App\Models\Device;
|
|
|
|
use LibreNMS\Interfaces\SnmptrapHandler;
|
|
|
|
use LibreNMS\Snmptrap\Trap;
|
|
|
|
|
2023-08-05 12:12:36 -05:00
|
|
|
class VeeamBackupJobCompleted extends VeeamTrap implements SnmptrapHandler
|
2021-09-19 15:21:31 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* 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)
|
|
|
|
{
|
|
|
|
$name = $trap->getOidData('VEEAM-MIB::backupJobName');
|
|
|
|
$comment = $trap->getOidData('VEEAM-MIB::backupJobComment');
|
2021-11-24 18:20:56 +01:00
|
|
|
$result = $trap->getOidData('VEEAM-MIB::backupJobResult');
|
2023-08-05 12:12:36 -05:00
|
|
|
$severity = $this->getResultSeverity($result);
|
2021-09-19 15:21:31 +02:00
|
|
|
|
2023-08-05 12:12:36 -05:00
|
|
|
$trap->log('SNMP Trap: Backup Job ' . $result . ' - ' . $name . ' - ' . $comment, $severity, 'backup');
|
2021-09-19 15:21:31 +02:00
|
|
|
}
|
|
|
|
}
|