Alert Templates that show ID as NaN and Name as code

I went into my alert templates for the first time in a while to do the conversions. Now in between every numbered template that I created there is a line with an ID NaN and a Name with some random code.
I can’t delete them because they don’t exist in the database, if I open them all the fields are blank.

Any one know how to clean these up?

All of my templates have been converted and seem to be working normally.

Sorry I dont mean to hijack your thread but i had something similar happen to me today when I tried to make CPU template. I cant even delete mine or edit them. Whats the command you where running in the db to remove the templates?

Okay I was able to fix mine by removing the template from the db

DELETE from alert_templates WHERE id = 13 ;

They don’t exist in my alert_templates table that was the first thing I tried to do

I have the same issue where I have a “NaN” template

In the DB it doesn’t even list them
MariaDB [librenms]> select id,name,title from alert_templates order by id;
| id | name | title |
| 1 | BGP Sessions. | |
| 2 | Ports | |
| 4 | Default Alert Template | |
| 5 | Default-HTML-Alert | |
| 6 | CRIT-WARN - Datacenter Temp | CRIT-WARN - DC Temp Alert: %sensors.sensor_current |
| 8 | WARN - Low Toner | WARNING - LOW TONER: %hostname |
| 9 | CRIT-WARN - Disk Space Low | DISK LOW {{$alert->hostname}} |
| 10 | WARN - ZERO Toner - Canon | WARNING - ZERO TONER: {{$alert->hostname}} |
8 rows in set (0.00 sec)

but as I am building this out I noticed that I am using {{$alert->hostname}} for the alert title twice and it may be miss-parsed into a phantom template


I can’t find the table it is in to clean it up though (yet). It also may be a quoting issue of the alert_templates->title field. Some testing to do… will post again if I find anything.

So I looked at my templates today and they are all back to normal. Must have been fixed in an update.

1 Like

Yes update was sent to master.