#! /bin/bash
if [ ! -d /usr/sbin/r1soft ]; then
echo "CRITICAL: Server is not Configured to take R1soft Backup"
exit 2
fi
a=`sudo /etc/init.d/cdp-agent status | grep -o "not running"`
b="not running"
if [ "$a" == "$b" ]; then
echo "CDP Agent is not running "
exit 2
elif [ ! "$(sudo /sbin/lsmod |grep hcp)" ] ; then
echo "hcp driver not loaded into kernel"
exit 2
else
echo "OK: CDP Agent is running fine"
exit 0
fi