Ad Widget

Collapse

Web Site Monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rudolf
    Member
    • Dec 2004
    • 90

    #1

    Web Site Monitoring

    good day everyone,

    I know this is discussed in several threads, but I ask again: web site monitoring. how can we do it?
    connect to a web site (http and https), and check for a text like "copyright by mister someone 2005", and then return the time it took. or return -1 if the check failed. I used a modified version of the checkurl script I found in the zabbix cookbook forum. this script does the job good, but with 85 web sites it can cause real problems. unfortunately I didn't find yet a better solution to check web sites.
  • Nate Bell
    Senior Member
    • Feb 2005
    • 141

    #2
    Here's what I use to check a webpage. I set the webpage itself to read in the first parameter you pass to the script, that way you can have 85 different items, but only need one script (assuming you're looking for the same thing on each page).
    Code:
    status=$(wget -t 1 -T 1 -q -O - $1 | grep "yes I work fine" | wc -l)
    if [ $status -eq 0 ]; then
         echo 0
         else echo 1
    fi
    As you can see, it quickly grabs the source from a webpage, and then checks for a specific line of text. As long as that text is found, it returns with a 1, otherwise, it returns with an error. I would recommend setting up your triggers to go off after getting a few 0s in a row. Something like:
    Code:
    {Host:websitetest[http://mywebsite1].max(180)}<1
    Which will become true if it hasn't sucessfully found the website for 3 minutes.
    This seems to run pretty quickly on my Zabbix server.

    Hope that helps,

    Nate

    Comment

    • bbrendon
      Senior Member
      • Sep 2005
      • 870

      #3
      how about a solution for windows?
      Unofficial Zabbix Expert
      Blog, Corporate Site

      Comment

      • lazat
        Junior Member
        • Jan 2005
        • 12

        #4
        Windows

        I have tried to set this up in the agentd.conf file in windows with the ZabbixW32.exe but i can get it to work.

        Can someone verify this code ? It works in linux
        UserParameter=check_myhttpd[*],c:\windows\winhlp32.exe

        If i run the C:\>ZabbixW32.exe test check_myhttpd
        i get the following back.

        Using configuration file "C:\zabbix_agentd.conf"
        Configuration file OK
        [28-Oct-2006 21:12:46] *************** Log file opened ***************
        [28-Oct-2006 21:12:46] Collector thread initialized successfully
        check_myhttpd [ZBX_NOTSUPPORTED]

        C:\>

        Comment

        Working...