-
Documentation task
-
Resolution: Fixed
-
Major
-
5.0.40, 6.0.25, 6.4.10, 7.0.0alpha9
-
None
-
S24-W6/7, Prev.Sprint
-
2
Steps to reproduce:
- Visit 1 System information (zabbix.com)
- See details for number of items and number of triggers
Result:
It is not completely clear (at least to me), how are those numbers calculated (what is included and what is not). I found out it by reverse engineering / trial+error:
SELECT COUNT(*) FROM items INNER JOIN hosts ON items.hostid=hosts.hostid AND hosts.status IN (0,1) LEFT OUTER JOIN item_rtdata ON items.itemid=item_rtdata.itemid -- number of items (all static + discovered) - A --WHERE items.flags IN (0,4) AND items.status IN (0,1); -- number of enabled items (supported, on enabled hosts) - E --WHERE items.flags IN (0,4) AND items.status IN (0) AND hosts.status IN (0) AND item_rtdata.state=0; -- number of disabled items (or on disabled hosts) - D --WHERE items.flags IN (0,4) AND (items.status IN (1) OR hosts.status IN (1)); -- number of not supported items (enabled on enabled hosts) - N --WHERE items.flags IN (0,4) AND items.status IN (0) AND hosts.status IN (0) AND item_rtdata.state=1; -- A = E + D + N -- similarly probably for triggers
Expected:
- explicit information that only host-level items and triggers are included (hosts.status IN (0,1), not template-level hosts.status=3) - it is logical but I wanted to be sure, it is implemented that way and it took some time, so it could be documented as well to get that information in future more easily
- how unknown state triggers are reported (related to ZBXNEXT-6607 new internal item zabbix[host,,triggers_unknown] - ZABBIX SUPPORT)