We want a Shell script to notify us when a particular background process reaches a certain threshold.
top of page
To see this working, head to your live site.
Shell script to notify us when a particular background process reaches a certain threshold
Shell script to notify us when a particular background process reaches a certain threshold
1 answer0 replies
Like
1 Comment
bottom of page
Script
#!/bin/bash # Syntax to run this script # ./running_process.sh oracle 100 170 # ./running_process.sh PROCESS_NAME WARNING CRITICAL export MAILIST='dba@dbagenesis.com, process_name=$1 _limit1=$2 _limit2=$3 _proc=`ps -ef | grep $process_name | wc -l` if [ "$_proc" -ge "$_limit2" ] then echo "Current Running $process_name Proccess is running too high $_proc " > /tmp/proc.log cat /tmp/proc.log cat /tmp/proc.log | mailx -s "${TODAY} - Current Running $process_name Proccess is running too high/Critical $_proc " ${MAILIST} else if [ "$_proc" -ge "$_limit1" ] then echo "Current Running $process_name Proccess is running more than expected $_proc " > /tmp/proc.log cat /tmp/proc.log cat /tmp/proc.log | mailx -s "${TODAY} - Current Running $process_name Proccess is running more than expected $_proc " ${MAILIST} fi fi