I’d love a macro for checking if a device is covered by a scheduled maintenance. Or even better, checkboxes for ‘enable alert even if host is down’ and ‘enable alert even if host is under scheduled maintenance’. Implying that alerts should default to not be enabled if host is down or under scheduled maintenance. This is a matter of opinion of course.
In any case:
If a device goes down and an alert is triggered, and a scheduled maintenance is set for the device in question after the alert goes active, the alert will remain in the alert list.
Clearing all active alerts can be done via mysql like this:
MariaDB [librenms]> update alerts set state = 0 where state = 2;
Clearing individual alerts is left as an exercise for the reader.
… may be of some guidance on your journey to thrash your first SQL database.