Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Livestatus incorrectly reporting that contact is not in host notification period #74

Closed
ianling opened this issue Sep 26, 2016 · 2 comments

Comments

@ianling
Copy link

ianling commented Sep 26, 2016

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;;;;[email protected];24x7;1;0;0;0;;myname;;24x7;1

Using newest Livestatus module from git.

@ianling
Copy link
Author

ianling commented Dec 7, 2016

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

@ianling
Copy link
Author

ianling commented Dec 7, 2016

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant