Hi all <br><br>I have updated this script to fix Andrey's reported bug.<br>I have also added an option to use sar for calculating %Idle, after Nick reminded me that top is not part of a standard install.<br><br>Regards<br>
Vernon<br><br><div class="gmail_quote">On 2 March 2013 20:08, Vernon Everett <span dir="ltr"><<a href="mailto:everett.vernon@gmail.com" target="_blank">everett.vernon@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
A good catch, and something I didn't consider.<br>All our databases instances have very different names, so the scenario you describe just never occurred to me.<br>I will have a look at fixing this one when I get back to the office on Tuesday. (Monday is a public holiday here)<br>

However, if anybody wants to suggest a fix, or even update the code, go for it.<br><br>Regards<br>Vernon<div class="HOEnZb"><div class="h5"><br><br><br><div class="gmail_quote">On 2 March 2013 17:14, Andrey Chervonets <span dir="ltr"><<a href="mailto:a.chervonets@cominder.eu" target="_blank">a.chervonets@cominder.eu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Good news.<br>
<br>
Had reviewed the script. There may be one problem in that lines:<br>
--<br>
   for PROC in $(ps -efa | grep $DB | awk '{ print $2 }')<br>
--<br>
You do just grep, but imagine there may be instances like:<br>
MYDB<br>
MYDB1<br>
MYDB12<br>
or NOMYDB<br>
So it will count MYDB numbers for MYDB1, MYDB12 and NOMYDB too<br>
<br>
We should make grepping more intelligent, because oracle processes may be listed like:<br>
 ora_j000_MYDB<br>
oracleMYDB (LOCAL=NO)<br>
 ora_ckpt_MYDB<br>
and so on<br>
<br>
<br>
Best regards,<br>
<br>
Andrey Chervonets<br>
----------------------<br>
CoMinder Ltd.<br>
<a href="http://www.cominder.eu/" target="_blank">http://www.cominder.eu/</a><br>
Mobile: <a href="tel:%2B371%2026517848" value="+37126517848" target="_blank">+371 26517848</a><br>
Fax: <a href="tel:%2B371%2066066346" value="+37166066346" target="_blank">+371 66066346</a><br>
<br>
<br>
<br>
On 01.03.2013 13:00, <a href="mailto:xymon-request@xymon.com" target="_blank">xymon-request@xymon.com</a> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Message: 10<br>
Date: Fri, 1 Mar 2013 14:40:58 +0800<br>
From: Vernon Everett<<a href="mailto:everett.vernon@gmail.com" target="_blank">everett.vernon@gmail.<u></u>com</a>><br>
To: Xymon mailinglist<<a href="mailto:xymon@xymon.com" target="_blank">xymon@xymon.com</a>><br>
Subject: [Xymon] New monitoring script on Xmonton<br>
Message-ID:<br>
        <<a href="mailto:CAGo4kcYUaYJ8TSjrs4xf7pNzptsB3vk3B5omLAae_M-2jtWokg@mail.gmail.com" target="_blank">CAGo4kcYUaYJ8TSjrs4xf7pNzptsB<u></u>3vk3B5omLAae_M-2jtWokg@mail.<u></u>gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi all<br>
<br>
I have just put something together to monitor Oracle database CPU usage.<br>
<a href="http://www.xymonton.org/monitors:db_cpu.ksh" target="_blank">http://www.xymonton.org/<u></u>monitors:db_cpu.ksh</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com" target="_blank">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/<u></u>mailman/listinfo/xymon</a><br>
</blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><span>"Accept the challenges so that you can feel the exhilaration of victory"</span><div><span>- General George Patton</span></div>

</font></span></blockquote></div><br><br clear="all"><br>-- <br><span>"Accept the challenges so that you can feel the exhilaration of victory"</span><div><span>- General George Patton</span></div>