Ad Widget

Collapse

Calculated Item: How can I count items that match multiple conditions?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • orangeroller
    Junior Member
    • Mar 2026
    • 1

    #1

    Calculated Item: How can I count items that match multiple conditions?

    I am learning Zabbix to monitor my company's Juniper network switches.
    I have Juniper SNMP template applied to my switch as hosts, and all data is collected without issue. So far so good.

    However I am trying to get an accurate count of available and used physical switchports which turns out to be very difficult because Juniper switches come with many internal and virtual interfaces that distorts number of interfaces in a switch.
    I cannot seem to accurately filter the port types using available items.

    I want to achieve the following count using calculated items:

    - count of interface type 6 (ethernet) ==> gives me all the physical ports in the switch
    - count of interface type 6 (ethernet) AND operational status 1 (UP) ==> gives me all the physical ports that are active
    - count of interface type 6 (ethernet) AND operational status 2 (DOWN) ==> gives me all the physical ports that are available but unused

    So far I learned how to make the first one work using calculated item:

    Code:
    count(last_foreach(//net.if.type[*]), "eq",6")
    How can I write the two counts (6 AND 1, 6 AND 2) work in a calculated item?

    Thank you in advance!


Working...