I think time range would be better for alert transport instead of alert template.
In this way the alerts could be continously but could not to disturb users outside the their working hours
My suggestion:
Create a macro that match your working hours, then set 2 alerts.
One with the macro to true with a transport associated and another one without transport.
Check this: Timeperiod in alert
Hi,
I tried your suggestion already, but at the end of working hours I get a fake recovery message. Next morning I get service down message again.
please paste your alert rule. thanks
Whatâs wrong here?
could you post your business hours macro definition also, please?
$config[âalertâ][âmacrosâ][âruleâ][âbusiness_hoursâ] = â(HOUR(now()) >= 8 AND HOUR(now()) <= 16) AND WEEKDAY(now()) <= 4â;
Alert Rule (Screenshot) looks good.
For my intention i would concentrate myself to business_day macro
have you tried:
((HOUR(now()) >= 8 AND HOUR(now()) <= 16) AND WEEKDAY(now()) <= 4)
instead of
(HOUR(now()) >= 8 AND HOUR(now()) <= 16) AND WEEKDAY(now()) <= 4
?
Macro for my intention also looks fine, nethertheless i think macro would be the problem.
Have you tried to reduce itâs complexity for debugging and test it?
I donât think that I have problem with the macro. My problem is that I get fake recovery notification at 17:00, and I get device down notification at 8:00
The recovery notifaction is fake because the device is still DOWN but it is outside working hours⌠How can I avoid to ACK the alert every morning? Is the only option for that the âscheduled maintenanceâ?
change max Alerts to 1
-1 means âdo every check intervalâ
on changing it to 1 youâll be informed only once
Then Iâll be informed only once every day at 8:00 and I will get recovery message at 17:00
nope,
for the port which was going down the alert only will be sent once if max alert is set to 1.
If it goes up âŚ
OH YEAH !!!
the cause is the business_day macro ⌠so it matches, then it doesnât match, then it matches again âŚ
itâs like port is down macro against a flapping port, it matches, it matches not, then it matches again âŚ
so itâs every neáş start of a matching business_day a new alert, even if the ports stays down over days
i think your wish âi want to be informed only in business hoursâ is a little more complicated and cannot be solved via macros as i see at moment
mmh alerting only in specified time windows has to be a written and included as Feature Request
As you can see we are talking in a Feature request ticket
I would recommend to be configurable per alert transport
Donât know who has time/is motivated to implement this feature.
If youâd like to implement this it would be very appreciated
Unfortunately Iâm not a developer.
Work in progress https://github.com/librenms/librenms/pull/11622
@1soproni, please test the feature!
To apply new feature patch
./scripts/github-apply 11622
php artisan migrate
To revert:
php artisan migrate:rollback --step=4
./scripts/github-remove -d
Hi,
thx for the patch and for your effort.
I tried to set it, but I cannot set greater âstart hourâ (and minutes (should be renamed to start time)) than the actual time(neither with the arrows, nor with the selector)
The âend hourâ (end time) cannot be set to lower than the actual time.
E.g.: The time is 7:00 now. I cannot set the start hour to 8:00
Hmmm, okay I leave the text above here because that was the status. But I tried to set lower start time than the actual, went lower than midnight and finally I could set it to any time. After that works well the start and also the time settings.
I think the âOnly on weekday:â text is also pointless. (But English is not my native language) You should change it e.g. to âOnly on theese day(s)â or âOnly on weekdayâ should be a button which marks the weekdays (Mo-Fr) but it depends on country⌠BTW: clicking on the text of âOnly on weekdayâ ticks Monday
Iâm trying to save the transport. Ticked âAll devices except in listâ and did not select any device from the list. In this scenario should not it include all the devices?