PHP Server Monitor

PHP Server Monitor is a script that checks whether the servers on your list are up and running on the selected ports. It comes with a web based user interface where you can add and remove servers or websites from the MySQL database, and you can manage users for each server with a mobile number and email address.
With version 2.0 there’s the support for websites as well. On the “Add server” page, you can choose whether it’s a “service” or a “website”:
  • service
    A connection will be made to the entered ip or domain, on the given port. This way you can check if certain

    services on your machine are still running. To check your IMAP service for example, enter port 143.

  • website
    The previous version only tried to establish a connection to the server on port 80. If you are running multiple websites on 1 machine, there was no proper way to check each website for possible errors. Also it was impossible to make sure your site was really up and running, all you knew was that the server was still online.
    This function takes care of that.
    You can enter a link to a website (for example http://sourceforge.net/index.php), it will use cURL to open the website and check the HTTP status code (see http://en.wikipedia.org/wiki/List_of_HTTP_status_codes for details). If the HTTP status code is in the 4xx or 5xx range, it means an error occured and the website is not accesible to the public.

    In that case the script will return a “status offline”, and will start sending out notifications.

Each server has it’s own settings regarding notification.
You can choose for email notification or text message (SMS). As of version 2.0.1, there are 4 gateways

available:

  • Mollie – http://www.mollie.nl
  • Spryng – http://www.spryng.nl
  • Inetworx – http://www.inetworx.ch
  • Clickatell – http://www.clickatell.com
For these gateways you need an account with sufficient credits. If logging is enabled in the configuration, it will log any connection errors, emails and text messages sent.
The latest log records will be displayed on your web interface.
The cron/status.cron.php can be added as a cronjob which will keep the server status up to date.
I’d appreciate any feedback you might have regarding this script. Please leave it on the sourceforge project page (tracker), or send me an email (“Contact” at the top of the page).

Please see http://phpservermon.sourceforge.net for more details.

Support This Project

  • #1 written by Erik Plouvier
    about 1 year ago

    Pepijn,

    prachtig script, heb het deze morgen opgezet om 2 servers te monitoren en het werkt perfect.
    Bestaat er een mogelijkheid om de log file op te ruimen?

    Mvg

    Erik

  • #2 written by domger
    about 11 months ago


    Erik Plouvier:

    Pepijn,
    prachtig script, heb het deze morgen opgezet om 2 servers te monitoren en het werkt perfect.
    Bestaat er een mogelijkheid om de log file op te ruimen?
    Mvg
    Erik

    if you are on a linux box: make use of logrotate
    http://linuxcommand.org/man_pages/logrotate8.html

*

No trackbacks yet.