Ad Widget

Collapse

Wrong {TRIGGER.URL} in Pushover notifications

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • barannikov
    Junior Member
    • Jun 2023
    • 6

    #1

    Wrong {TRIGGER.URL} in Pushover notifications

    I am struggling with trigger URLs which are coming with notifications from Pushover. My Zabbix URL is correct: www.zabbixserver.com/zabbix/ but trigger URLs are sent like https://www.zabbixserver.com/tr_even...blah-blah-blah instead of https://www.zabbixserver.com/zabbix/...blah-blah-blah.

    How can I bulk change trigger URLs to make it work?

    Zabbix documentation is ether lacks it or the search is doomed.
  • Answer selected by barannikov at 12-08-2024, 13:22.
    barannikov
    Junior Member
    • Jun 2023
    • 6

    Thanks for giving me the idea to check macros! It turned out that my {$ZABBIX.URL} is used for concatenating trigger/event links and it lacked the full path, thus causing broken URLs. Kudos!

    Comment

    • Brambo
      Senior Member
      • Jul 2023
      • 256

      #2
      Did you set the frontend URL correct?
      Administration > General > Other

      Comment

      • barannikov
        Junior Member
        • Jun 2023
        • 6

        #3
        It was wrong, indeed, but fixing it didn't fix {TRIGGER.URL} in Pushover notifications.

        Comment

        • Brambo
          Senior Member
          • Jul 2023
          • 256

          #4
          I do it like this in the media template: paramater ServerTrigger =
          Code:
          {$ZINSTANCE}tr_events.php?triggerid={TRIGGER.ID}&eventid={EVENT.ID}
          Where the macro ZINSTANCE is the URL including a / at the end example: http://examplezabbix.com/ or in your scenario: https://www.zabbixserver.com/zabbix/
          The macro is set as a global macro in the administration section.
          In the media type I set a parameter to the earlier mentioned value and in the script of this media template I used it where I need it.

          Comment

          • barannikov
            Junior Member
            • Jun 2023
            • 6

            #5
            Thanks for giving me the idea to check macros! It turned out that my {$ZABBIX.URL} is used for concatenating trigger/event links and it lacked the full path, thus causing broken URLs. Kudos!

            Comment

            • barannikov
              Junior Member
              • Jun 2023
              • 6

              #6
              Hm, it turned out to be too early to open the champagne. After I changed global {$ZABBIX.URL} from https://example.com/ to https://example.com/zabbix/ pushover sends me https://example.com/zabbix/ in the end of the message instead of event/trigger URL though message template contains {TRIGGER.URL}:
              Code:
              Problem started at {EVENT.TIME} on {EVENT.DATE}
              Host: {HOST.NAME}
              Problem name: {EVENT.NAME}
              Severity: {EVENT.SEVERITY}
              {TRIGGER.URL}​
              Weird.

              Comment

              • Brambo
                Senior Member
                • Jul 2023
                • 256

                #7
                Looking at the default pushover media type the trigger.url should be atleast something like:
                Click image for larger version

Name:	image.png
Views:	345
Size:	35.9 KB
ID:	489523
                so zabbix URL/tr_events etc etc. If you get something else i think you change things away from default.
                You could change the media type and add Zabbix.log lines to troubleshoot.

                Comment

                • barannikov
                  Junior Member
                  • Jun 2023
                  • 6

                  #8
                  Thank you for looking into it. My url pushover media variable was missing, leaving only url_title variable, thus causing unclickable wrong link in the end of every message. Thanks a million!

                  Comment

                  • irontmp
                    Member
                    • Sep 2023
                    • 85

                    #9
                    I had a similar issue and found that the easiest solution is to check the Zabbix frontend URL configuration first. Make sure it includes the /zabbix/ path, for example https://www.zabbixserver.com/zabbix/. If you have many URLs to review, Bulk URL Opener can also be useful for checking multiple generated links quickly. If the frontend URL is correct but {TRIGGER.URL} is still generating the wrong path, the URLs are probably defined in the trigger configuration or notification template. Rather than editing them one by one, you can update them in bulk through the Zabbix API.

                    Comment

                    Working...