webping is a tiny utility to check availability of remote web pages. It produces an HTML report to show results. It can send mails alerts when a page can't be reached. It also search for a given string in the page and calculate page response time.
This is basically a stupid and simple script. It was created at EDF for the very specific needs of the internal intranet team but can be used in other contexts.
This how-to is designed around our current internal use of webping. Don't forget to adapt it to you needs and your environment.
Install required system packages.
On RHEL 5.x:
$ sudo yum install git gcc sqlite-devel python-devel
On Ubuntu 11.04:
$ sudo apt-get install git gcc libsqlite3-dev python-dev
Check out the latest version of webping from GitHub:
$ cd /var/www
$ git clone git://github.com/kdeldycke/webping.git
Fix rights and ownership (quick and dirty):
$ chmod -R 755 ./webping
$ chown -R www-data:www-data ./webping
Initialize the buildout environment:
$ su - www-data
$ cd /var/www/webping
$ python ./bootstrap.py --distribute
Run buildout itself:
$ ./bin/buildout
Setup the cron file:
$ sudo echo "*/10 * * * * www-data /var/www/webping/bin/webping" > /etc/cron.d/webping
Register webping's specific web configuration to your Apache server:
$ ln -s /var/www/webping/apache.conf /etc/apache/conf.d/
$ /etc/init.d/apache stop
$ /etc/init.d/apache start
Eventually change webping config file to match your needs:
$ vi /var/www/webping/webping.conf
webping is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
For full details, please see the file named COPYING in the top directory of the source tree. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
webping uses external softwares, scripts, libraries and artworks:
jQuery JavaScript Library v1.3.2
Copyright (c) 2009 John Resig
Dual licensed under the MIT and GPL licenses.
Source: http://jquery.com
jQuery.Flot plugin v0.6
Copyright (c) 2007-2009 IOLA and Ole Laursen
Released under the MIT license.
Source: http://code.google.com/p/flot
jQuery.cuteTime plugin v1.1.1
Copyright (c) 2009 Jeremy Horn <[email protected]>, http://tpgblog.com
Dual licensed under MIT and GPL.
Source: http://tpgblog.com/cutetime
ExplorerCanvas
Copyright (c) 2006 Google Inc.
Released under the Apache License 2.0.
Source: http://code.google.com/p/explorercanvas
Crystal Project Icons
Copyright (c) 2006-2007, Everaldo Coelho <[email protected]>, http://www.everaldo.com
Released under the LGPL license.
Source: http://www.kde-look.org/content/show.php/Crystal+Project?content=60475
Buildout's bootstrap.py
Copyright (c) 2006 Zope Corporation and Contributors
Distributed under the Zope Public License, version 2.1 (ZPL).
Source: http://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap/bootstrap.py