Signed-off-by: Andy Witter <awitter@georgialibraries.org>
--- /dev/null
+#!/bin/sh
+
+# Author : Dave Brown, Sys Admin, ESI
+# Last Updated : July 7, 2009
+# Purpose : Check status of file name and process from CL variables.
+# Usage : simple.sh <filename> <process>
+
+
+scriptname=$0
+filetocheck=$1
+proctocheck=$2
+
+if [ -f $filetocheck ]; then
+ if [ "$(ps aux | grep -i $proctocheck | grep -v grep | grep -v $scriptname | wc -l)" -gt 0 ]; then
+ echo "OK: $filetocheck exists and $proctocheck running"
+ exit 0
+ else
+ echo "CRIT: $filetocheck exists but $proctocheck not running"
+ exit 2
+ fi
+ else
+ echo "OK: $filetocheck not found"
+ exit 0
+ fi