Ad Widget

Collapse

Turn traffic monitor item into template for all interfaces

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jdm2110
    Junior Member
    • Nov 2021
    • 12

    #1

    Turn traffic monitor item into template for all interfaces

    Hello!

    I am trying to monitor the total outgoing traffic from an AWS server over various time ranges using Zabbix. I have figured out how to do this with a manually created item, but want to implement this as a template so I can monitor all interfaces for each server added to Zabbix through my ansible deployment process. I have been digging through the documentation for hours and haven't quite figured out how to do this.

    To set it up for a single interface manually, I am using a calculated item and hard-coding the name of the interface in the following formula:

    Code:
    (max(//net.if.out["ens5"],1h)-min(//net.if.out["ens5"],1h))/1024
    In order for this to be fully templated for use with ansible, I suspect I will need to set this up in the item prototype section under the discovery rules. This is one example of something that I have tried:

    Code:
    (max(//net.if.out["{#IFNAME}"],1h)-min(//net.if.out["{#IFNAME}"],1h))/1024
    However, I am receiving the following error when using the test feature:

    Cannot evaluate function: item "/Linux server/net.if.out["{#IFNAME}"]" does not exist at "max(//net.if.out["{#IFNAME}"],1h)-min(//net.if.out["{#IFNAME}"],1h))/1024".
    If I ignore the error and save anyway, the item does not show up on any of the hosts where the template is applied.

    Using Zabbix 5.4.

    I'd really appreciate any help, thanks!
  • niveastn
    Member
    • Oct 2021
    • 82

    #2
    Hey there!

    What this error mean: you are trying to use a calculated item (max net.if.out - min net.if.out) and net.if.out does not exist. Have a look at you item prototypes, if this item is really there, and if it is, if you have any errors in your discovery rule (go to the discovery rules list and see if there is any red "i")
    here is an example of this item prototype in the official linux template:
    Linux network interfaces by Zabbix agent: Interface {#IFNAME}: Bits sent net.if.out["{#IFNAME}"]
    Discovery rule: net.if.discovery

    Comment

    • jdm2110
      Junior Member
      • Nov 2021
      • 12

      #3
      Originally posted by niveastn
      Hey there!

      What this error mean: you are trying to use a calculated item (max net.if.out - min net.if.out) and net.if.out does not exist. Have a look at you item prototypes, if this item is really there, and if it is, if you have any errors in your discovery rule (go to the discovery rules list and see if there is any red "i")
      here is an example of this item prototype in the official linux template:
      Linux network interfaces by Zabbix agent: Interface {#IFNAME}: Bits sent net.if.out["{#IFNAME}"]
      Discovery rule: net.if.discovery
      Thanks for taking the time to check this out!

      I believe the item does exist unless I am not understanding the scope correctly (which, admittedly, is entirely possible). I have attached some screenshots to hopefully shed some light on where my understanding is faltering. I am also attaching a screenshot of one of the trigger prototypes showing how they access net.if.in. I have tried specifying the following but get similar errors:
      Code:
      /Template Module Linux network interfaces by Zabbix agent/net.if.out["{#IFNAME}"]
      If I could just access it the same way that this trigger is doing, that would be great!
      Attached Files

      Comment

      Working...