<?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: shell programing in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-programing/m-p/2754165#M722196</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;  What I understood from ur question is, U wnat to get PID and user of the processes which are using more 80% of the CPU...Right?&lt;BR /&gt;The following script will list the processes which are using above 80% CPU. U can shrink or customize as per ur requirement.&lt;BR /&gt;&lt;BR /&gt;ps -ef |sed '1d'&amp;gt;pall;awk '{print $4}'&lt;PALL&gt;pcpu&lt;BR /&gt;for i in `cat pcpu`&lt;BR /&gt;do&lt;BR /&gt;if [ "$i" -gt 80 ];then&lt;BR /&gt;line &lt;PALL&gt;&lt;/PALL&gt;fi;sed '1d' pall&amp;gt;pallout;mv pallout pall&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best of luck&lt;BR /&gt;Shahul&lt;/PALL&gt;</description>
    <pubDate>Fri, 28 Jun 2002 11:49:44 GMT</pubDate>
    <dc:creator>Shahul</dc:creator>
    <dc:date>2002-06-28T11:49:44Z</dc:date>
    <item>
      <title>shell programing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-programing/m-p/2754162#M722193</link>
      <description>As it could detect pid of a process that is called "myprocess" of the user "myuser", who takes more than 24 hours in march and that consumes more of 80% of CPU during 60 minutes? &lt;BR /&gt;&lt;BR /&gt;  Thanks !!</description>
      <pubDate>Fri, 28 Jun 2002 07:52:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-programing/m-p/2754162#M722193</guid>
      <dc:creator>TOMAS BERNABEU</dc:creator>
      <dc:date>2002-06-28T07:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: shell programing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-programing/m-p/2754163#M722194</link>
      <description>&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Not quite clear to me what you are after.&lt;BR /&gt;I think you will have to explain a bit&lt;BR /&gt;more what your problem is.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Olav</description>
      <pubDate>Fri, 28 Jun 2002 08:18:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-programing/m-p/2754163#M722194</guid>
      <dc:creator>Olav Baadsvik</dc:creator>
      <dc:date>2002-06-28T08:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: shell programing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-programing/m-p/2754164#M722195</link>
      <description>Hi Tomas,&lt;BR /&gt;&lt;BR /&gt;Your description sounds like you need simply a software product which allready exists:&lt;BR /&gt;&lt;BR /&gt;lsof&lt;BR /&gt;&lt;BR /&gt;You can download it here:&lt;BR /&gt;&lt;BR /&gt;javascript&amp;amp;colon;openExternal('&lt;A href="http://gatekeep.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.61/')" target="_blank"&gt;http://gatekeep.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.61/')&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright side of life!&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Fri, 28 Jun 2002 09:38:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-programing/m-p/2754164#M722195</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-06-28T09:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: shell programing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-programing/m-p/2754165#M722196</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;  What I understood from ur question is, U wnat to get PID and user of the processes which are using more 80% of the CPU...Right?&lt;BR /&gt;The following script will list the processes which are using above 80% CPU. U can shrink or customize as per ur requirement.&lt;BR /&gt;&lt;BR /&gt;ps -ef |sed '1d'&amp;gt;pall;awk '{print $4}'&lt;PALL&gt;pcpu&lt;BR /&gt;for i in `cat pcpu`&lt;BR /&gt;do&lt;BR /&gt;if [ "$i" -gt 80 ];then&lt;BR /&gt;line &lt;PALL&gt;&lt;/PALL&gt;fi;sed '1d' pall&amp;gt;pallout;mv pallout pall&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best of luck&lt;BR /&gt;Shahul&lt;/PALL&gt;</description>
      <pubDate>Fri, 28 Jun 2002 11:49:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-programing/m-p/2754165#M722196</guid>
      <dc:creator>Shahul</dc:creator>
      <dc:date>2002-06-28T11:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: shell programing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-programing/m-p/2754166#M722197</link>
      <description>Tomas:&lt;BR /&gt;&lt;BR /&gt;MeasureWare is great for alarming on misbehaving processes.  If you have the MeasureWare collection daemon scopeux running, you could place an alarm in /var/opt/perf/alarmdef that can run a progam when a process exceeds the thresholds you write into the alarm.  You can find examples in /opt/perf/examples.  You can loop through per-process data scanning for processes that have PROC_CPU_TOTAL_UTIL greater than 80% for 60 minutes. If you do not have GlancePlus Pak, you can install trial software from your application CDs to give it a whirl.&lt;BR /&gt;&lt;BR /&gt;Just keep in mind that alarming on a process running for more than 24 hours may be a little difficult (you would have to specify accumulated CPU time instead of linear start/stop times).  Maybe PROC_CPU_TOTAL_TIME_CUM greater than 86400 seconds (24hours of execute time -- you might want a smaller number).&lt;BR /&gt;&lt;BR /&gt;-dlt-</description>
      <pubDate>Tue, 02 Jul 2002 15:15:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-programing/m-p/2754166#M722197</guid>
      <dc:creator>David Totsch</dc:creator>
      <dc:date>2002-07-02T15:15:16Z</dc:date>
    </item>
  </channel>
</rss>

