linux - Shell scripting for process count -


i need shell script display process counts in prod , pre-prod environments, excluding root user's processes. should send email if count exceeds 400.

how write this?

get count of processes , after that:

count=$(ps -efh | gawk '{ if(nr > 1){ print $1 }}' | grep -v 'root' | wc -l) if [ "$count" -gt 400 ];     # send emails fi 

Comments

Popular posts from this blog

xcode - CocoaPod Storyboard error: -

c# - AutoMapper - What's difference between Condition and PreCondition -