Ad Widget

Collapse

Setting the User-Agent header in Zabbix for the http agent.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davemj9876
    Junior Member
    • Feb 2023
    • 3

    #1

    Setting the User-Agent header in Zabbix for the http agent.

    I don't know if this is a known issue, or I have come across some thing new.

    I am trying to monitor a couple of Apache webservers, all nicely setup and using mod_status. That bit is working.

    The issue I have found is that the http agent is getting a 403 response from the webserver when it is attempting to get the mod_status output. A little digging and creating some web scenarios (which work) and some basic items using the http agent (which don't work) lead me to the following discovery:

    The webserver from a security point of view issues a 403 response if the browsing agent does not set an User-Agent header:

    The web scenarios put zabbix in the User-Agent header (comfirmed in the logs of the webservers):

    - - [22/Feb/2023:06:25:05 +0000] "GET /whats-on/ HTTP/1.1" 200 34546 "-" "Zabbix"

    However when the User-agent is not set I get

    - - [23/Feb/2023:01:18:31 +0000] "GET /whats-on HTTP/1.1" 403 5711 "-" "-"

    Is there a way of setting the User-Agent header for the HTTP AGENT in Zabbix

    I am using Zabbix 6.2 (The options of changing the web settings is currently not an option until I get to speak with the web designer, and to be honest, I would much prefer the Agent to identify itself within the logs

    Many thanks

    David


  • davemj9876
    Junior Member
    • Feb 2023
    • 3

    #2
    Okay, I worked it out, and determined that you needed to add a header line for the User-Agent when creating the item. Went back to the "apache by http" template ,added a User-agent line and I have some status information coming through. Now to determine why some of the data is not getting processed correctly.

    Comment

    • davemj9876
      Junior Member
      • Feb 2023
      • 3

      #3
      Originally posted by davemj9876
      Okay, I worked it out, and determined that you needed to add a header line for the User-Agent when creating the item. Went back to the "apache by http" template ,added a User-agent line and I have some status information coming through. Now to determine why some of the data is not getting processed correctly.
      The missing data issue has now been resolved and all the information is coming through for the mulitple apache webservers that I needed to configure,.

      Comment

      • stefandewal
        Junior Member
        • Sep 2025
        • 1

        #4
        hi can youi tell me how you added it? please share all the info required to set this up. perhaps someone also know how to add an user and password to the template in case a status is secured by user and password?

        Comment

        Working...