SAWDOG - Simple Active Watch-DOG Simple: less than 1000 lines of code Active: No need for daemons on the observed servers SAWDOG - A collection of simple scripts, which informs in case of server outages Copyright 1999-2006 by Christian Gloor, Max and Michi This piece of code is distributed under the terms of the GNU General Public License (GPL) You should have received a copy of the GPL (file COPYING) along with this script; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA Current maintainer: chgloor@digicomp.ch, don't hesitate to contact him if you have any questions. Changelog ========= Fall 1999: 1.0.0 initial - chgloor@digicomp.ch: initial release for internal use only May 2000: 1.2.0 - michi@digicomp.ch: changed for sms use only May 2000: 2.0.0 phoenix - chgloor: additional features (unknown state, logfile, locking) michi: additional expect scripts (icmp, smb) June 2000: 2.1.0 generic - chgloor: compact notification, one message per server aliases for long server names or ip addresses generic notification (can execute any binaries now) June 2000: 2.2.0 speedup - chgloor: speedup in the expect scripts 'required' freature Sept 2006: 2.4.0 webinterface - max/chgloor: added php-based web interface, code cleanup This is the README for Version 2.4.x ==================================== 1) Abstract This script was initially written by Christian Gloor. About half a year later, it was adapted for use at DIGICOMP AG, a IT education company located in switzerland. Sawdog consists of a script which informs the sysops of some mission critical servers in the case of a failure. The script executes a given set of small executables, i.e. expect scripts, and if one executable fails, sends an email or a sms to the sysop. 2) Installation The main script is sawdog.pl. It can be placed everywhere on the filesystem. At the moment, the only configuration is done in the sawdog.conf file. If you keep this file not in the current directory, you need to edit the sawdog.pl source file. All file locations are stored in the sawdog.pl file. You can use crontab to start sawdog.pl every 5 minutes. Sawdog creates a logfile: sawdog.log and a status file: sawdog.status, if they don't exist, sawdog recreates them. Of course sawdog needs write permissions on the working directory. There are some predefined expect scripts for some well known services: ftp, http, icmp, ssh, telnet, and smb. You can easily create your own expect scripts, or use any other executable which returns a return code of zero if it succeeds. Don't forget to contribute your aditions to the main code tree. Files needed: - sawdog.pl the main file - sawdog.conf the config file - services/ this directory is populated by the expect scripts Files recreated, if they don't exist: - sawdog.status in this file the internal state is keept - sawdog.log the logfile 3) Usage/Configuration See the postscript/pdf documentation on the website: open.digicomp.ch 4) To Do Create some more expect scripts for more ports. Build a nice package. Correct spelling and grammar errors in the readme files. Clean up the source (again)