How to de-attach alert rule from an alert template?

I’m trying to de-attatch an alert rule from a alerting template, but it doesn’t de-attatch.

  1. “Alerts” -> “Alert Templates”
  2. Hit the orange List-Button of the template
  3. Three alert rules are selected, but I only want two of them
  4. I click on the first rule, that I want, thereby automatically deselecting the other two
  5. with CTRL held I click on the second rule, that I want
  6. I avoid clicking on any other rule
  7. I hit “Attach”

Now, when I click the orange List-Button again, the third rule is still selected. Also, when I look at
#select * FROM alert_template_map
I can see the mapping still exists.

Am I doing anything wrong?

In the database table I realized, that I attached the one alert rule, that I’m talking about, to two alert templates. When the alert is send out, the system uses the template with the lower id for the alert generation. The second one isn’t used at all.
In the web gui I can confirm this: the rule is marked as attached to both alert templates.

Follow-up question to my title question: should it be possible to attach a rule to more than one template?


Component Version
LibreNMS 1.43-22-gfbb6d3506
DB Schema 262
PHP 7.0.31
MySQL 10.0.35-MariaDB
RRDTool 1.4.7


[OK] Composer Version: 1.7.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[FAIL] fping6 could not be executed. fping6 must have CAP_NET_RAW capability (getcap) or suid. Selinux exlusions may be required.
(/usr/sbin/fping6: can’t create raw socket (must run as root?) : Operation not permitted)
[FAIL] fping6 should be suid!
[FIX] chmod u+s /usr/sbin/fping6
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX] You can fix this with ./scripts/github-remove
Modified Files:

Congrats! Seems like you found a bug.

Fixed in PR9173 and merged in master.

Run ./ or wait to the cron.


Nice one, thanks. The original problem is solved, now one can detach a rule from a template.

But this is IT, so there’s no “Thanks” without a “But”… :wink:

Ok, there’s still an error-prone thing in usability: it’s possible to attach one alert rule to two templates. And, if the process hasn’t changed so far, only the first will be executed -sounds to my like a p. in the a. when it comes to troubleshooting.

Now, one could argue, it’s the responsibility of the admin to make sure to have only used one template per rule. The web gui is in that particular spot not very well arranged, so one could easily miss the unwanted attachment.

Solution could be a check- and warning-pop-up “Warning, one rule attached to two different templates!” with the rule- and template-id’s. Other one could be just not letting the user do the second attachment.

1 Like

You are never happy, eh? j/k

Im a bit busy but I’ll take a look to the code to see if I can do something or if it should go to main devs.

1 Like

Thanks for the PR that fixed it for me too, couldn’t unmap alerts on 1.43 monthly release.

Also agree with @hfpbtrs a conflicting message would be excellent :sunglasses:

In my opinion, the mapping is in the wrong place. It would make a lot of sense in the rule edit window, where you select a tempate, but the rule edit window is already very busy…

1 Like

I like it good idea

@hfpbtrs @Chas

Please test #9212 and tell me if that’s enough for you guys :wink:


Will test soon! thanks

Will set up test bed, will be back soon. Thanks.

Just saw, You already merged it.

Rules, that have a template attached, are grayed out. Good.
And can’t be selected in a different template - attach - dialogue. Goood.

This looks good in the WebUI. Thank You, @TheGreatDoc and @laf.

Forgot to say that rules used are grayed out AND tells you in what template is used :slight_smile:

Aahh, now I see: behind the colon!

That’s a good one!