Ad Widget

Collapse

PATCH: variable {ITEM.NAME} for alert messages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • just2blue4u
    Senior Member
    • Apr 2006
    • 347

    #1

    PATCH: variable {ITEM.NAME} for alert messages

    I made a patch providing the variable {ITEM.NAME}.
    It contains the description of the triggering item. Example:

    Item:
    - Description: Performance SMTP-Server (0=offline)
    - Key: smtp_perf<25>

    Trigger:
    - Name: "Keine Verbindung zum Mailserver @ {HOSTNAME} möglich"
    - Expression: {tmpl_ux:smtp_perf<25>.avg(120)}=0

    Action message:
    Code:
    Betroffenes System: {HOSTNAME} (IP = {IPADDRESS})
    Komponente: {ITEM.NAME} ({TRIGGER.KEY}) = {{HOSTNAME}:{TRIGGER.KEY}.last(0)}
    
    =============================================================
    Es erfolgt eine Entwarnung, sobald das Problem behoben ist...
    received eMail:
    Code:
    Betroffenes System: mail-2.bfk (IP = *UNKNOWN*)
    Komponente: Performance SMTP-Server (0=offline) (smtp_perf<25>) = 0 ms
    
    =============================================================
    Es erfolgt eine Entwarnung, sobald das Problem behoben ist...
    Patched file: src/zabbix_server/expression.c
    Server version: 1.1.3
    diff command: diff src/zabbix_server/expression.c.orig src/zabbix_server/expression.c > expression.c.diff

    I tested this patch with ./configure, make, make install and it works for me.

    WARNING: This is the first time i modified parts of foreign C source and created a patch. So please let me know if there is something that i did wrong!

    The attached file is a diff, so just rename it to "expression.c.diff" (remove ".txt")

    Maybe, if this patch is ok, i could create more like this...
    Attached Files
    Big ZABBIX is watching you!
    (... and my 48 hosts, 4513 items, 1280 triggers via zabbix v1.6 on CentOS 5.0)
  • dsipe
    Senior Member
    • Oct 2006
    • 184

    #2
    does your patch work for trigger name ?

    I mean is it possible to create a trigger with the name "{ITEM.NAME}" ?

    Comment

    • just2blue4u
      Senior Member
      • Apr 2006
      • 347

      #3
      No, i just tested it and it doesn't work.

      I'll try to add this, too...
      Big ZABBIX is watching you!
      (... and my 48 hosts, 4513 items, 1280 triggers via zabbix v1.6 on CentOS 5.0)

      Comment

      • James Wells
        Senior Member
        • Jun 2005
        • 664

        #4
        Greetings,

        Thanx for the great feature. I have taken it and extended it a bit more to support a need we have where I work. Currently, we have about 22000 items and 15000 triggers. With this many, it is often difficult to keep track of what each trigger means and how best to support it. To fix this, we have taken your patch and added another macro {TRIGGER.COMMENT}, which will pull the comment from an alerting trigger and add it to the message.

        Rather than post a diff against yours, I simply re-packaged yours with mine tacked on afterwards.
        Attached Files
        Unofficial Zabbix Developer

        Comment

        • Alexei
          Founder, CEO
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2004
          • 5654

          #5
          FYI: TRIGGER.COMMENT and TRIGGER.URL are already in pre 1.1.5. I think I mentioned this in some other thread.

          ITEM.NAME is not implemented yet.
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • Alexei
            Founder, CEO
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Sep 2004
            • 5654

            #6
            Support of {ITEM.NAME} has been implemented as well.
            Alexei Vladishev
            Creator of Zabbix, Product manager
            New York | Tokyo | Riga
            My Twitter

            Comment

            • just2blue4u
              Senior Member
              • Apr 2006
              • 347

              #7
              thanks, alexei!

              Zabbix roxx! *thumbs up*
              Big ZABBIX is watching you!
              (... and my 48 hosts, 4513 items, 1280 triggers via zabbix v1.6 on CentOS 5.0)

              Comment

              Working...