Notification: Use behavior Bitmask for states and types

This commit is contained in:
Johannes Meyer 2019-11-26 09:58:02 +01:00
parent 3deb90d373
commit 2dd5d7ec3a

View file

@ -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)