Ad Widget

Collapse

Discussion thread for official Zabbix Template RabbitMQ

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • petervanderdoes
    Junior Member
    • May 2022
    • 1

    #31
    j.h. Using Zabbix 6 I ran into the same problem. It seems for some reason or another that the RabbitMQ: Get nodes does not handle the macro HOST.NAME correctly. After replacing the macro with a hard coded name it started working.

    Instead of
    Code:
    web.page.get["http://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.HOST}:{$RABBITMQ.API.PORT}/api/nodes/{$RABBITMQ.CLUSTER.NAME}@{HOST.NAME}?memory=true"]
    I have
    Code:
    web.page.get["http://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.HOST}:{$RABBITMQ.API.PORT}/api/nodes/{$RABBITMQ.CLUSTER.NAME}@production-server?memory=true"]
    have no idea why the {HOST.NAME} returns the visible name

    Comment

    • wfeddern
      Junior Member
      • Aug 2022
      • 2

      #32
      Originally posted by vkhaliev
      • Queues discovery rule is dependent, so you can execute it manually by execution of master item.
      • If discovery rule doesn't work check macros values. Macro {HOST.NAME} used as a node name at filters in queues discovery. It must be the same as node name in RabbitMQ. Actually this macro get data from visible name of the host, but if it is not specified host name will be used instead. So the simplest way is to configure visible name or host name in zabbix.
        Also you can setup your own macro like it was recommended in previous comments, but in this case you will need to change filter in queues discovery.
        Macro {HOST.NAME} also used at the URL of "Get Nodes" item, so if you use your own macro you need to change this key too. Otherwise "Failed to fetch nodes data" trigger status can be "problem".
      • Macro {$RABBITMQ.API.SCHEME} will be added to RabbitMQ by agent template in https://support.zabbix.com/browse/ZBX-20562.
      • Item names will be fixed in https://support.zabbix.com/browse/ZBX-20562.
      • Trigger expression "Too many messages in queue" already has context macro with queue name, so you can configure threshold for every queue. (For example: {$RABBITMQ.MESSAGES.MAX.WARN:"dead-letter"}, value "0").
        Link to documentation about context macros: https://www.zabbix.com/documentation...macros_context
      Is there any way to also specify the vhost in the "too many messages in queue" trigger? I have a number of vhosts, some with duplicate queue names that require different values.

      Also, is there a macro to set a default max for all queues without a specific MAX.WARN set?

      Comment

      • Arvydas
        Junior Member
        • Jan 2023
        • 1

        #33
        I have trouble to collect RabbitMQ data with Zabbix. Zabbix version 6.0.9, RabbitMQ templates version: 6.0
        I run RabbitMQ as service (Multi-protocol open source messaging broker) on Windows machine (https://www.rabbitmq.com/rabbitmq-service.8.html). Not like a process. Zabbix agent successfully collecting other data on the same server with "Windows by Zabbix agent" template, but with same settings RabbitMQ templates can't. Tried all templates (RabbitMQ cluster by HTTP, RabbitMQ cluster by Zabbix agent, RabbitMQ node by HTTP, RabbitMQ node by Zabbix agent). In host configuration I use the same IP/port to connect to zabbix agent and hope agent will connect to rabbit cluster with credentials I give in macros fields.
        MQ Management plugin enabled, zabbix monitoring user created, credentials/ip/port/etc - all defaults.
        Zabbix log full of this:
        item "RabbitMQ 1:web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RA BBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/exchanges"]" became not supported: Unsupported URL format.
        item "RabbitMQ 1:web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RA BBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]" became not supported: Unsupported URL format.
        item "RabbitMQ 1: proc.cpu.util["{$RABBITMQ.PROCESS_NAME}"]" became not supported: Unsupported item key.
        item "RabbitMQ 1: proc.mem["{$RABBITMQ.PROCESS_NAME}",,,,rss]" became not supported: Unsupported item key.
        item "RabbitMQ 1: proc.mem["{$RABBITMQ.PROCESS_NAME}",,,,vsize]" became not supported: Unsupported item key.
        item "RabbitMQ 1:web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RA BBITMQ.API.HOST}:{$RABBITMQ.API.PORT}/api/nodes/{$RABBITMQ.CLUSTER.NAME}@{HOST.NAME}?memory=true"]" became not supported: Unsupported URL format.
        item "RabbitMQ 1:web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RA BBITMQ.API.HOST}:{$RABBITMQ.API.PORT}/api/overview"]" became not supported: Unsupported URL format.
        item "RabbitMQ 1:web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RA BBITMQ.API.HOST}:{$RABBITMQ.API.PORT}/api/queues"]" became not supported: Unsupported URL format.
        RabbitMQ log only these msgs:
        [warning] <0.3031.86> HTTP access denied: user 'zbx_monitor' - Not administrator user
        [error] <0.970.0> Could not find handle.exe, please install from sysinternals
        But this "access denied" msg just because I used zbx_monitor user in web to check creds.
        It never worked for me. Any suggestions?​

        Comment

        • akamagroboy
          Junior Member
          • Sep 2020
          • 9

          #34
          Originally posted by petervanderdoes
          j.h. Using Zabbix 6 I ran into the same problem. It seems for some reason or another that the RabbitMQ: Get nodes does not handle the macro HOST.NAME correctly. After replacing the macro with a hard coded name it started working.

          Instead of
          Code:
          web.page.get["http://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.HOST}:{$RABBITMQ.API.PORT}/api/nodes/{$RABBITMQ.CLUSTER.NAME}@{HOST.NAME}?memory=true"]
          I have
          Code:
          web.page.get["http://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.HOST}:{$RABBITMQ.API.PORT}/api/nodes/{$RABBITMQ.CLUSTER.NAME}@production-server?memory=true"]
          have no idea why the {HOST.NAME} returns the visible name
          Yes, {HOST.NAME} is returning Visible Name of the host, changed it to match the hostname on Rabbit and it started working properly for Get nodes and Queues Discovery.

          Comment

          • kraut
            Junior Member
            • Feb 2023
            • 1

            #35
            Originally posted by akamagroboy

            Yes, {HOST.NAME} is returning Visible Name of the host, changed it to match the hostname on Rabbit and it started working properly for Get nodes and Queues Discovery.
            To be frank seems like the issue comes from how we're defining {$RABBITMQ.CLUSTER.NAME} currently.
            If we set a host marco for the real cluster name like reported from "rabbitmq cluster_status" it will fail.
            Reason is the cluster name usually is "rabbit@cluster" so this will lead to "rabbit@cluster@visible_name".

            Couldn't we rather put "@{HOST.NAME}" inside the template marco {$RABBITMQ.CLUSTER.NAME}?
            Code:
            macro: '{$RABBITMQ.CLUSTER.NAME}'
            value: rabbit@{HOST.NAME}
            description: 'The name of RabbitMQ cluster'​
            And allow full overwrite via host macros of this inherited default by changing the template item to?
            Code:
            web.page.get["http://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.HOST}:{$RABBITMQ.API.PORT}/api/nodes/{$RABBITMQ.CLUSTER.NAME}?memory=true"]
            Prototyping this for our limited use case of "single node clusters" seem to work instead hardcoding.

            BTW Found this bug report where we should probably move this topic after discussion of all use cases
            https://support.zabbix.com/browse/ZBX-18388​

            Comment

            • Kos
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • Aug 2015
              • 3404

              #36
              Originally posted by Semiadmin
              There is a weird thing with this template. Dependent LLD rules execute every time master items get JSON from Rabbit API, i.e. every minute. It's not good for performance. Maybe add 2-step preprocessing to the LLD rule:
              1. JS: return JSON.stringify(JSON.parse(value),['type','name','vhost'])
              (for Exchanges discovery, ['node','name','vhost'] for Queues discovery)
              2. Discard unchanged with heartbeat 1h
              Hi Semiadmin,
              I started to use the template "RabbitMQ cluster by Zabbix agent" (for Zabbix v6.x) now, discovered the same issue and found the same solution
              I didn't expect that this issue is still exist (more than 3 years after your comment).
              JFYI: I've opened the ticket to fix it.

              Update:
              fixed 24-Apr-2024
              Last edited by Kos; 10-05-2024, 12:26.

              Comment

              • Semiadmin
                Senior Member
                • Oct 2014
                • 1625

                #37
                Hi, Kos. Thanks for the ticket. Voted.

                Comment

                • Desalwen18
                  Junior Member
                  • Apr 2024
                  • 2

                  #38
                  Thank you for so needed template, may you convert him to Zabbix 4.2?

                  Comment

                  • Desalwen18
                    Junior Member
                    • Apr 2024
                    • 2

                    #39
                    Yes, {HOST.NAME} is returning Visible Name of the host, changed it to match the hostname on Rabbit and it started working properly for Get nodes and Queues Discovery.
                    .
                    .
                    .
                    .
                    ​

                    Comment

                    • karamveer
                      Junior Member
                      • May 2024
                      • 2

                      #40
                      Hi friends,
                      I am facing an issue with RabbitMQ monitoring by agent.
                      I have set as per template https://git.zabbix.com/projects/ZBX/...Frelease%2F6.4 but my queue discovery rule is not working, however Item RabbitMQ node by Zabbix agent: RabbitMQ: Get queues is working properly. I want to create a graph for every queue which is being discovered by the discovery rule. Please assist me to achieve this.

                      Comment

                      • karamveer
                        Junior Member
                        • May 2024
                        • 2

                        #41
                        Originally posted by karamveer
                        Hi friends,
                        I am facing an issue with RabbitMQ monitoring by agent.
                        I have set as per template https://git.zabbix.com/projects/ZBX/...Frelease%2F6.4 but my queue discovery rule is not working, however Item RabbitMQ node by Zabbix agent: RabbitMQ: Get queues is working properly. I want to create a graph for every queue which is being discovered by the discovery rule. Please assist me to achieve this.
                        thanks, I have resolved the issue, Queue discovery was picking the {HOST.NAME} as Visible Name rather than host name, I changed the Value of the Visible name to its host name then its start working.

                        Thanks

                        Comment

                        • mariusl
                          Junior Member
                          Zabbix Certified SpecialistZabbix Certified Professional
                          • Aug 2024
                          • 25

                          #42
                          Thank you for the great template. Is there any way to create a version using Active Agent?

                          Comment

                          • mariusl
                            Junior Member
                            Zabbix Certified SpecialistZabbix Certified Professional
                            • Aug 2024
                            • 25

                            #43
                            Originally posted by mariusl
                            Thank you for the great template. Is there any way to create a version using Active Agent?
                            Adding to this, it is my understanding that it is not possible to use SSL certificates along with the agent template as it seems it is not supported with `web.page.get`. How are we then supposed to use schema https?

                            Edit: Disregard the above. Figured out the solution to use the OS certificate store for loading the certs with `web.page.get`.
                            Last edited by mariusl; 21-06-2025, 13:34.

                            Comment

                            • KJEchoZabbix
                              Junior Member
                              • Oct 2025
                              • 7

                              #44
                              Found the fix. The 500 error was a red herring. The real reason was a need to update memory_limit from 128M to 1024M in both /etc/php.ini and /etc/php-fpm.d/zabbix.conf After the changes a restart (systemctl restart httpd php-fpm) of the two services fixed the memory error that was then triggering a 500 error.

                              Hey. Running this on Zabbix 7.4. 2 hosts, 2 frontends (apache), 1 DB, and 2 proxies.

                              I've added the template and let it run.

                              Here is the problem I'm seeing...

                              The latest data shows 41817 items. The only other template is a base Linux template that discovers about 125 of those total metrics.

                              If I click on the latest data, I get a 500 error.

                              I also wondered whether the dashboard can display either all queues or a subset of them, along with their data.
                              Last edited by KJEchoZabbix; 06-01-2026, 23:30.

                              Comment

                              • KJEchoZabbix
                                Junior Member
                                • Oct 2025
                                • 7

                                #45
                                Here is a secondary question, now that I can see the latest data.

                                For these Rabbit metrics, I see the following message in the error flag, in the info column.

                                Cannot perform request: Received HTTP/0.9 when not allowed

                                How can I get around this, since all the queues show 0 values?

                                Comment

                                Working...