#!/bin/sh
PROGNAME=`basename ${0}`
Process=`echo $1` # the process to look for
MonitorName=$2 # ITO monitored object name
tmpNumProcs=`ps -ef | grep "${Process}" | \
grep -v ${PROGNAME} | grep -v grep | wc -l`
NumProcs=`echo ${tmpNumProcs}`
opcmon ${MonitorName}=${NumProcs}
exit $?
Comments
You can follow this conversation by subscribing to the comment feed for this post.