Ad Widget

Collapse

It's possible to get historical value in trigger name?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Freezstyler
    Member
    • Oct 2022
    • 39

    #1

    It's possible to get historical value in trigger name?

    Hello,
    I'm building a trigger for changing an RSSI value in our antenas. Typical use case will be after heavy snowing or strong wind.

    I would like to see somehing like: {HOST.NAME} RSSI changed from OLD.VALUE to CURRENT.VALUE, so I would like to get historical value, print it and the same I need to do for actual (last) value.

    I didn't find any useful macro here: https://www.zabbix.com/documentation...ed_by_location but maybe it exists some workarounds.

    I can get a host name and item current (last value) now I need just old (historical value).

    For now I have this:

    {HOST.NAME} RSSI changed from to {ITEM.LASTVALUE}

    On this printscreen I have used {ITEM.LASTVALUE} and {ITEM.VALUE} but I got same value.

    Click image for larger version

Name:	image.png
Views:	1494
Size:	7.3 KB
ID:	454540

    and expression like this: change(/Siklu_CB1/siklu.rssi)<10 (here I want to ask, the RSSI is a negative value and for example -35 is better than -40, how should I treat to negative values in terms of expressions?)

    Thank you!​
  • Freezstyler
    Member
    • Oct 2022
    • 39

    #2
    Nobody know please?

    Comment

    • Semiadmin
      Senior Member
      • Oct 2014
      • 1625

      #3
      {?EXPRESSION}

      Comment

      • Freezstyler
        Member
        • Oct 2022
        • 39

        #4
        Hmm, can someone point me to right direction? I tried to use last(/Siklu_CB1/siklu.rssi) <> last(/Siklu_CB1/siklu.rssi,#20) but it still prints same values. And I need to trigger this only if the value changes for example by 10dbm

        I tried also this: last(/Siklu_CB1/siklu.rssi) <> last(/Siklu_CB1/siklu.rssi,#20) and change(/Siklu_CB1/siklu.rssi)<>10 but this one also don't work.

        Long story short, I need two things.

        1) Get values for last RSSI and previous and if the change is more than 10db than fire the trigger.
        2 Print the values last and previous in trigger name.

        Thanks.

        Comment

        • Freezstyler
          Member
          • Oct 2022
          • 39

          #5
          I tried different approach. I'm almost there, but I have somewhere an error. The {ITEM.LASTVALUE1} and {ITEM.VALUE2} always gets the same value, but it should take value from history of 1 day ago

          Click image for larger version

Name:	image.png
Views:	1292
Size:	38.8 KB
ID:	454665

          Comment

          • Markku
            Senior Member
            Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
            • Sep 2018
            • 1781

            #6
            Semiadmin said it already, I'll add the link to documentation: https://www.zabbix.com/documentation...ression_macros

            Markku

            Comment

            • Freezstyler
              Member
              • Oct 2022
              • 39

              #7
              I found this part of documentation, but unfortunately Zabbix documentation is one of the worse I have seen so far. It lacks enough of images with examples.

              I would not bother anyone if I didn't spend like two days on this simple task.

              So please, is my expression right? I think I need to add an "and change()" and there specify that 10dbm?

              And i don't understand where to put "?" In the expression or trigger name?

              Thank you kindly.

              Comment

              • Markku
                Senior Member
                Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                • Sep 2018
                • 1781

                #8
                Ok now I haven't ever used it, but by reading the documentation and looking at the examples there:

                {?last(/Siklu_CB1/siklu.rssi)} should give you the last value of that key, and

                {?last(/Siklu_CB1/siklu.rssi,#2)} should give you the previous value.

                They are used in the trigger event name.

                Markku

                Comment

                • Freezstyler
                  Member
                  • Oct 2022
                  • 39

                  #9
                  Thank you and for 1 day old value can i use it like this, or there is better approach?

                  {?first(/Siklu_CB1/siklu.rssi,1d)}

                  Comment

                  • Markku
                    Senior Member
                    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                    • Sep 2018
                    • 1781

                    #10
                    That should do it, yes

                    Markku

                    Comment

                    • Freezstyler
                      Member
                      • Oct 2022
                      • 39

                      #11
                      I tried it today, but it's not working, I got *UNKNOWN* *UNKNOWN* instead of values. Screens with configuration below :/

                      Click image for larger version

Name:	image.png
Views:	1279
Size:	16.1 KB
ID:	454834

                      Click image for larger version

Name:	image.png
Views:	1364
Size:	7.6 KB
ID:	454835

                      Comment

                      • Markku
                        Senior Member
                        Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                        • Sep 2018
                        • 1781

                        #12
                        The documentation says that the expresssion macros are available (f.ex.) in "trigger event names​", not in trigger names.

                        Markku

                        Comment

                        • Freezstyler
                          Member
                          • Oct 2022
                          • 39

                          #13
                          Ok, I moved the macro to "Event name" and still got *UNKNOWN* *UNKNOWN*

                          Click image for larger version

Name:	image.png
Views:	1286
Size:	19.5 KB
ID:	454839

                          Comment

                          • Markku
                            Senior Member
                            Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                            • Sep 2018
                            • 1781

                            #14
                            Works here:

                            Click image for larger version

Name:	image.png
Views:	1289
Size:	15.4 KB
ID:	454842

                            Click image for larger version

Name:	image.png
Views:	1303
Size:	50.2 KB
ID:	454843

                            Zabbix 6.2.4

                            Markku

                            Comment

                            • Freezstyler
                              Member
                              • Oct 2022
                              • 39

                              #15
                              I have 6.2.2 version of Zabbix, but I don't think that version is the problem?

                              Comment

                              Working...