Ad Widget

Collapse

Trigger expression in action notificatoin

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mario.almeida
    Member
    • Nov 2008
    • 44

    #1

    Trigger expression in action notificatoin

    Hi All,

    I have the below trigger.

    {Template-app-00:net.tcp.listen[8080].last(0)}=0 | {Template-app-00:net.tcp.listen[1099].last(0)}=0 | {Template-app-00:net.tcp.listen[9090].last(0)}=0


    When sending an alert I want to include the port which caused the trigger.

    Any idea how can I get this?
  • mario.almeida
    Member
    • Nov 2008
    • 44

    #2
    Anyone has some idea on this?

    Comment

    • Colttt
      Senior Member
      Zabbix Certified Specialist
      • Mar 2009
      • 878

      #3
      look at this, it maybe helps?!
      http://www.zabbix.com/documentation/.../config/macros
      Debian-User

      Sorry for my bad english

      Comment

      • mario.almeida
        Member
        • Nov 2008
        • 44

        #4
        Hi,

        Can you please give an example?

        In the documentation it say {ITEM.NAME<1-9>}, But how do I know which Nth item has caused the notification?

        I tried with {ITEM.NAME} it always give me the 1st item, even though if it is caused due to the 2nd or 3rd item.

        Comment

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

          #5
          Originally posted by mario.almeida
          Hi All,

          I have the below trigger.

          {Template-app-00:net.tcp.listen[8080].last(0)}=0 | {Template-app-00:net.tcp.listen[1099].last(0)}=0 | {Template-app-00:net.tcp.listen[9090].last(0)}=0


          When sending an alert I want to include the port which caused the trigger.

          Any idea how can I get this?
          You may include the following details into your message:

          ----------
          Port statuses:

          Port 1099: {{HOSTNAME}:net.tcp.listen[1099].last(0)}
          Port 8080: {{HOSTNAME}:net.tcp.listen[8080].last(0)}
          Port 9090: {{HOSTNAME}:net.tcp.listen[9090].last(0)}
          ----------

          I hope it helps.
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • mario.almeida
            Member
            • Nov 2008
            • 44

            #6
            Thanks Alexei,

            I would rather prefer to have.

            {ITEM.NAME1}: {ITEM.LASTVALUE1}
            {ITEM.NAME2}: {ITEM.LASTVALUE2}
            {ITEM.NAME3}: {ITEM.LASTVALUE3}

            Coz my triggers are per templates bases.
            eg:-

            Temp-00
            monitors port 1099,1100,8080
            Temp-01
            monitors port 1199,1200,8180
            etc...

            Any chance of having a variable which holds the KEYNAME that caused the notification?

            Comment

            • JBo
              Senior Member
              • Jan 2011
              • 310

              #7
              Hi,

              Originally posted by mario.almeida
              Any chance of having a variable which holds the KEYNAME that caused the notification?
              This would only work for triggers of the form A | B | C as in your example.
              What would be the value of KEYNAME if both A and B are true ?
              Which variable would be the cause in more complex triggers as A & B | (C & (D | E)) ?

              If you really need to know which item is the cause of notification, why don't you create 3 simple triggers instead ?
              Trigger1 : {Template-app-00:net.tcp.listen[8080].last(0)}=0
              Trigger2 : {Template-app-00:net.tcp.listen[1099].last(0)}=0
              Trigger3 : {Template-app-00:net.tcp.listen[9090].last(0)}=0

              Regards,
              JBo

              Comment

              • mario.almeida
                Member
                • Nov 2008
                • 44

                #8
                What would be the value of KEYNAME if both A and B are true ?
                Which variable would be the cause in more complex triggers as A & B | (C & (D | E)) ?
                I know, but looking for some alternative.

                If you really need to know which item is the cause of notification, why don't you create 3 simple triggers instead ?
                Sure.

                I have around 35 to 40 servers, each server will have 4 to 6 templates (min is 4) and if I create 3 triggers per templates (3 is just an example, jboss ejb needs many other ports) then I need to add that many triggers in the action.

                suppose I have just 1 trigger and need to add another port, then modify trigger in that templates only Action notification will remain as it is.

                Comment

                Working...