Ad Widget

Collapse

Webserver sends empty response to zabbix, not to other clients

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brambo
    Senior Member
    • Jul 2023
    • 245

    #1

    Webserver sends empty response to zabbix, not to other clients

    Hi
    I got 3 rabbitMQ nodes all with the same monitoring username. All do the same response so examples only show 1.
    Getting data from the webserver API (basic http authentication) works from my workstation using a browser and by using curl.
    Curl command looks like:
    Code:
    curl -i -u username:password http://webserverip1:15672/api/overview
    Using the same address with a http agent in zabbix server works fine as well.
    Using the same address with zabbix agent works as well but the key is ofcourse different:
    Code:
    web.page.regexp[http://username:password@localhost,/api/overview,15672,^({.*)$,,]
    So far so good.
    Now the strange thing come to play.
    When I want to retrieve a different endpoint (the nodes endpoint)
    Code:
    curl -i -u username:password http://webserverip1:15672/api/nodes
    This works fine with curl and browser on my system.
    When i logon to the host and change and use localhost this works fine on the host as well.
    When I use http agent or zabbix-agent route I get an empty response.
    When I change the credentials to wrong ones, I get an authentication failure.

    I just can't find the reason for this empty response and hopefully someone can point me to the right directions.
    BTW other endpoints like /api/vhosts also give an empty response, where retrieving the information directly from my own system works fine.

    Zabbix 7.0.0
    Last edited by Brambo; 30-07-2024, 10:50. Reason: type fixed
  • Answer selected by Brambo at 31-07-2024, 08:54.
    Brambo
    Senior Member
    • Jul 2023
    • 245

    As mostly always it's not a bug but an user error. The /nodes page gives a slightly different output, This Json output doesn't start with { but with [{ the causes that the regex doesn't match. Change the regex part to
    Code:
    ^(\[{.*)$,,]
    and now the data collection works.

    Comment

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

      #2
      What do you get when using curl on the Zabbix server?

      Use -v in curl to add verbosity as well.

      Markku

      Comment

      • Brambo
        Senior Member
        • Jul 2023
        • 245

        #3
        Originally posted by Markku
        What do you get when using curl on the Zabbix server?

        Use -v in curl to add verbosity as well.

        Markku
        Using curl on the zabbix server both URLs give output.

        Comment

        • Brambo
          Senior Member
          • Jul 2023
          • 245

          #4
          As mostly always it's not a bug but an user error. The /nodes page gives a slightly different output, This Json output doesn't start with { but with [{ the causes that the regex doesn't match. Change the regex part to
          Code:
          ^(\[{.*)$,,]
          and now the data collection works.

          Comment

          Working...