![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Installing RedHat 8.0 onto Dell PowerEdge SC1425 - hdc: status error: status = 0x58 | fishsponge | Linux | 5 | 07-14-2006 11:53 AM |
| check the status and send an email with status | isingh786 | Shell Programming and Scripting | 3 | 12-29-2005 03:22 PM |
| Why am I not recieving email notification? | Kelam_Magnus | Post Here to Contact Site Administrators and Moderators | 6 | 09-03-2002 07:01 PM |
| Couldn't open status file /var/samba/STATUS.LCK | macdonto | UNIX for Dummies Questions & Answers | 2 | 08-08-2001 05:42 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
CPU status notification
i need a script which sends a mail when cpu is heavily loaded, for example ,
following is the output of the mpstat command, CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 160 38 0 156 72 1 235 70 234 122 0 88 17 7 0 76 161 35 0 145 226 172 78 62 263 108 0 262 15 7 0 77 162 35 0 180 110 65 31 74 247 95 0 227 15 6 0 79 163 34 0 119 55 2 248 76 219 88 0 195 15 5 0 80 192 39 0 150 37 196 261 76 105 245 0 102 18 5 0 77 193 34 0 187 64 65 211 79 200 83 0 181 15 5 0 80 194 35 0 132 51 1 200 88 193 81 0 186 15 5 0 80 195 34 0 134 182 1 180 88 185 79 0 161 14 4 0 81 if system idl percentage is less than 10 % , it should check which process is using more cpu using prstat command and send a mail indicating process which are consuming more resourses.... |
| Forum Sponsor | ||
|
|
|
|||
|
What have you tried so far..? This pseudo code might help you..
Code:
idle=`mpstat | awk '{print $10}' | tail -1`
if [$idle -lt 10]; then
echo "Warning"
echo "Further processing here"
else
echo "you are good to go"
fi
|
|||
| Google The UNIX and Linux Forums |