Giter Club home page Giter Club logo

apache-status-monitor's Introduction

Apache status monitor (PHP, CRON, Email)

This is a simple PHP script that can be installed as a CRON job to send notifiction every time Apache is down and send notification to your email. It should work on Debian-like distros (Ubuntu, Mint etc.)

The script can be easily adjusted to any service and any linux.

Installation

Clone repo and install dependencies via Composer

$ composer install

Copy .env file and edit your SMTP details 

$ cp .env.example .env
$ nano .env

Test run

$ php index.php

Add CRON job

First, find out which PHP you are using

$ which php
// ie. /usr/bin/php

Then add a CRON job

$ crontab -e

Add line to run every 5 minutes

*/5 * * * * /usr/bin/php /path_to_apache-monitor/index.php > /dev/null 2>&1
# For debugging:
# */1 * * * * /usr/bin/php /path_to_apache-monitor/index.php >> /path_to_apache-monitor/log.txt

apache-status-monitor's People

Contributors

srokatonie avatar

Watchers

 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.