mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Enumerate AlertState (#11665)
* Enumerate AlertState * fix typo * add missing use's * . * .
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
namespace LibreNMS\Alert\Transport;
|
||||
|
||||
use LibreNMS\Enum\AlertState;
|
||||
use LibreNMS\Alert\Transport;
|
||||
|
||||
class Victorops extends Transport
|
||||
@@ -47,11 +48,11 @@ class Victorops extends Transport
|
||||
'state_message' => $obj['msg'],
|
||||
'monitoring_tool' => 'librenms',
|
||||
);
|
||||
if ($obj['state'] == 0) {
|
||||
if ($obj['state'] == AlertState::RECOVERED) {
|
||||
$protocol['message_type'] = 'recovery';
|
||||
} elseif ($obj['state'] == 2) {
|
||||
} elseif ($obj['state'] == AlertState::ACKNOWLEDGED) {
|
||||
$protocol['message_type'] = 'acknowledgement';
|
||||
} elseif ($obj['state'] == 1) {
|
||||
} elseif ($obj['state'] == AlertState::ACTIVE) {
|
||||
$protocol['message_type'] = 'critical';
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user