Giter VIP home page Giter VIP logo

zabbix-apache-stats's Introduction

zabbix-apache-status

Overview

This program gathers data from Apache's built-in status page and sends it to Zabbix. The data is sent via the CLI tool zabbix_sender.

*** See http://www.zabbix.com/wiki/templates/apache for a detailed install guide ***

Author(s)

Install

Enable Apache server-status

  1. Add this to your Apache config file:

    <Location /server-status>
        SetHandler server-status
        Allow from 127.0.0.1
        Order deny,allow
        Deny from all
    </Location>
    ExtendedStatus On # Optional. Must be in global scope and not in a virtual host
  2. Restart/reload Apache or use ```kill -USR1 `cat /var/run/httpd.pid ```` for zero downtime

Configure Zabbix Server

  1. Import the template file Template_App_Apache_Status.xml into Zabbix
  2. Link the Template_App_Apache_Status template to the hosts to be monitored

Now continue with either Zabbix Agent Mode mode or Cron mode.

Zabbix Agent Mode Install

This method relies on your polling interval for an item called apache.status, and will honor any maintenance windows. The check will run on the host being monitored everytime time apache.status is polled. This item is defined as a UserParameter like this:

# returns a single integer, but uses zabbix_sender to populate trapper items
UserParameter=apache.status,/var/lib/zabbix/bin/check_apache --config /etc/zabbix_agentd.conf

Install on apache server to be monitored and connect to status page on localhost. Assumes zabbix-agent is installed.

  1. Copy bin/check_apache to , such as /var/lib/zabbix/bin/check_apache
  2. Run chmod +x on the file
  3. Copy conf/check_apache.conf to your zabbix agent include dir. Probably /etc/zabbix_agentd.conf.d/
  • Tip Check to make sure your include directory is enabled.

grep Include /etc/zabbix_agentd.conf

  1. Tip Make sure you have ServerActive and Hostname filled in your config file.
  2. Restart zabbix-agent.

Cron or Remote Mode Install

This method can run remotely or locally via cron. This method relies on your cron scheduler to set the polling interval, and is unaware of any maintenance windows.

Install on Zabbix server or the host to monitor:

  1. Copy bin/check_apache to , such as /usr/bin/check_apache
  2. Run chmod +x on the file
  3. Add this to crontab to run every minute: * * * * * /usr/bin/check_apache --zabbixsource myhostname -z myzabbixserver &> /dev/null
  4. Replace "myhostname" with the hostname (or name in the Zabbix GUI) of the host that the values should be stored with. Replace "myzqbbixserver" with the hostname/IP of your Zabbix server.

Repeat above cron lines to monitor multiple hosts. Use the -o option if these URL differs from the hostname.

Notes

License

GPLv2 - See LICENSE file

zabbix-apache-stats's People

Contributors

dlbewley avatar ericrisler avatar galindro avatar gpmidi avatar rogersk avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.