Ad Widget

Collapse

Apache by Agent - Cannot Resolve

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • furgussen
    Junior Member
    • Sep 2020
    • 3

    #1

    Apache by Agent - Cannot Resolve

    Hello,

    I'm sure I'm missing something simple.

    This is a new build, Zabbix 5.0.2 with all the built-in templates. I've put this out in AWS to monitor our cloud infrastructure.

    I've added about a dozen hosts, most are Amazon Linux 2. I've applied the default Apache by Agent template and all is well.

    I have two Debian 10 hosts with Apache and for some reason I'm not getting data back from Apache. If I'm on the host I can run:

    Code:
    curl http://127.0.0.1:80/server-status?auto
    And I get the proper status page.

    But from the Zabbix server I cannot.

    When I try zabbix_get, I see this error:

    Code:
    [user@zabbixserver ~]$ zabbix_get -s Debian10-Host -p 10050 -k web.page.get["http://127.0.0.1:80/server-status?auto"]
    ZBX_NOTSUPPORTED: HTTP get error: cannot resolve [http://127.0.0.1:80/server-status?auto]
    I've upped the logging level to 5 on the Agent but I don't see any other info other than "cannot resolve". This works fine on my Amazon Linux 2 servers, but these Debian 10 boxes are giving me trouble.

    Where can I look next?
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    Can you make a request "curl http:/IP_ADDRESS:80/server-status" from the zabbix server?
    If not, look at the Apache access settings and firewall settings.

    Comment


    • Hamardaban
      Hamardaban commented
      Editing a comment
      Yes indeed said something silly. forget.
  • furgussen
    Junior Member
    • Sep 2020
    • 3

    #3
    No. I've specifically restricted that /server-status URL to only localhost. Since it's using the App Apache by Agent template, the request should be coming from localhost anyway. If I wanted the request to come from the Zabbix server, wouldn't I have to change the template, or at least the macros for that host?

    Comment

    • isaqueprofeta
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Aug 2020
      • 154

      #4
      Originally posted by furgussen
      No. I've specifically restricted that /server-status URL to only localhost. Since it's using the App Apache by Agent template, the request should be coming from localhost anyway. If I wanted the request to come from the Zabbix server, wouldn't I have to change the template, or at least the macros for that host?
      Set up your agents with an UserParamenter and you can get the values from the localhost curl that you're wanting to use. Something like:

      Code:
      UserParamenter=apache.server.status, curl http://127.0.0.1:80/server-status?auto

      Comment

      • furgussen
        Junior Member
        • Sep 2020
        • 3

        #5
        Bizarre. The custom UserParameter works!

        Looks like I'll have to create a custom template for these Debian hosts.

        Thank You

        Comment

        • claudemlandry
          Junior Member
          • Nov 2020
          • 1

          #6
          I got the exact same problem on an old server which was limited to use version 3.x of the agent.
          After a lot of trial and error, I figured out the "cannot resolve" mystery.

          It appears that the parameters for the key web.page.get has changed since version 4.0.1

          With older versions of the agent, you have to use 3 parameters: host, path, port
          while on newer agent, you can use a single parameter: URL

          As the new server template is pushing an URL in a host parameter, the agent wasn't able to resolve the hostname.

          The solution:
          I cloned the template and changed the item "Apache: Get status" to use this key:

          web.page.get["{$APACHE.STATUS.HOST}","/{$APACHE.STATUS.PATH}","{$APACHE.STATUS.PORT}"]

          Problem solved!

          Comment

          • Schmitz
            Junior Member
            • Dec 2020
            • 2

            #7
            Thx a lot claudemlandry, got exactly the same trouble and in my setup web.page.get["{$APACHE.STATUS.HOST}","/{$APACHE.STATUS.PATH}","{$APACHE.STATUS.PORT}"] is the good key to use for the "Apache: Get status" Item.

            Comment

            Working...