Alerts inside recurring scheduled maintenance for device group

timezone it’s definitely out of the question.
I’ve added +2h on the maintenance interval

but the alerts were still sent

I am sure devices are part of the group mapped to this maintenance, timezone correct, no errors in librenms.
Any other ideas?

Was this alert recurring and never be removed from the alert list? I’m using the Maintenance Window every night without difficulty during our backup sessions and I use group too.

1 Like

Are your devices part of multiple groups? make no sense … I can see it checks for multiple groups
SQL[SELECT alert_schedule.schedule_id FROM alert_schedule LEFT JOIN alert_schedule_items ON
alert_schedule.schedule_id=alert_schedule_items.schedule_id WHERE ( alert_schedule_items.target = ‘6’ ||
alert_schedule_items.target = ‘g6’ || alert_schedule_items.target = ‘g15’ ) && ((alert_schedule.recurring = 0 AND (NOW()

Can you try with only one group in the alert rule? Not sure that the OR statement is working fine here.

Only one group in the maintenance, devices are part of multiple groups

The above SQL query seems using 3 groups? :thinking:

yes because device is part of group 6 and group 15 …
Debug on device poller

So it’s probably the problem, my devices are only in one group. Can you try with a device configured only in one group please?

It’s not that either… it’s matching fine when I schedule a non recurring maintenance.

SELECT alert_schedule.schedule_id FROM alert_schedule LEFT JOIN alert_schedule_items ON alert_schedule.schedule_id=alert_schedule_items.schedule_id WHERE ( alert_schedule_items.target = '441' ) && ((alert_schedule.recurring = 0 AND (NOW() BETWEEN alert_schedule.start AND alert_schedule.end)) OR (alert_schedule.recurring = 1 AND (alert_schedule.start_recurring_dt <= date_format(NOW(), '--%d') AND (end_recurring_dt >= date_format(NOW(), '--%d') OR end_recurring_dt is NULL OR end_recurring_dt = '0000-00-00' OR end_recurring_dt = '')) AND (date_format(now(), '%H:%i:%s') BETWEEN `start_recurring_hr` AND end_recurring_hr) AND (recurring_day LIKE CONCAT('%',date_format(now(), ''),'%') OR recurring_day is null or recurring_day = ''))) LIMIT 1;

+-------------+
| schedule_id |
+-------------+
| 10 |
+-------------+
1 row in set, 1 warning (0.00 sec)

But doesn’t match when I set the following:


or

Same sql query
Empty set, 1 warning (0.00 sec)


This seems to work :slight_smile:

Can you explain?:sweat_smile:

No :slight_smile: if the maintenance starts 15:30 and ends 06:00 it doesn’t work.
But if it starts 15:30 and ends 23:59 it works same as 00:00 to 06:00

1 Like

maybe its issue with since its starting on one day 15:30 then going into the next day at 06:00 ?
@FTBZ bug perhaps??

Maybe this?
(date_format(now(), ‘%H:%i:%s’) BETWEEN start_recurring_hr AND end_recurring_hr) AND (recurring_day LIKE CONCAT(’%’,date_format(now(), ‘’),’%’)

1 Like

Probably a bug or a missed feature. I think when it was done, we did not think it could be over several days.