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

Integrate notification_period behavior #2

Closed
lazyfrosch opened this issue Oct 6, 2017 · 0 comments
Closed

Integrate notification_period behavior #2

lazyfrosch opened this issue Oct 6, 2017 · 0 comments
Milestone

Comments

@lazyfrosch
Copy link
Contributor

The old module supported handled status based on the notification_period recorded in IDO.

This used SQL query mechanics to calculate if the service are in a period based on the IDO tables (which is only the very basic info: weekday and times)

                LEFT JOIN (
                    SELECT
                      tpo.object_id,
                      tpo.name1,
                      (
                        tpr.day IS NOT NULL
                        AND tpr.start_sec <= UNIX_TIMESTAMP() - UNIX_TIMESTAMP(UTC_DATE())
                        AND tpr.end_sec >= UNIX_TIMESTAMP() - UNIX_TIMESTAMP(UTC_DATE())
                      ) AS in_period
                    FROM icinga_objects tpo
                      INNER JOIN icinga_timeperiods tp ON tp.timeperiod_object_id = tpo.object_id
                      LEFT JOIN icinga_timeperiod_timeranges tpr ON tpr.timeperiod_id = tp.timeperiod_id
                                                                     AND tpr.day = DAYOFWEEK(UTC_DATE())
                    WHERE
                      tpo.objecttype_id = 9
                      AND tpo.is_active = 1
                ) tp ON tp.object_id = s.notification_timeperiod_object_id

Warning: Currently broken in icinga2

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

No branches or pull requests

1 participant