mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
Notification: Use behavior Bitmask for states and types
This commit is contained in:
parent
3deb90d373
commit
2dd5d7ec3a
1 changed files with 22 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Icinga\Module\Icingadb\Model;
|
||||
|
||||
use Icinga\Module\Icingadb\Model\Behavior\Bitmask;
|
||||
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
|
||||
use ipl\Orm\Behaviors;
|
||||
use ipl\Orm\Model;
|
||||
|
|
@ -48,6 +49,27 @@ class Notification extends Model
|
|||
$behaviors->add(new ReRoute([
|
||||
'servicegroup' => 'service.servicegroup'
|
||||
]));
|
||||
$behaviors->add(new Bitmask([
|
||||
'states' => [
|
||||
'ok' => 1,
|
||||
'warning' => 2,
|
||||
'critical' => 4,
|
||||
'unknown' => 8,
|
||||
'up' => 16,
|
||||
'down' => 32
|
||||
],
|
||||
'types' => [
|
||||
'downtime_start' => 1,
|
||||
'downtime_end' => 2,
|
||||
'downtime_removed' => 4,
|
||||
'custom' => 8,
|
||||
'ack' => 16,
|
||||
'problem' => 32,
|
||||
'recovery' => 64,
|
||||
'flapping_start' => 128,
|
||||
'flapping_end' => 256
|
||||
]
|
||||
]));
|
||||
}
|
||||
|
||||
public function createRelations(Relations $relations)
|
||||
|
|
|
|||
Loading…
Reference in a new issue