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

contacts: cannot get 'host_notification_period' and 'service_notification_period' to str #54

Closed
wenxin-wang opened this issue Apr 11, 2015 · 2 comments

Comments

@wenxin-wang
Copy link

Hi all,
When I tried this:

GET contacts
Columns name host_notification_period

I got this:

admin;<object object at 0x7f2ad643c290>
check_mk;24X7
guest;<object object at 0x7f2ad643c270>

And that couldn't be jsonify:

[1428135707] ERROR: [broker-master] Unexpected error: <object object at 0x7f851cc14290> is not JSON serializable ; traceback: Traceback (most recent call last):

Here's my configs:

define contact{
    use                 generic-contact
    contact_name        guest
    email               guest@localhost
    password            whatever
    can_submit_commands 0
}

define contact{
        name                            generic-contact
        register                        0
        host_notifications_enabled      1
        service_notifications_enabled   1
        email                           shinken@localhost
        can_submit_commands             1
        notificationways                email
}

define notificationway{
       notificationway_name            email
       service_notification_period     24x7
       host_notification_period        24x7
       service_notification_options    c,w,r
       host_notification_options       d,u,r,f,s
       service_notification_commands   notify-service-by-email ; send service notifications via email
       host_notification_commands      notify-host-by-email    ; send host notifications via email
}

I found these lines in mappings.py

'host_notification_period': {
    'description': 'The time period in which the contact will be notified about host problems',
    'function': lambda item, req: item.host_notification_period.get_name(),
},

And the lambda returns the same (troublesome) object as above.

So it seems that it's not a livestatus bug, but shinken fails to get those periods right from conctact configurations. But just to make sure, I create a issue here.

By the way, currently shinken allows multiple notificationways in one contact configuration. So which one of the host_notification_periods (and other stuffs) do we get?

@ryepup
Copy link

ryepup commented Apr 27, 2015

I think #47 is the same problem

@wenxin-wang
Copy link
Author

Yes, agreed. I noticed that post right after open this issue. So I'll close this issue and point it to #47.

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

2 participants