Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20598

Process count script

$
0
0

Trying create a alert/monitor from the following to work. I'm not a scripting person

 

count=`ps -ef|grep -c xxxx | grep -v grep`

 

if [ $count == 7 ] then

echo "$count"

 

else

echo "count is not 7"

 

fi

 

If I do a ps -ef|grep -c xxxx it comes back with the number 7.  If it comes back with something other than 7 I want it to display "count is not 7" and then ill trigger an alert

 

 

Thoughts?


Viewing all articles
Browse latest Browse all 20598

Trending Articles