Use notification_reason for new notification types

This commit is contained in:
Eric Lippmann 2019-07-15 16:34:48 +02:00 committed by Johannes Meyer
parent 9d0ef4cf33
commit 1d1fd0b3b2
2 changed files with 22 additions and 2 deletions

View File

@ -38,7 +38,17 @@ class HostnotificationQuery extends IdoQuery
'output' => null,
'state' => 'hn.state',
'timestamp' => 'UNIX_TIMESTAMP(hn.start_time)',
'type' => '(\'notify\')'
'type' => '
CASE hn.notification_reason
WHEN 1 THEN \'notification_ack\'
WHEN 2 THEN \'notification_flapping\'
WHEN 3 THEN \'notification_flapping_end\'
WHEN 5 THEN \'notification_dt_start\'
WHEN 6 THEN \'notification_dt_end\'
WHEN 7 THEN \'notification_dt_end\'
WHEN 8 THEN \'notification_custom\'
ELSE \'notification_state\'
END',
),
'instances' => array(
'instance_name' => 'i.instance_name'

View File

@ -30,7 +30,17 @@ class ServicenotificationQuery extends IdoQuery
'output' => null,
'state' => 'sn.state',
'timestamp' => 'UNIX_TIMESTAMP(sn.start_time)',
'type' => '(\'notify\')'
'type' => '
CASE sn.notification_reason
WHEN 1 THEN \'notification_ack\'
WHEN 2 THEN \'notification_flapping\'
WHEN 3 THEN \'notification_flapping_end\'
WHEN 5 THEN \'notification_dt_start\'
WHEN 6 THEN \'notification_dt_end\'
WHEN 7 THEN \'notification_dt_end\'
WHEN 8 THEN \'notification_custom\'
ELSE \'notification_state\'
END',
),
'hostgroups' => array(
'hostgroup_name' => 'hgo.name1',