Time based alerting

Output from validate.php:

Component Version
LibreNMS 22.12.0-25-gd86b9ce88 (2023-01-21T14:17:43+01:00)
DB Schema 2022_08_15_084507_add_rrd_type_to_wireless_sensors_table (248)
PHP 8.1.11
Python 3.9.2
Database MariaDB 10.5.18-MariaDB-0+deb11u1
RRDTool 1.7.2
SNMP 5.9

[OK] Composer Version: 2.5.1
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Distributed Polling setting is enabled globally
[OK] Connected to rrdcached
[OK] Active pollers found
[OK] Dispatcher Service is enabled
[OK] Locks are functional
[OK] Python wrapper cron entry is not present
[OK] Redis is functional
[OK] rrdtool version ok
[OK] Connected to rrdcached
[WARN] Your local git contains modified files, this could preve nt automatic updates.
You can fix this with ./scripts/github-remove
Modified Files:


I am trying to edit my time-based alerts. I have a macro with the following input:

$config[‘alert’][‘macros’][‘rule’][‘WEEKDAY_17to23_07to09’] = ‘(HOUR(now()) >= 7 AND HOUR(now()) <= 8) OR HOUR(now()) >= 17 AND HOUR(now()) <= 22 AND WEEKDAY(now()) <= 4’;

This macro will sent alert from 17:00 till 23:00 and from 07:00 till 09:00. How can i edit this macro to start sending alerts from 06:30 instead of 07:00?

Thanks in advance!

I think i got the right syntax:

$config[‘alert’][‘macros’][‘rule’][‘WEEKDAY_17to23_0630to09_UPATED’] = ‘(time(now()) >= “06:30:00” AND time(now()) <= “09:00:00”) OR time(now()) >= “17:00:00” AND time(now()) <= “23:00:00” AND WEEKDAY(now()) <= 4’;

Will check if the alert is being sent on monday!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.