I’m in internship and I have to setup specific rule to monitor some ports of different switch. I have to send an alert to my mailbox in case of same eventlog messages appears 3 times in 10/15minutes.
Yes, I can get information from MySQL DB for last 15 minutes with this query :
SELECT IF ((SELECT COUNT(message) FROM devices, ports, eventlog WHERE hostname = “HOSTNAME” AND message = “ifOperStatus: down -> up” AND ports.ifName = “0/8” AND datetime >= now() - INTERVAL 15 MINUTE) >= 4, “good”, “false”);
Is it a good idea to write a script that connects to my DB and sends email with a CRON of every minute
if Query returns “good” ?
But on libreNMS web interface alert, it doesn’t accepts the request.