I’m trying to de-attatch an alert rule from a alerting template, but it doesn’t de-attatch.
“Alerts” -> “Alert Templates”
Hit the orange List-Button of the template
Three alert rules are selected, but I only want two of them
I click on the first rule, that I want, thereby automatically deselecting the other two
with CTRL held I click on the second rule, that I want
I avoid clicking on any other rule
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?
EDIT:
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?
./validate.php
Component
Version
LibreNMS
1.43-22-gfbb6d3506
DB Schema
262
PHP
7.0.31
MySQL
10.0.35-MariaDB
RRDTool
1.4.7
SNMP
NET-SNMP 5.7.3
====================================
[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:
rrd/.gitignore
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”…
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.
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…