Ad Widget

Collapse

variable in key for trigger. how??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mixmox
    Member
    • Apr 2020
    • 54

    #1

    variable in key for trigger. how??

    Hello
    i have such this key to monitor traffic


    net.if.in[ens162,bytes]

    is it possible to mace this part : ens162 az variable and enter this for each host ?
    each host has its own value that must replace instead of ens162 (like etho1 .... )

    after that how can i fill variable ?
  • dimir
    Zabbix developer
    • Apr 2011
    • 1080

    #2
    Zabbix has the ability to discovery network interfaces automatically. And not only network interfaces but also file systems CPUs and so on. If you are doing lots of manual work - you are doing something wrong. You can even create your own specific discovery rules for getting list of things. In the rule you also specify item and trigger prototypes, from which the items and triggers will be created. And removed when device is gone (by default after 30 days).
    But you don't even need to do that. You have the template "Template Module Linux network interfaces by Zabbix agent" that is coming out-of-the-box. Just link this template to your empty host and it will discover and create things for network interfaces discovered on that host. You may want to review some of the template macros, if you search for "Template Module Linux network interfaces by Zabbix agent" in https://www.zabbix.com/integrations/linux you will find more details.

    Comment

    • mixmox
      Member
      • Apr 2020
      • 54

      #3
      im working on my own template
      problem is how add trigger with variable

      Comment

      • dimir
        Zabbix developer
        • Apr 2011
        • 1080

        #4
        If you don't want to use discovery, use host-level user macros. In the template have item with key
        Code:
        net.if.in[{$IF.NAME},bytes]
        and on each host create macro
        Code:
        {$IF.NAME} = ens162
        with the value that represents interface of this host. And also on the same template have the trigger for this item.
        Last edited by dimir; 07-10-2020, 14:48.

        Comment

        • mixmox
          Member
          • Apr 2020
          • 54

          #5
          that's what im looking for
          tx alot

          Comment


          • Hamardaban
            Hamardaban commented
            Editing a comment
            I am very surprised - you work with the system and do not know the basic things... Read the official documentation! You will discover a lot of new and interesting things.
        Working...