Livestatus incorrectly reporting that contact is not in host notification period
ianling opened this issue · comments
I have a contact set to use the 24x7 timeperiod for host notifications. I've tested notifications, and they do receive notifications as expected.
In Livestatus, if I run the following query:
GET contacts
Filter: in_host_notification_period = 1
No contacts appear. If I remove the filter, all my contacts appear. Livestatus is correctly reporting that the contact is using the 24x7 timeperiod, but it says that they're not in their host notification period:
# column headers
address1;address2;address3;address4;address5;address6;alias;can_submit_commands;custom_variable_names;custom_variable_values;custom_variables;email;host_notification_period;host_notifications_enabled;in_host_notification_period;in_service_notification_period;modified_attributes;modified_attributes_list;name;pager;service_notification_period;service_notifications_enabled
# what livestatus returns
none;none;none;none;none;none;none;1;;;;myemail@email.com;24x7;1;0;0;0;;myname;;24x7;1
Using newest Livestatus module from git.
Actually, checking on this again, it looks like service_notification_period and host_notification_period return blanks now. Not sure what changed, I haven't updated anything, all contacts are still using all the different timeperiods they were before, and they're working; the contacts are receiving notifications during their timeperiods...
This is interesting because notification_period returns the proper value when querying Hosts.
The contact object sets those as follows:
'host_notification_period': StringProp(fill_brok=['full_status']),
'service_notification_period': StringProp(fill_brok=['full_status']),
The host object sets it like this:
'notification_period':
StringProp(brok_transformation=to_name_if_possible, fill_brok=['full_status']),
I'm not sure how important that brok_transformation=
part is.
ALSO, this section is commented out of the contact object, but it is NOT commented out of the host object:
def linkify(self, timeperiods, commands, notificationways):
# self.linkify_with_timeperiods(timeperiods, 'service_notification_period')
# self.linkify_with_timeperiods(timeperiods, 'host_notification_period')
Oh ho ho! Uncommenting the:
def linkify(self, timeperiods, commands, notificationways):
# self.linkify_with_timeperiods(timeperiods, 'service_notification_period')
# self.linkify_with_timeperiods(timeperiods, 'host_notification_period')
fixed it! Now livestatus is showing me the contacts' notification period names, AND showing that they are in (or out of) the periods as expected!