Skip to content

Instantly share code, notes, and snippets.

@nixjobin
Created November 20, 2014 20:53
Show Gist options
  • Save nixjobin/ac981edf86c87cef7f54 to your computer and use it in GitHub Desktop.
Save nixjobin/ac981edf86c87cef7f54 to your computer and use it in GitHub Desktop.
evault agent checker
#!/bin/bash
#Author:Jobin Joseph
#JobNix.in
# Script to Check Availability of Evault Agent on Linux Servers and restart if the service went down.
# logs wil be available at /var/log/messages
jemail=youremailid@example.com
ps aux|grep -v grep |grep buagent
if [ $? -ne 0 ] ; then
/etc/init.d/vvagent restart
echo "buagent was not running-restarted on server `hostname`" | mail -s "[INFO] buagent Restarted" $jemail
logger "buagent was not running-restarted"
else
echo "buagent is running properly"
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment