diff --git a/library/Icingadb/Model/Notification.php b/library/Icingadb/Model/Notification.php index c2bd5901..b4fa84e2 100644 --- a/library/Icingadb/Model/Notification.php +++ b/library/Icingadb/Model/Notification.php @@ -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)