pasta
5 October 2023 07:44
11
Already from reading this topic. I gave up using macros in LibreNMS. Having trialled alerting systems (Signl4, PagerDuty, OpsGenie). I already find it easier to define logic for activating on the “on-call” person/staff using alerting rules in an alert manager. Instead of directly in LibreNMS itself. — Messing with Macros for this is just not my thing…
Is it possible to add time period alert like nagios.
Eg: You define your timeperiod and after you can choice for every alert the timeperiod of send alert.
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
Hello good morning, I need to create a macro to be able to limit the hours in which the alerts are sent but I cannot.
Can you tell me how to make the macro appear in the new rule?
Where do I have to load the code to generate the macro?
For example, to be able to create macros_after_hour and put a code to it
$config[‘alert’][‘macros’][‘rule’][‘after_hours’] = ‘(HOUR(now()) <= 6 OR HOUR(now()) >= 18) OR WEEKDAY(now()) >= 5’;
[image]
librenms:master
← louis-6wind:alert_transport_time
opened 04:50PM - 15 May 20 UTC
Feature request https://community.librenms.org/t/time-range-for-alert-transport/… 11336
Add the following in yellow color:


DO NOT DELETE THE UNDERLYING TEXT
#### Please note
> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.
- [X] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)
- [X] If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
#### Testers
If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
After you are done testing, you can remove the changes with `./scripts/github-remove`. If there are schema changes, you can ask on discord how to revert.