Ad Widget

Collapse

http requests by zabbix_server possible ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Arthur
    Member
    • May 2006
    • 31

    #1

    http requests by zabbix_server possible ?

    Is there a way to use the zabbix_server to request a webpage and use the result page, grep a value and handle it as a Item ?

    I have to monitor the nof rows found in a query,
    I can do the query and retur the result using the webserver on the host

    any idee ?
  • cptnzod
    Member
    • Jan 2007
    • 56

    #2
    User userParameter in zabbix_agentd.conf:
    UserParameter=runtime1.test,/usr/local/bin/server-status.sh runtime1
    runtime1.test is just a name
    /usr/local/bin/... is the script
    runtime1 is the hostname that I pass to this script.

    Here is my script:
    /usr/bin/wget -t 1 --delete-after http://$1.mydomain.com/server-status 2>&1 | grep "200 OK" > /dev/null
    if [ $? -gt 0 ];then
    echo 0
    exit 1
    else
    echo 1
    exit 0
    fi

    Then I can make a trigger based on runtime1.test and if I get a 1 I am okay otherwise trigger and alert me.

    You can use wget to get your custom query and parse the result the way you want it.

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #3
      Note that starting from 1.3.3 ZABBIX will support advanced monitoring of WEB applications. The functionality is already implemented.
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • cptnzod
        Member
        • Jan 2007
        • 56

        #4
        I tried the 1.3.2 beta on CentOS 4 and did not get anywhere. Support was not good on that either. So I just went to the older release and that installed just fine

        Comment

        • Arthur
          Member
          • May 2006
          • 31

          #5
          Up and running now

          Thx cptnzod,

          I saw the script in a other tread, and did the same setup.
          It first did not work aldo i followed the 1.1.3 (beta) docs
          and zabbix_agentd -t blabla did work correct.
          It returnd [t|38] .. i expected the 38 but could not find
          any docs on the [t|..] but if it show's this, then zabbix can read the
          value into its "Item"

          I used localhost / 127.0.0.1 as destination host
          Some one on (freenode) #zabbix adviced to test with zabbix_get
          This gave me some verbose messages about refuse to connect etc.

          Then i found in the zabbix_agentd.conf a setting to make the agentd
          listen on this nic.

          rgds
          /Arthur

          Comment

          Working...