<?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: process monitoring script help... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635728#M676347</link>
    <description>Hi (again) Sekar:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; oh, i am thinking that as usual i am with hpux, but this project alone we run with sun solaris 5.10 that could be an issue?&lt;BR /&gt;&lt;BR /&gt;Yes, indeed.  I don't have a Sun server but I can tell you that the '-C' option doesn't exist on AIX, for example.&lt;BR /&gt;&lt;BR /&gt;If you must resort to a 'grep' to find if a process is running or not, make the potential match less fuzzy then a simple 'grep' for a name.  You can do things like:&lt;BR /&gt;&lt;BR /&gt;# ps -e|grep syslogd$&lt;BR /&gt;&lt;BR /&gt;or:&lt;BR /&gt;&lt;BR /&gt;# ps -e|awk '$4=="syslogd"'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 24 May 2010 14:02:33 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2010-05-24T14:02:33Z</dc:date>
    <item>
      <title>process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635711#M676330</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;we are already doing process monitoring with a simple script:&lt;BR /&gt;for i in `cat process.list`&lt;BR /&gt;do&lt;BR /&gt;Count=`ps -ef | grep -i $i | grep -v grep | wc -l`&lt;BR /&gt;if count equal to zero&lt;BR /&gt;mail a b c&lt;BR /&gt;&lt;BR /&gt;but it got two interesting issues:&lt;BR /&gt;1. the process list is big one...so if ten processes are down, we get ten mails.&lt;BR /&gt;i am thinking that we should get only one mail with all process that are not running.&lt;BR /&gt;2. after a process went down, when it comes back, we should get an email saying process is running fine. we may get process down alerts many times but "process running" should be only once -ie, after process comes up from process down.&lt;BR /&gt;&lt;BR /&gt;since its a bit complex scripting issue, i would like ask ur ideas...&lt;BR /&gt;&lt;BR /&gt;thanks many...&lt;BR /&gt;Regards,&lt;BR /&gt;Sekar</description>
      <pubDate>Sat, 22 May 2010 20:12:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635711#M676330</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2010-05-22T20:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635712#M676331</link>
      <description>HI:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; i am thinking that we should get only one mail with all process that are not running.&lt;BR /&gt;&lt;BR /&gt;Then as you loop through the list of processes that you want to check, capture the names of the ones that aren't running in a variable of your choice and reference that in a email.  If the variable is empty; then there's no mail to send.&lt;BR /&gt;&lt;BR /&gt;Since you appear to be looking for process's by name, don't 'grep' but use the UNIX95 (XPG4) behavior to specifically find a process by name.  Hence, for your driving loop you might do:&lt;BR /&gt;&lt;BR /&gt;DOWN=""&lt;BR /&gt;for PROC in $(&lt;PROCESS.LIST&gt;&lt;/PROCESS.LIST&gt;do&lt;BR /&gt;    [ -z "$(UNIX95= ps -C ${PROC} -opid=)" ] &amp;amp;&amp;amp; DOWN=$(echo ${DOWN} ${PROC})&lt;BR /&gt;done&lt;BR /&gt;[ ! -z "${DOWN}" ] &amp;amp;&amp;amp; mailx -s "${DOWN} processes are not running" sekar@xyz.com &amp;lt; /dev/null&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;&amp;gt; after a process went down, when it comes back, we should get an email saying process is running fine. we may get process down alerts many times but "process running" should be only once -ie, after process comes up from process down.&lt;BR /&gt;&lt;BR /&gt;For each process you will need to record its name and a "down" state indication.  When your script runs it needs to send an email if the process *is* running but the previous state was "down".  You could record this state information in a file or in memory in your script if your script constantly runs.  For example, you could launch your script once with an other loop that looks like:&lt;BR /&gt;&lt;BR /&gt;while true;&lt;BR /&gt;do&lt;BR /&gt;    ...&lt;BR /&gt;    sleep 60&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Sat, 22 May 2010 21:56:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635712#M676331</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-22T21:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635713#M676332</link>
      <description>thanks James,&lt;BR /&gt;&lt;BR /&gt;i got -syntax error at line 16: `DOWN=$' unexpected&lt;BR /&gt;then i used the old `cat filename` method.&lt;BR /&gt;&lt;BR /&gt;now i am getting - syntax error at line 16: `DOWN=$' unexpected&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 23 May 2010 00:44:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635713#M676332</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2010-05-23T00:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635714#M676333</link>
      <description>&lt;!--!*#--&gt;&amp;gt; i got -syntax error at line 16: [...]&lt;BR /&gt;&lt;BR /&gt;How many people, do you think, know what's on&lt;BR /&gt;line 16 of your script?</description>
      <pubDate>Sun, 23 May 2010 02:13:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635714#M676333</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-05-23T02:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635715#M676334</link>
      <description>&amp;gt;I used the old `cat filename` method.&lt;BR /&gt;&lt;BR /&gt;No need to use that evil cat, the $(&amp;lt; X) form isn't causing the error.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;syntax error at line 16: `DOWN=$' unexpected&lt;BR /&gt;&lt;BR /&gt;Did you split both JRF's lines starting with "[" in two?&lt;BR /&gt;This should be one line:&lt;BR /&gt;[ -z "$(UNIX95=EXTENDED_PS ps -C ${PROC} -opid=)" ] &amp;amp;&amp;amp; DOWN="${DOWN} ${PROC}"</description>
      <pubDate>Sun, 23 May 2010 05:13:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635715#M676334</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-05-23T05:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635716#M676335</link>
      <description>Thanks Dennis,&lt;BR /&gt;previously i used JRF's:&lt;BR /&gt;[ -z "$(UNIX95= ps -C ${PROC} -opid=)" ] &amp;amp;&amp;amp; DOWN=$(echo ${DOWN} ${PROC})&lt;BR /&gt;&lt;BR /&gt;now i used yours, &lt;BR /&gt;[ -z "$(UNIX95=EXTENDED_PS ps -C ${PROC} -opid=)" ] &amp;amp;&amp;amp; DOWN="${DOWN} ${PROC}"&lt;BR /&gt;and as you said, i am using &lt;BR /&gt;for PROC in $(&lt;PROCESS.LIST&gt;&lt;/PROCESS.LIST&gt;&lt;BR /&gt;but it give again the same error&lt;BR /&gt;syntax error at line 13: `$' unexpected&lt;BR /&gt;line 13 is this - for PROC in $(&lt;PROCESS.LIST&gt;&lt;/PROCESS.LIST&gt;</description>
      <pubDate>Sun, 23 May 2010 15:31:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635716#M676335</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2010-05-23T15:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635717#M676336</link>
      <description>Steven, since `DOWN=$' comes only once in JRF's script, i thought its easy to find out...</description>
      <pubDate>Sun, 23 May 2010 15:33:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635717#M676336</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2010-05-23T15:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635718#M676337</link>
      <description>&lt;!--!*#--&gt;HI (again) Sekar:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; previously i used JRF's:&lt;BR /&gt;[ -z "$(UNIX95= ps -C ${PROC} -opid=)" ] &amp;amp;&amp;amp; DOWN=$(echo ${DOWN} ${PROC})&lt;BR /&gt;&lt;BR /&gt;&amp;gt; now i used yours,&lt;BR /&gt;[ -z "$(UNIX95=EXTENDED_PS ps -C ${PROC} -opid=)" ] &amp;amp;&amp;amp; DOWN="${DOWN} ${PROC}"&lt;BR /&gt;and as you said, i am using&lt;BR /&gt;for PROC in $(&lt;PROCESS.LIST&gt;&lt;/PROCESS.LIST&gt;&lt;BR /&gt;&amp;gt; but it give again the same error&lt;BR /&gt;syntax error at line 13: `$' unexpected&lt;BR /&gt;&lt;BR /&gt;If you split lines you must use the shell continuation character ('\') like:&lt;BR /&gt;&lt;BR /&gt;[ -z "$(UNIX95= ps -C ${PROC} -opid=)" ] \&lt;BR /&gt;    &amp;amp;&amp;amp; DOWN=$(echo ${DOWN} ${PROC})&lt;BR /&gt;&lt;BR /&gt;There can be *no* trailing whitespace after the '\' character although whitespace can precede the continued statement(s).&lt;BR /&gt;&lt;BR /&gt;The difference between my:&lt;BR /&gt;&lt;BR /&gt;UNIX95=&lt;BR /&gt;&lt;BR /&gt;...and Dennis's:&lt;BR /&gt;&lt;BR /&gt;UNIX95=EXTENDED_PS &lt;BR /&gt;&lt;BR /&gt;...is one of personal choice.  The UNIX95 behavior is armed by using the l-value 'UNIX95=' *regardless* of what you set as the value (0, 1, EXTENDED_PS, or whatever).  The use of the value "EXTENDED_PS" in this context shows that you know that UNI95 (XPG4) behavior of 'ps' differs from the standard behavior when the command is run in the UNI95 (XPG4) environment.&lt;BR /&gt;&lt;BR /&gt;As Steven said, seeing the code I suggested integrated into your script would make debugging easier.  Seeing the contents of *your* input file ('process.list') would also be helpful.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Sun, 23 May 2010 15:55:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635718#M676337</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-23T15:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635719#M676338</link>
      <description>interesting learnings JRF...&lt;BR /&gt;ok, between, i found one small idea... suggest me this will work...&lt;BR /&gt;&lt;BR /&gt;for PROC in $(&lt;PROCESS.LIST&gt;&lt;/PROCESS.LIST&gt;do&lt;BR /&gt;[ -z "$(UNIX95= ps -C ${PROC} -opid=)" ]&lt;BR /&gt;$PROC &amp;gt;&amp;gt;./process-tobe-mailed&lt;BR /&gt;done&lt;BR /&gt;mail -s processes not running sekar@xyz.com &amp;lt;./process-tobe-mailed</description>
      <pubDate>Mon, 24 May 2010 00:56:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635719#M676338</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2010-05-24T00:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635720#M676339</link>
      <description>&lt;!--!*#--&gt;Hi (again) Sekar:&lt;BR /&gt;&lt;BR /&gt;You wrote:&lt;BR /&gt;&lt;BR /&gt;for PROC in $(&lt;PROCESS.LIST&gt;&lt;/PROCESS.LIST&gt;do&lt;BR /&gt;[ -z "$(UNIX95= ps -C ${PROC} -opid=)" ]&lt;BR /&gt;$PROC &amp;gt;&amp;gt;./process-tobe-mailed&lt;BR /&gt;done&lt;BR /&gt;mail -s processes not running sekar@xyz.com &amp;lt;./process-tobe-mailed&lt;BR /&gt;&lt;BR /&gt;...will enable you to collect a list of the processes that are not running,  Before the 'for' loop I would truncate the './process-tobe-mailed' file and then, only if it isn't empty (i.e. its size isn't 0) then send it as the body of the mail as you have.  Instead of a 'for' loop you could do:&lt;BR /&gt;&lt;BR /&gt;RSLT=./process-to-be-mailed&lt;BR /&gt;cat /dev/null &amp;gt; ${RSLT}&lt;BR /&gt;while read PROC&lt;BR /&gt;do&lt;BR /&gt;    [ -z "$(UNIX95= ps -C ${PROC} -opid=)" ] ${PROC} &amp;gt;&amp;gt; ${RSLT}&lt;BR /&gt;done &amp;lt; ./process.list&lt;BR /&gt;[ -s "${RSLT}" ] &amp;amp;&amp;amp; mail -s "processes not running" sekar@xyz.com &amp;lt; ${RSLT}&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 24 May 2010 01:15:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635720#M676339</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-24T01:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635721#M676340</link>
      <description>now the script is:&lt;BR /&gt;&lt;BR /&gt;RSLT=/opt/HPO/HealthCheck/process-to-be-mailed&lt;BR /&gt;cat /dev/null &amp;gt; ${RSLT}&lt;BR /&gt;while read PROC&lt;BR /&gt;do&lt;BR /&gt; [ -z "$(UNIX95=ps -C ${PROC} -opid=)" ]&lt;BR /&gt;   ${PROC}&amp;gt;&amp;gt;${RSLT}&lt;BR /&gt;done &amp;lt; /opt/HPO/HealthCheck/ovprocess.txt&lt;BR /&gt;[ -s "${RSLT}" ] &amp;amp;&amp;amp; mail -s "processes not running" ssundaram22@csc.com&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ssundaram $ sudo /opt/HPO/HealthCheck/ov_healthcheck.sh&lt;BR /&gt;/opt/HPO/HealthCheck/ov_healthcheck.sh: test-process1: not found&lt;BR /&gt;/opt/HPO/HealthCheck/ov_healthcheck.sh: testEA: not found&lt;BR /&gt;Error: Cannot bind host/port to socket.&lt;BR /&gt;ERROR:  ovsessionmgr:  Cannot initialize port 2389.  Is there already a ovsessionmgr running?&lt;BR /&gt;&lt;BR /&gt;^X^C&lt;BR /&gt;&lt;BR /&gt;the process list contains HPOVO processes. i included two test processes to check this issue. it works almost, but looks something missing or extra...</description>
      <pubDate>Mon, 24 May 2010 01:41:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635721#M676340</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2010-05-24T01:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635722#M676341</link>
      <description>Hi (again) Sekar:&lt;BR /&gt;&lt;BR /&gt;Your last posting has four errors: (1) You split the line beginning with '[ -z "$(UNIX95= ps'; (2) you dropped the white space following the 'UNIX95= ps'; (3) you dropped the conditional operator ('&amp;amp;&amp;amp;') that applied to the test; and (4) you dropped the 'echo' of the '${PROC}' value.&lt;BR /&gt;&lt;BR /&gt;The code should look like:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;RSLT=/opt/HPO/HealthCheck/process-to-be-mailed&lt;BR /&gt;cat /dev/null &amp;gt; ${RSLT}&lt;BR /&gt;while read PROC&lt;BR /&gt;do&lt;BR /&gt;    [ -z "$(UNIX95= ps -C ${PROC} -opid=)" ] &amp;amp;&amp;amp; echo ${PROC}&amp;gt;&amp;gt;${RSLT}&lt;BR /&gt;done &amp;lt; /opt/HPO/HealthCheck/ovprocess.txt&lt;BR /&gt;[ -s "${RSLT}" ] &amp;amp;&amp;amp; mailx -s "processes not running" ssundaram22@csc.com&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Notice that there is whitespace after the 'UNIX95=' and before the 'ps' with *no* semicolon.  This arms the UNIX95 behavior only for the duration of the command line.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 May 2010 11:11:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635722#M676341</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-24T11:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635723#M676342</link>
      <description>thanks for the reply..&lt;BR /&gt;&lt;BR /&gt;now the script is:&lt;BR /&gt;shcscp18:/clocal/cschpov/user/t5069ss/process-mon $&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;RSLT=/clocal/cschpov/user/t5069ss/process-mon/process-to-be-mailed&lt;BR /&gt;cat /dev/null &amp;gt; ${RSLT}&lt;BR /&gt;while read PROC&lt;BR /&gt;do&lt;BR /&gt;[ -z "$(UNIX95= ps -C ${PROC} -opid=)" ] &amp;amp;&amp;amp; echo ${PROC}&amp;gt;&amp;gt;${RSLT}&lt;BR /&gt;done &amp;lt; /clocal/cschpov/user/t5069ss/process-mon/ovprocess.txt&lt;BR /&gt;[ -s "${RSLT}" ] &amp;amp;&amp;amp; mailx -s "processes not running" ssundaram22@csc.com&lt;BR /&gt;&lt;BR /&gt;now i ran this script:&lt;BR /&gt;shcscp18:/clocal/cschpov/user/t5069ss/process-mon $ sh -x process-check.sh&lt;BR /&gt;RSLT=/clocal/cschpov/user/t5069ss/process-mon/process-to-be-mailed&lt;BR /&gt;+ cat /dev/null&lt;BR /&gt;+ read PROC&lt;BR /&gt;+ [ -z $(UNIX95= ps -C test-EA -opid=) ]&lt;BR /&gt;+ read PROC&lt;BR /&gt;+ [ -z $(UNIX95= ps -C testing -opid=) ]&lt;BR /&gt;+ read PROC&lt;BR /&gt;+ [ -z $(UNIX95= ps -C opcmsga -opid=) ]&lt;BR /&gt;+ read PROC&lt;BR /&gt;+ [ -s /clocal/cschpov/user/t5069ss/process-mon/process-to-be-mailed ]&lt;BR /&gt;shcscp18:&lt;BR /&gt;&lt;BR /&gt;the two test processes - test-EA and testing cant be running. the process-to-be-mailed file is zero size. mail didnt come..</description>
      <pubDate>Mon, 24 May 2010 11:55:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635723#M676342</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2010-05-24T11:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635724#M676343</link>
      <description>Hi (again) Sekar:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; the two test processes - test-EA and testing cant be running. the process-to-be-mailed file is zero size. mail didnt come..&lt;BR /&gt;&lt;BR /&gt;I think you mean that your email didn't identify *which* processes aren't running.  &lt;BR /&gt;Change:&lt;BR /&gt;&lt;BR /&gt;[ -s "${RSLT}" ] &amp;amp;&amp;amp; mailx -s "processes not running" ssundaram22@csc.com&lt;BR /&gt;&lt;BR /&gt;...To:&lt;BR /&gt;&lt;BR /&gt;[ -s "${RSLT}" ] &amp;amp;&amp;amp; mailx -s "processes not running" ssundaram22@csc.com &amp;lt; ${RSLT}&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 24 May 2010 12:36:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635724#M676343</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-24T12:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635725#M676344</link>
      <description>this line not updating the process-to-be-mailed&lt;BR /&gt;&lt;BR /&gt;[ -z "$(UNIX95= ps -C ${PROC} -opid=)" ] &amp;amp;&amp;amp; echo ${PROC} &amp;gt;&amp;gt; ${RSLT}&lt;BR /&gt;&lt;BR /&gt;i mean, after running the script the file is empty. so the [ -s "${RSLT}" ] fails. &lt;BR /&gt;ya, i included the &amp;lt; ${RSLT} at the end of mailx.&lt;BR /&gt;</description>
      <pubDate>Mon, 24 May 2010 12:53:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635725#M676344</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2010-05-24T12:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635726#M676345</link>
      <description>Hi (again) Sekar:&lt;BR /&gt;&lt;BR /&gt;The script I offered works for me.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; the two test processes - test-EA and testing cant be running.&lt;BR /&gt;&lt;BR /&gt;Upon what do you base this?  The code I have offered attempts to match *exactly* the process basename rather than fuzzily matching any part of the command line.&lt;BR /&gt;&lt;BR /&gt;Your trace output ('sh -x ...') looks a bit odd.  What version are you running?  A test case of mine looks like:&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/INPUT&lt;BR /&gt;sekar&lt;BR /&gt;cron&lt;BR /&gt;&lt;BR /&gt;# sh -x /tmp/MYSH&lt;BR /&gt;+ RSLT=/tmp/MAILING&lt;BR /&gt;+ cat /dev/null&lt;BR /&gt;+ 1&amp;gt; /tmp/MAILING&lt;BR /&gt;+ 0&amp;lt; /tmp/INPUT&lt;BR /&gt;+ read PROC&lt;BR /&gt;+ ps -C sekar -opid=&lt;BR /&gt;+ UNIX95=&lt;BR /&gt;+ [ -z  ]&lt;BR /&gt;+ echo sekar&lt;BR /&gt;+ 1&amp;gt;&amp;gt; /tmp/MAILING&lt;BR /&gt;+ read PROC&lt;BR /&gt;+ ps -C cron -opid=&lt;BR /&gt;+ UNIX95=&lt;BR /&gt;+ [ -z  1555 ]&lt;BR /&gt;+ read PROC&lt;BR /&gt;+ [ -s /tmp/MAILING ]&lt;BR /&gt;+ echo -s processes not running ssundaram22@csc.com&lt;BR /&gt;-s processes not running ssundaram22@csc.com&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/MAILING&lt;BR /&gt;sekar&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 24 May 2010 13:21:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635726#M676345</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-24T13:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635727#M676346</link>
      <description>oh, i am thinking that as usual i am with hpux, but this project alone we run with sun solaris 5.10&lt;BR /&gt;that could be an issue?</description>
      <pubDate>Mon, 24 May 2010 13:45:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635727#M676346</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2010-05-24T13:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635728#M676347</link>
      <description>Hi (again) Sekar:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; oh, i am thinking that as usual i am with hpux, but this project alone we run with sun solaris 5.10 that could be an issue?&lt;BR /&gt;&lt;BR /&gt;Yes, indeed.  I don't have a Sun server but I can tell you that the '-C' option doesn't exist on AIX, for example.&lt;BR /&gt;&lt;BR /&gt;If you must resort to a 'grep' to find if a process is running or not, make the potential match less fuzzy then a simple 'grep' for a name.  You can do things like:&lt;BR /&gt;&lt;BR /&gt;# ps -e|grep syslogd$&lt;BR /&gt;&lt;BR /&gt;or:&lt;BR /&gt;&lt;BR /&gt;# ps -e|awk '$4=="syslogd"'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 May 2010 14:02:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635728#M676347</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-24T14:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635729#M676348</link>
      <description>&amp;gt;JRF: cat /dev/null &amp;gt; ${RSLT}&lt;BR /&gt;&lt;BR /&gt;No need for that cat there: &amp;gt; ${RSLT}&lt;BR /&gt;&lt;BR /&gt;&amp;gt;(2) you dropped the white space following the 'UNIX95= ps';&lt;BR /&gt;&lt;BR /&gt;That's why I suggest always using EXTENDED_PS when providing examples.  (While it it may not prevent the mistaken insertion of a ";", it should handle the space problem.)</description>
      <pubDate>Mon, 24 May 2010 14:07:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635729#M676348</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-05-24T14:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: process monitoring script help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635730#M676349</link>
      <description>HI (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Dennis &amp;gt;JRF: cat /dev/null &amp;gt; ${RSLT}&lt;BR /&gt;No need for that cat there: &amp;gt; ${RSLT}&lt;BR /&gt;&lt;BR /&gt;Yes, I agree but I find in this syntax the 'cat /dev/null' adds a bit of code clarity.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Dennis: That's why I suggest always using EXTENDED_PS when providing examples. (While it it may not prevent the mistaken insertion of a ";", it should handle the space problem.)&lt;BR /&gt;&lt;BR /&gt;I understand your point and almost adopted that in this context since there appeared to be confusion :-)  [ You never know, I'm adaptable ;-) ]&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 24 May 2010 14:12:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-monitoring-script-help/m-p/4635730#M676349</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-24T14:12:43Z</dc:date>
    </item>
  </channel>
</rss>

