-
Type:
Incident report
-
Resolution: Won't fix
-
Priority:
Trivial
-
None
-
Affects Version/s: None
-
Component/s: Frontend (F)
-
Environment:Zabbix Server 1.8.12
I have the following trigger in a template, that has already a host referenced:
Name: {HOSTNAME}: {ITEM.VALUE2} >50%
Expression: {Template_App_Allnet_ALL4000V2:allnet-sensor0-virtual0-value.last(0)}>50 & {sensors12:allnet-sensor0-virtual0-name.str(DISABLED)}=0
When I clone this item, replace the expression part "sensor0" by "sensor1" and click save, the following DB-Entry was created:
mysql> select * from triggers order by triggerid desc limit 1\G
*************************** 1. row ***************************
triggerid: 52234
expression: {121494}>50 & {121495}=0
description: {HOSTNAME}: {ITEM.VALUE2} >50%
url:
status: 0
value: 2
priority: 4
lastchange: 0
dep_level: 0
comments:
error: Trigger just added. No status update so far.
templateid: 52234
type: 0
As the templateid is the same as the triggerid the gui hangs while saving the entry. It didnt even save the trigger for the referenced host. An strace shows that the following queries are executed in a loop:
SELECT t.triggerid, t.templateid FROM triggers t WHERE ((t.triggerid BETWEEN 000000000000000 AND 099999999999999)) AND (t.triggerid IN (52233)) SELECT DISTINCT h.hostid, h.host, h.status,f.triggerid FROM hosts h,functions f,items i WHERE (f.triggerid IN (52233)) AND h.hostid=i.hostid AND f.itemid=i.itemid AND ((f.triggerid BETWEEN 000000000000000 AND 099999999999999)) AND h.status IN (0,1,3)
I have to delete this trigger+functions manually, because the gui is not working any more.
I think it would be a good idea, the implement a gui sanity-check assert(triggerid!=templateid) to prevent a loop.