cancel
Showing results for 
Search instead for 
Did you mean: 

Long running or Hung jobs script

Sunny04
Level 3
Hi All,

We have 5 netbackup master server and more than 6000 clients configured in it. I am looking for a UNIX sccript that can identify the long running , hung jobs or jobs with very less throughput. Its very difficult to manually find the long running/hung jobs in all the master server. We are planning to automate through script. If any one is using any such scripts in their Backup environment please share. Thanks in ADVANCE.....
1 ACCEPTED SOLUTION

Accepted Solutions

Jacob
Level 4
We look for jobs running for more then 24 hours:
ALARM_TRESHOLD=84000
RUNTIME=0
bpdbjobs -most_columns | awk -F "," ' $3 ~ /^1$/ { print } ' |  awk -F "," ' $2 ~ /^0$/ { print } '  | awk -F "," '{ print $1, $3, $6, $7, $10 }' | while read  PID STATE SCHEDULE CLIENT RUNTIME
do
 if [ RUNTIME -gt ALARM_TRESHOLD ]
  then
     echo "Job ${PID} ${CLIENT} ${SCHEDULE} runtime is ${RUNTIME}. It's exceeded runtime treshold of ${ALARM_TRESHOLD} "
   fi
done
It is just a question of finding the collumn in bpdbjobs which contain the write speed and compare it with your treshold. I hope you can use that.

BR, Jacob

View solution in original post

3 REPLIES 3

Jacob
Level 4
We look for jobs running for more then 24 hours:
ALARM_TRESHOLD=84000
RUNTIME=0
bpdbjobs -most_columns | awk -F "," ' $3 ~ /^1$/ { print } ' |  awk -F "," ' $2 ~ /^0$/ { print } '  | awk -F "," '{ print $1, $3, $6, $7, $10 }' | while read  PID STATE SCHEDULE CLIENT RUNTIME
do
 if [ RUNTIME -gt ALARM_TRESHOLD ]
  then
     echo "Job ${PID} ${CLIENT} ${SCHEDULE} runtime is ${RUNTIME}. It's exceeded runtime treshold of ${ALARM_TRESHOLD} "
   fi
done
It is just a question of finding the collumn in bpdbjobs which contain the write speed and compare it with your treshold. I hope you can use that.

BR, Jacob

Sunny04
Level 3
Hi Jacob,

Thanks for the quick response,
Your script really worked.... :)

I have added few more things based on the requirement and it really worked..!!!!!

In order to find the writing speed I have added column no. 35 and able to get the KB/Sec which I was looking for.


Thanks a lot once again.....
Moved:

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified