<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CPU Usage Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251860#M658652</link>
    <description>Sial,&lt;BR /&gt;&lt;BR /&gt;from sar output you can get email alert if cpu usage is more than 80% , you need have a script with loop, or may be using cron ,&lt;BR /&gt;&lt;BR /&gt;# sar -u 5 20&lt;BR /&gt;- grep the cpu usage field&lt;BR /&gt;- using awk '{ if ( $NF &amp;gt; 80 ) print $0 }' &amp;gt;&amp;gt; logfile, analyse the log file again with a condition and if it is greater than 80 for sometime then send email, else OK.&lt;BR /&gt;&lt;BR /&gt;That logic could be use , &lt;BR /&gt;&lt;BR /&gt;Hth,&lt;BR /&gt;Raj.</description>
    <pubDate>Tue, 17 Aug 2010 10:07:01 GMT</pubDate>
    <dc:creator>Raj D.</dc:creator>
    <dc:date>2010-08-17T10:07:01Z</dc:date>
    <item>
      <title>CPU Usage Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251852#M658644</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;can someone help me to find the script which will help me to monitor cpu usage for HP-UX 11.31 &amp;amp; 11.23, and if the usages go above 80% I will get a email atomically.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Tue, 17 Aug 2010 05:53:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251852#M658644</guid>
      <dc:creator>Sial_1</dc:creator>
      <dc:date>2010-08-17T05:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: CPU Usage Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251853#M658645</link>
      <description>What tool is going to measure the CPU usage, top?  And you only want the average of all N CPUs?</description>
      <pubDate>Tue, 17 Aug 2010 06:23:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251853#M658645</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-08-17T06:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: CPU Usage Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251854#M658646</link>
      <description>Yes we can use top, and average of all CPUs.</description>
      <pubDate>Tue, 17 Aug 2010 06:51:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251854#M658646</guid>
      <dc:creator>Sial_1</dc:creator>
      <dc:date>2010-08-17T06:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: CPU Usage Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251855#M658647</link>
      <description>You can start with:&lt;BR /&gt;$ top -f /var/tmp/top.out -n 100 -d 1&lt;BR /&gt;$ awk '/^avg/ { print 100 - $6; exit}' /var/tmp/top.out&lt;BR /&gt;&lt;BR /&gt;This prints the average % CPU utilization.</description>
      <pubDate>Tue, 17 Aug 2010 07:11:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251855#M658647</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-08-17T07:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: CPU Usage Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251856#M658648</link>
      <description>Dennis&lt;BR /&gt;&lt;BR /&gt;Need script that sends me an email if CPUs average usage goes above 80%.</description>
      <pubDate>Tue, 17 Aug 2010 07:36:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251856#M658648</guid>
      <dc:creator>Sial_1</dc:creator>
      <dc:date>2010-08-17T07:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: CPU Usage Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251857#M658649</link>
      <description>Sial,&lt;BR /&gt;Check this out: cpumem.sh &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums13.itrc.hp.com/service/forums/questionanswer.do?&amp;amp;threadId=1037077" target="_blank"&gt;http://forums13.itrc.hp.com/service/forums/questionanswer.do?&amp;amp;threadId=1037077&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I havce a latest version of it also , for v2 and v3, just try that out. It works with glance ,and keeps a log of cpu/mem/diskio ..,&lt;BR /&gt;&lt;BR /&gt;How ever if you have implemented OVO , that will send cpu threshold alert.&lt;BR /&gt;&lt;BR /&gt;Hth,&lt;BR /&gt;Raj. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Aug 2010 07:42:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251857#M658649</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2010-08-17T07:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: CPU Usage Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251858#M658650</link>
      <description>Thanks Raj, cpumem.sh only creates log file that has cpu and mem average%. But I need script that sends me an email if my systemâ  s CPUs usage average touches 70%.&lt;BR /&gt;&lt;BR /&gt;Rgd,</description>
      <pubDate>Tue, 17 Aug 2010 08:56:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251858#M658650</guid>
      <dc:creator>Sial_1</dc:creator>
      <dc:date>2010-08-17T08:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: CPU Usage Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251859#M658651</link>
      <description>Why not use sar for information collection and running a script from cron that checks if the CPU usage gets too high ?</description>
      <pubDate>Tue, 17 Aug 2010 09:56:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251859#M658651</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2010-08-17T09:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: CPU Usage Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251860#M658652</link>
      <description>Sial,&lt;BR /&gt;&lt;BR /&gt;from sar output you can get email alert if cpu usage is more than 80% , you need have a script with loop, or may be using cron ,&lt;BR /&gt;&lt;BR /&gt;# sar -u 5 20&lt;BR /&gt;- grep the cpu usage field&lt;BR /&gt;- using awk '{ if ( $NF &amp;gt; 80 ) print $0 }' &amp;gt;&amp;gt; logfile, analyse the log file again with a condition and if it is greater than 80 for sometime then send email, else OK.&lt;BR /&gt;&lt;BR /&gt;That logic could be use , &lt;BR /&gt;&lt;BR /&gt;Hth,&lt;BR /&gt;Raj.</description>
      <pubDate>Tue, 17 Aug 2010 10:07:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251860#M658652</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2010-08-17T10:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: CPU Usage Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251861#M658653</link>
      <description>Ok, can you help me to write a script using sar?</description>
      <pubDate>Tue, 17 Aug 2010 10:24:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251861#M658653</guid>
      <dc:creator>Sial_1</dc:creator>
      <dc:date>2010-08-17T10:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: CPU Usage Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251862#M658654</link>
      <description>Sial,&lt;BR /&gt;&lt;BR /&gt;check this out:&lt;BR /&gt;You can put the script in cron in 5 min interval , so that it will check every 5 min.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;## Script to check cpu usage if reached 80% .  cpu_alert_80_email.sc [v1]  08-18-2010&lt;BR /&gt;## Checks every 30 second per script execution. &lt;BR /&gt;######################################################################################################&lt;BR /&gt;HOST=`hostname`&lt;BR /&gt;sar -u 3 10 | grep -v idle | grep -v `hostname` |awk '{if ($NF&amp;lt;20) print $0 }'| awk /./ &amp;gt; result&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if [ -s result ]&lt;BR /&gt;then&lt;BR /&gt;#result nonZero: Alert!! and Email:&lt;BR /&gt;echo "\n\n------------------------------------------------------------------------"&lt;BR /&gt;echo "ALERT!!!! CPU  threshold reached and more than 80%"&lt;BR /&gt;echo "------------------------------------------------------------------------\n"&lt;BR /&gt;echo "Current cpu usage : "&lt;BR /&gt;echo "$HOST       %usr     %sys     %wio    %idle" &amp;gt;&amp;gt; result&lt;BR /&gt;echo "------------------------------------------------------------------------\n" &amp;gt;&amp;gt; result ; cat result&lt;BR /&gt;echo "Sending Email Alert........"&lt;BR /&gt;#cat result | mailx -s "CPU usage reached threshold: 80% on $HOST " youremail@domain.com&lt;BR /&gt;&lt;BR /&gt;else&lt;BR /&gt;echo "Threshold not reached.  [OK] "&lt;BR /&gt;ls -l result&lt;BR /&gt;fi&lt;BR /&gt;########################################################################################################&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ ./cpu_alert_80_email.sc&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------------------------------------------------&lt;BR /&gt;ALERT!!!! CPU  threshold reached and more than 80%&lt;BR /&gt;------------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Current cpu usage :&lt;BR /&gt;22:03:23      92       2       4       2&lt;BR /&gt;22:03:25      90       2       4       4&lt;BR /&gt;Average       91       2       4       3&lt;BR /&gt;hpux1120      %usr     %sys     %wio    %idle&lt;BR /&gt;------------------------------------------------------------------------&lt;BR /&gt;Sending Email Alert........&lt;BR /&gt;&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;Raj.</description>
      <pubDate>Thu, 19 Aug 2010 04:10:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251862#M658654</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2010-08-19T04:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: CPU Usage Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251863#M658655</link>
      <description>Thanks Raj &amp;amp; Dennis for your assistance.</description>
      <pubDate>Thu, 26 Aug 2010 05:58:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cpu-usage-script/m-p/5251863#M658655</guid>
      <dc:creator>Sial_1</dc:creator>
      <dc:date>2010-08-26T05:58:57Z</dc:date>
    </item>
  </channel>
</rss>

