#!/bin/sh
#
# Event handler script for restarting the cypress server on the local machine
#
#
# What state is the search service in?
/usr/bin/printf "We enter" >> /usr/lib/nagios/plugins/sshd.log
yourdate=`date +%Y%m%d%H%M%S`
case "$1" in
OK)
# The service just came back up, so don't do anything...
/usr/bin/printf "check OK $yourdate \n" >> /usr/lib/nagios/plugins/sshd.log
;;
CRITICAL)
# Aha! The cypress service appears to have a problem - perhaps we should restart the server...
/usr/bin/printf " The cypress service appears to have a problem $yourdate \n " >> /usr/lib/nagios/plugins/sshd.log
service sshd restart
;;
esac
exit 0