October 21, 2010

Process Monitoring in OMU

Use the following script to do process monitoring of managed node from OMU -

To use the script, create a measurement threshold policy and write program name as : "script_name" "monitor_name" "process_name"

and put threshold 1 for not running condition and threshold 0 for running condition.

###ENV##

MON_NAME=$1
OPCMON="/opt/OV/bin/OpC/opcmon";
OPTION="-option proc"
CMD="/usr/bin/ps"
PROCESS=$2
PROGNAME=`basename $0`
###ENV#

OBJECT=""
#############################################Find whether file exists####

CMD_OUTPUT=`$CMD -ef | grep $PROCESS | grep -v grep | wc -l`
if [ ${CMD_OUTPUT} -eq 0 ]
then
STATUS=1;
else
STATUS=0;
fi
$OPCMON $MON_NAME=$STATUS

exit

No comments:

Post a Comment