High process count notification - shell script

#Author : Jaison
# Purpose : To send email to the user when a user hit a specific process count list.

process_count="$(ps -u root  -L | wc -l)"
if [ "$process_count" -gt "10000" ]; then
 Email_Body='Test"
  echo "$Email_Body" | /usr/bin/mail -s "Server $HOSTNAME Process Count : $process_count IS A LARGE VALUE FOR  USER. CHECK IMMEDIATELY. " <email_account>
fi

Comments

Popular posts from this blog

Logical volume vmxxxx_img is used by another device - Error on LVM removal

Open VZ cheat Sheet

Cheat sheet for Hardware RAID health check - Megaraid, Adaptec, 3wareraid and HPraid.