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?
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?
[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
Congrats! Seems like you found a bug.
Fixed in PR9173 and merged in master.
Run ./daily.sh 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”…
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.
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.
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
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…
Please test #9212 and tell me if that’s enough for you guys
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
Aahh, now I see: behind the colon!
That’s a good one!