Endless alerts problem - ghost (deleted) devices

Hi,

Raspberry Pi (used to host LibreNMS) was occasianlly powered off and now I have endless alerts (Device down, no ICMP response) from ghost devices (on Telegram), which seem to be related to DB inconsistency or frozen cache data. 2 devices are deleted some time ago, and 1 still present in the list but alerting is set to off.

Manually upgraded to latest version with dayly.sh, rebooted Raspberry Pi, no changes.
Setting → Validate config → Database is OK.
Changed Settings → Alerting → Interval (minutes) to 360.

Yet I’m still getting alerts about these 3 devices.

How to fix this? May be manually purge some data from mysql DB?
Thanks in advance for any help.

You can clear all alerts out (genuine ones will just re-alert) by doing truncate alerts;

MariaDB [librenms]> TRUNCATE alerts;
Query OK, 0 rows affected (0.091 sec)

Did it, unfortunately still getting these alerts.

Then it’s not LibreNMS sending them anymore. You might have a back log in your mail server, check your setup to see what that might be and if the mail queue needs emptying.

I did:

MariaDB [librenms]> select * from alerts;
+-----+-----------+---------+-------+---------+------+------+---------------------+------+
| id  | device_id | rule_id | state | alerted | open | note | timestamp           | info |
+-----+-----------+---------+-------+---------+------+------+---------------------+------+
| 263 |         7 |       1 |     0 |       0 |    0 | NULL | 2024-12-30 10:40:35 |      |
| 264 |         7 |       2 |     0 |       0 |    0 | NULL | 2024-12-30 10:40:35 |      |
..........
+-----+-----------+---------+-------+---------+------+------+---------------------+------+
262 rows in set (0.015 sec)

then:

MariaDB [librenms]> delete from alerts;
Query OK, 262 rows affected (0.029 sec)

Unfortunately, after some time all these 262 alerts appear again in the DB, and ghost devices started to spam again. I suspect, may be there are another tables (e.g. alert_schedulables or alert_schedule)with fossil remnants of ghost (deleted) devices?

That table populates for all devices and all alert rules, it will log both active and inactive alerts.

You probably need to work out what device and alert rule is still being triggered and check the alerts table to see if you can match it up.