Ad Widget

Collapse

Zabbix 7 - Website Monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stevefxp
    Senior Member
    • Aug 2020
    • 168

    #1

    Zabbix 7 - Website Monitoring

    Hello all,

    I have just implemented Zabbix 7 on my central monitoring platform. I would like to implement website monitoring for my production URLs. I know Zabbix 7 has a hook with Selenium, but I look at that combination as more of a testing tool. I just want to monitor up/down status of the websites. I see web scenarios seem to be the way to do this but I do have questions. Since libcurl is needed for this do I just install Curl via my APT repositories or do I have to compile Zabbix 7 with libcurl? Second it says to curl your website and note any name on the output, and use in the required string section. Do I just add the text from the first html to the last html statement?

    Thanks,
    Steve
  • MRedbourne
    Senior Member
    • Feb 2023
    • 103

    #2
    Originally posted by stevefxp
    Hello all,

    I have just implemented Zabbix 7 on my central monitoring platform. I would like to implement website monitoring for my production URLs. I know Zabbix 7 has a hook with Selenium, but I look at that combination as more of a testing tool. I just want to monitor up/down status of the websites. I see web scenarios seem to be the way to do this but I do have questions. Since libcurl is needed for this do I just install Curl via my APT repositories or do I have to compile Zabbix 7 with libcurl? Second it says to curl your website and note any name on the output, and use in the required string section. Do I just add the text from the first html to the last html statement?

    Thanks,
    Steve
    We're a little different because curl was installed for us natively by the OS, so it shipped with it. The easy way to see if Linux linked libcurl to the agent/server is:

    ldd $(which zabbix_server) | grep -i "curl"
    ldd $(which zabbix_agent2) | grep -i "curl"

    If they return results, it's link to curl.

    As for the web scenario. You don't need to use HTML to test it. Natively, it'll test the HTTP response headers. Eg: 404, 200, <etc>. If you're looking to simply see if the website is up, I'd test for the response code 200 in the headers.

    Here's a quick test to see if regex will match (zabbix_agent2): zabbix_agent2 -t web.page.regexp[http://example.com,,,"200"]

    Here's my output:
    [root@2941-rc8-dev ~]# zabbix_agent2 -t web.page.regexp[http://example.com,,,"200 OK"]
    web.page.regexp[http://example.com,,,200 OK] [s|200 OK].

    Comment

    • stevefxp
      Senior Member
      • Aug 2020
      • 168

      #3
      When I ran it with zabbix_server I got the following:

      root@zabbixm01:/home/administrator# ldd $(zabbix_server) | grep -i "curl"
      zabbix_server [1295]: ERROR: "WebServiceURL" configuration parameter must be set when setting "StartReportWriters" configuration parameter
      ldd: missing file arguments
      Try `ldd --help' for more information.

      I would assume this means curl is not linked?

      Comment


      • Markku
        Markku commented
        Editing a comment
        "which " is missing
    • stevefxp
      Senior Member
      • Aug 2020
      • 168

      #4
      So the Zabbix server responded with: libcurl.so.4 => /lib/x86_64-linux-gnu/libcurl.so.4 (0x00007fc71f51d000). The Zabbix agent2 responded with nothing. Is that ok?

      Comment

      Working...