Ad Widget

Collapse

Apache Monitoring Script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mmidgett
    Junior Member
    • Aug 2012
    • 14

    #1

    Apache Monitoring Script

    Using this method 2 I have it working for all of my servers but one.

    I am using this article http://www.zabbix.com/wiki/templates/apache to monitor Apache on a Ubuntu Server.

    I have one special server that I have to run the server-status page on a non standard port of 8082

    I can get the status page to display in my browser so I know the page is on the non standard port.

    I have created a copy of the template to only be assigned to this one server.

    In Zabbix I need to have it do the web check on this port of 8082. Can someone help me with this?
  • raoul
    Junior Member
    • Nov 2011
    • 29

    #2
    Hi,

    You should use a Web test (Configuration -> Web), declaring in the Step your test URL (http://your_server:8082/your_page.html)

    Then you can setup a trigger based on the result of this web test.

    (see WEB Monitoring in Zabbix Manual)

    Cheers,

    y/

    Comment

    • mmidgett
      Junior Member
      • Aug 2012
      • 14

      #3
      I maybe no understanding why I'm setting up a trigger to see if apache is running. I don't want to see if apache is running. I want to get the statistics from www.url.domain.tld:8082/server-status into my graphs. The default connector for method 2 is over 80. I have port 80 doing a redirect to 443 on the base url of the server. So I can't let the script go to url.domain.tld/server-status

      Can't I just change # Setup connection string
      ConnectionString = ("http://%s:%s%s") % (WebServer, Port, URL)
      to

      # Setup connection string
      ConnectionString = ("http://url.domain.tld:8082") % (WebServer, Port, URL)

      ############### Function to fire off an HTTP request to the web server, throw an exception gracefully
      ############### and print FAIL if a connection can't be made
      def getURL(WebServer,Port,URL):
      try:
      # Setup connection string
      ConnectionString = ("http://%s:%s%s") % (WebServer, Port, URL)

      conn = urllib.urlopen(ConnectionString)
      URLresponse = conn.read()

      # Clean up the connection
      conn.close()

      # The response to the function is the output of the URL called
      return URLresponse

      # Catch all exceptions
      except:
      print "Error getting URL"
      Last edited by mmidgett; 28-08-2012, 17:06.

      Comment

      • mmidgett
        Junior Member
        • Aug 2012
        • 14

        #4
        can somebody help?

        Comment

        Working...