[ZBXNEXT-7927] count_foreach function needs operators like "greater than" Created: 2022 Aug 18 Updated: 2024 Mar 08 Resolved: 2023 May 15 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature Request | Priority: | Trivial |
Reporter: | Mehmet Ali Buyukkarakas | Assignee: | Unassigned |
Resolution: | Duplicate | Votes: | 4 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
||||||||
Epic Link: | Zabbix 7.0 |
Description |
I need to create a calculated item, which will calculate the NUMBER of interfaces with status DOWN. Basically I need a foreach function with operators, to filter some values matching a condition like "greater" or "less than" I made some researches. There is a trigger function count which gives us the chance of using operators like "less than", "greater than". https://www.zabbix.com/documentation...ctions/history But the problem is, there is no way to calculate "number of up interfaces" in a trigger and create the alert. According the documentation, it is not possible to write something like this ; count(last_foreach(//net.if.status,1h,"lt",2)) |
Comments |
Comment by Alex Kalimulin [ 2023 Feb 22 ] |
last_foreach() should return last, retaining the same behavior as for historic last() (so last_foreach(//net.if.status,1h,"lt",2) would be kind of confusing). But something like count(last_foreach(/*/net.if.status?[group="Linux servers"]),"eq",2) would be helpful (e.g. count number of interfaces with last down status). Also, count(count_foreach(/*/net.if.status?[group="Linux servers"],1h,"eq",2),"gt",0) could be used to count interfaces that were down within the last hour. |
Comment by Dmitrijs Goloscapovs [ 2023 May 15 ] |
This functionality was implemented in context of |