Vanilla Netrek Server Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [VANILLA-L] Monitoring server



Bob Tanner wrote:
> This may sound like overkill, but is there any way to automatically
> monitor the server to make sure it is up and running?

Here are the two tricks I use ...

1) a crontab triggered csh script that checks to see the newstartd
process is present, and if not, starts it again,

2) a program called pung, which makes a connection to any nominated
TCP/IP server port to prove the connection can be made.

Files attached.  The second file is from Digital UNIX, and you may have
to re-implement it on your system due to copyright.  The crontab entries
I have are ...

00 05 * * * csh -t%~/nightly>&nightly.log
50 11 * * 1-5 csh -t%~/nightly>&nightly.log

The pung program can be tied into a script that will make a connection
attempt, and if it fails restart the server process and try again.


-- 
James Cameron                                    (cameron@stl.dec.com)
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800
#!/bin/csh
set pid=`getpid newstartd -ucameron`
if ( "X$pid" == "X" ) then
    cd ~/nt/server/alpha
    newstartd>&newstartd.log &
endif
#!/bin/sh
# *****************************************************************
# *                                                               *
# *    Copyright (c) Digital Equipment Corporation, 1991, 1995    *
# *                                                               *
# *   All Rights Reserved.  Unpublished rights  reserved  under   *
# *   the copyright laws of the United States.                    *
# *                                                               *
# *   The software contained on this media  is  proprietary  to   *
# *   and  embodies  the  confidential  technology  of  Digital   *
# *   Equipment Corporation.  Possession, use,  duplication  or   *
# *   dissemination of the software and media is authorized only  *
# *   pursuant to a valid written license from Digital Equipment  *
# *   Corporation.                                                *
# *                                                               *
# *   RESTRICTED RIGHTS LEGEND   Use, duplication, or disclosure  *
# *   by the U.S. Government is subject to restrictions  as  set  *
# *   forth in Subparagraph (c)(1)(ii)  of  DFARS  252.227-7013,  *
# *   or  in  FAR 52.227-19, as applicable.                       *
# *                                                               *
# *****************************************************************
# @(#)$RCSfile: getpid.sh,v $ $Revision: 1.1.2.2 $ (DEC) $Date: 1994/08/29 19:19:18 $

if [ -n "$1" ]
then
	GETMYPID=$1
	shift 
	/bin/ps -e -o pid,command $* | awk -v Prog=$GETMYPID '{ if ($2 == Prog) {
								  print $1
								  exit
								}
							      }'
fi

pung.tar.gz


References: