#!/bin/sh

# name: sybmonitor.sh
# Author: Todd Boss
# purpose: Poor man's Sybase monitor...will run out of cron every 5 minutes
#   and check socket connection for supported sybase servers.

# date		author	purpose
# 8/14/97	T.Boss	creation (w/o mdb and syb_dicom_svr b/c they're down)

# Future: add multiple email recipients

for name in prod11 crimson prod crimson_dev peter new_crimson
do
   /export/syb_ops/misc/sybping.pl -S$name -I/export/sybase11/interfaces -v > /tmp/sybmon.$$

   if [ $? != 0 ]
   then
      mailx -s "$name server Down!" tboss@cc.nih.gov  < /tmp/sybmon.$$
   fi
   rm -rf /tmp/sybmon.$$
done