Ad Widget

Collapse

Application layer monitoring?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • darrellhyde
    Junior Member
    • Jun 2005
    • 2

    #1

    Application layer monitoring?

    Is it possible to have zabbix send an http request to a host it is monitoring, evaluate the output of the request, and then generate an alert condition for that server based on that output?

    The goal would be to monitor the availability of an application server like CF, Resin, etc that might crash or become non-operational while the underlying webserver (Apache, IIS, etc) might still be functional.

    Thanks!

    - Darrell
  • araw
    Member
    • May 2005
    • 31

    #2
    You can use UserParameters in zabbix_agentd.conf, or an external item script like my own.

    Comment

    • cadbury
      Member
      • Apr 2005
      • 77

      #3
      if i understood, what you want is :
      the zabbix server make the request, get the http response, evaluate something in this response to be sure that the application is running (a key word in the page for example), and if it is not good, send an alert.

      if this is what you want, here is what i would make :
      install agentd on the server (because the zabbix server can't run your own scripts).
      in zabbix_agentd.conf, make a UserParameter that call the script which will get the page and evaluate the response, something like this :
      UserParameter=check_appli,/etc/zabbix/name_of_your_script

      then add an item to the server, as an agentd item, with the same key : check_appli

      then you can make a trigger on this item to send alerts

      i had to get the outside temperature from a webpage, it is quite the same thing :

      Code:
      #!/bin/sh
      
      SUCCESS=0
      
      FILE=/etc/zabbix/temp_temper_html.tmp
      ERRORLOG=/etc/zabbix/temp_temper_html.error
      
      
      PSRES=`ps alx | egrep 'wget -t 2 -T 30 -O $FILE http://weather.noaa.gov/weather/current/LFLL.html' | wc -l`
      if [ $PSRES -ne 0 ] ; then
        echo `date` : script deja en marche >> $ERRORLOG
        exit 0
      fi
      
      wget -a $ERRORLOG -t 2 -T 30 -O $FILE http://weather.noaa.gov/weather/current/LFLL.html
      WGETRET=$?
      if [ $WGETRET -ne 0 ] ; then
        echo `date` : `whoami` : ERROR wget plante avec $WGETRET >> $ERRORLOG
        exit 1
      fi
      echo `date` : `whoami` : fichier recupere >> $ERRORLOG
      RES=`grep "F (" $FILE | head -n 1 | cut -d '(' -f 2 | cut -d ' ' -f 1`
      rm $FILE* 2>> $ERRORLOG
      test "$RES" -ne 0 -o "$RES" -eq 0
      if [ $? -ne "$SUCCESS" ] ; then
        echo `date` : `whoami` : ERROR temperature non disponible >> $ERRORLOG
        exit 1
      else
        echo `date` : temperature OK >> $ERRORLOG
        echo $RES
        exit $SUCCESS
      fi
      hope it can help you

      cadbury

      Comment

      • darrellhyde
        Junior Member
        • Jun 2005
        • 2

        #4
        That's exactly what I'd like to accomplish - thanks! I'll give this a shot and let you know how it goes.

        - Darrell

        Comment

        • sojeshj
          Junior Member
          • Apr 2005
          • 9

          #5
          Wat abt the script?

          Hi Dareell,

          Did this script help you?

          Thanks,
          Soj

          Comment

          • cepler
            Junior Member
            • May 2005
            • 5

            #6
            Think so..

            Looks like it'll do it, but we are always open for other ideas

            Comment

            Working...