Ad Widget

Collapse

HTTP Agent for Website uptime

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andy.brown
    Junior Member
    • Apr 2019
    • 3

    #1

    HTTP Agent for Website uptime

    Hi,
    I have installed Zabbix 4.0 and I'm monitoring a website uptime.
    I created an Item "HTTP Agent" with the URL of the website homepage.

    In the preprocessing section I added a regular expression to capture the status code of the page.
    If the webserver is online, I get a 200 (OK) response, but if I stopped the apache2 webservice, I get a

    "item became not supported: Cannot perform request: Failed to connect to xxx.xxx.xxx.xxx port 443: Connection refused"

    I can I configure the item and the trigger "{xxx.xxx.xxx.xxx:http_page_value.last()}<>200 " to generate an alarm if the webserver has been shutted down or it is unreachable?

    Thanks in advance for the answers!
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    If you want to make sure that you have a web site response and a response code of 200, why not use the web monitoring feature instead of using the HTTP Agent item?

    Manual:

    Comment

    • andy.brown
      Junior Member
      • Apr 2019
      • 3

      #3
      Hi reached some goal setting a web scenario for the web page, but if shut down apache, I can't get any change on the status code.
      In the "failed steps of the scenario" when apache has been shutted down the value is "1", because he can't get the home page of the web site, so I set a trigger to check when the failed step is 1.
      I don't know if this is a good solution, if you have any suggestions, you're welcome

      Comment

      • mauro
        Member
        • Jan 2017
        • 94

        #4
        {xxx.xxx.xxx.xxx:http_page_value.last()}<>200
        or
        {xxx.xxx.xxx.xxx:http_page_value.nodata(1h)}=1

        I set 1h, but if the time to check is less, you can reduce this value...

        Comment

        • Atsushi
          Senior Member
          • Aug 2013
          • 2028

          #5
          Are you following two cases that you would like to monitor?

          - Is 200 returned?
          - Is the response of the web server returned?

          If so, do not set "Required status codes" in the step, but use the following two items of Web monitoring.

          - web.test.rspcode[scenario,step]
          - web.test.fail[senario]

          After that, write the conditional expressions for the two cases desired in the trigger settings. Assuming that the host name is "Linux1", the scenario name is "WebMon", and the step name is "Step1", it is the following conditional expression.

          Code:
          ({Linux1:web.test.fail[WebMon].last()}=0 and {Linux1:web.test.rspcode[WebMon,Step1].last()}<>200)
           or
          ({Linux1:web.test.fail[WebMon].last()}=1)
          In other words, when the response comes back but the response code is not 200, and when the response itself does not come back is regarded as failure.

          Comment

          Working...