<?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 Script checking processes in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121069#M150830</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if you have more than one process in your config file, you have a problem. &lt;BR /&gt;try this&lt;BR /&gt;&lt;BR /&gt;while read F1 F2 PROCESS F4 F5 F6&lt;BR /&gt;do&lt;BR /&gt;  checkproc ${PROCESS} &amp;amp;&lt;BR /&gt;done &amp;lt; /var/opt/OV/conf/OpC/procmon.conf &lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
    <pubDate>Tue, 18 Nov 2003 06:03:47 GMT</pubDate>
    <dc:creator>Michael Schulte zur Sur</dc:creator>
    <dc:date>2003-11-18T06:03:47Z</dc:date>
    <item>
      <title>Shell Script checking processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121063#M150824</link>
      <description>Hi everybody, havenÂ´t been able to come up with a decent shell script to do this for me:&lt;BR /&gt;For a few servers running OS=HP-UX 11.0&lt;BR /&gt;&lt;BR /&gt;1. Check on processes running from a file, third column of a file&lt;BR /&gt;2. If running do nothing (and if was previously "not running" send e-mail saying is UP again and exit, once it has notified, don't bother to inform again!).&lt;BR /&gt;3. If not running, send e-mail to inform (keep the status to check on next run if process came up).&lt;BR /&gt;&lt;BR /&gt;Hope I was "crystal clear" on my question!&lt;BR /&gt;Does anybody have such a script?, since I believe must be a common issue actually, any help would be greatly appreciated.&lt;BR /&gt;Couldn't get it to work properly myself.&lt;BR /&gt;Thanks a lot</description>
      <pubDate>Mon, 17 Nov 2003 11:15:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121063#M150824</guid>
      <dc:creator>Carlos A. Garcia</dc:creator>
      <dc:date>2003-11-17T11:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script checking processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121064#M150825</link>
      <description>&lt;A href="http://www.bb4.com" target="_blank"&gt;www.bb4.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-- Graham</description>
      <pubDate>Mon, 17 Nov 2003 11:23:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121064#M150825</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2003-11-17T11:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script checking processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121065#M150826</link>
      <description>Here is a rudementary script that will handle one process. You can expand it to cover more than one.&lt;BR /&gt;&lt;BR /&gt;Where $VAL -ge 1, the 1 is the number of procs you are validating are supposed to be running. In my case the number is 4, but for you maybe only 1&lt;BR /&gt;&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;VAL=0&lt;BR /&gt;echo $VAL&lt;BR /&gt;&lt;BR /&gt;VAL=`ps -aef|grep &lt;PROC&gt;|grep -v grep|grep -v &amp;lt;scriptname&amp;gt; |wc -l`&lt;BR /&gt;&lt;BR /&gt;echo $VAL&lt;BR /&gt;if [ $VAL -ge 1 ]&lt;BR /&gt;then echo "Services are running";ps -aef|grep -e  &lt;PROC&gt; -e opl |grep -v&lt;BR /&gt;grep|grep -v &amp;lt;scriptname&amp;gt;;date&lt;BR /&gt;else mailx -s "Services" root &amp;lt; /root/process.notice&lt;BR /&gt;fi&lt;BR /&gt;--------------------------------------------&lt;/PROC&gt;&lt;/PROC&gt;</description>
      <pubDate>Mon, 17 Nov 2003 11:27:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121065#M150826</guid>
      <dc:creator>Todd McDaniel_1</dc:creator>
      <dc:date>2003-11-17T11:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script checking processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121066#M150827</link>
      <description>Thanks a lot Graham, actually I'm a HP-OVO's admin, the weird thing about it, is our Operations staff won't consider OV's notifications good enough, and would like to have mail notifications (for processes down) and a single notification whenever a process comes up again.&lt;BR /&gt;I'm already using opcmsg to accomplish part of it, but OP would like e-mail notifications.&lt;BR /&gt;&lt;BR /&gt;Thanks again.</description>
      <pubDate>Mon, 17 Nov 2003 11:27:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121066#M150827</guid>
      <dc:creator>Carlos A. Garcia</dc:creator>
      <dc:date>2003-11-17T11:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script checking processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121067#M150828</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;here is another script.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Nov 2003 12:42:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121067#M150828</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-11-17T12:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script checking processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121068#M150829</link>
      <description>Thanks a lot Todd and Michael!&lt;BR /&gt;Todd, your script works great, had my own script working close to that, but still doesn't provide with the information/status, regarding whenever a process previously was DOWN and now is back UP again, I did test it but didn't seem to work that way.&lt;BR /&gt;&lt;BR /&gt;Now, Michael, yours works great, but seems I really have a problem getting correctly the processes from my file, such as:&lt;BR /&gt;&lt;BR /&gt;COMMAND=`cat /var/opt/OV/conf/OpC/procmon.conf | awk '{ print $3 }'`&lt;BR /&gt;&lt;BR /&gt;Is there a better way to do this?A proper way?&lt;BR /&gt;Since this file /var/opt/OV/conf/OpC/procmon.conf looks like this:&lt;BR /&gt;1       OS      inetd   Exact   1       Critical         2&lt;BR /&gt;1       OS      sshd    Min     1       Critical        2&lt;BR /&gt;&lt;BR /&gt;Any help is much appreciated guys, thanks for your quick and proper response.&lt;BR /&gt;Best regards.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Nov 2003 14:00:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121068#M150829</guid>
      <dc:creator>Carlos A. Garcia</dc:creator>
      <dc:date>2003-11-17T14:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script checking processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121069#M150830</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if you have more than one process in your config file, you have a problem. &lt;BR /&gt;try this&lt;BR /&gt;&lt;BR /&gt;while read F1 F2 PROCESS F4 F5 F6&lt;BR /&gt;do&lt;BR /&gt;  checkproc ${PROCESS} &amp;amp;&lt;BR /&gt;done &amp;lt; /var/opt/OV/conf/OpC/procmon.conf &lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Nov 2003 06:03:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121069#M150830</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-11-18T06:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script checking processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121070#M150831</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have redone my script.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Nov 2003 08:17:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121070#M150831</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-11-18T08:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script checking processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121071#M150832</link>
      <description>Michael, just perfect!&lt;BR /&gt;I've only modified this:&lt;BR /&gt;"Min") COMPAREON[${NUMPROC}]="-eq";;&lt;BR /&gt;Replaced "-gt" with "-eq", so it notifies perfectly whenever a process comes up again.&lt;BR /&gt;&lt;BR /&gt;I really appreciate guys your help, and even more, in such a short period of time!&lt;BR /&gt;Thanks again!&lt;BR /&gt;If there is a way to assign more point to you guys,let me know!&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;C.</description>
      <pubDate>Tue, 18 Nov 2003 13:08:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121071#M150832</guid>
      <dc:creator>Carlos A. Garcia</dc:creator>
      <dc:date>2003-11-18T13:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script checking processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121072#M150833</link>
      <description>Hi Carlos,&lt;BR /&gt;&lt;BR /&gt;just curious, can you explain the meaning of the fields in the config file? I thought Min means minimum, so if 2 processes are running then the script will complain again. The script was designed to mail once, when the minimum number of processes are running. Am I missing something?&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Nov 2003 06:05:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121072#M150833</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-11-19T06:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script checking processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121073#M150834</link>
      <description>Hi Michael, yes, sure (this is a conf file I'm using for Openview's script, so, that is why I keep the same format):&lt;BR /&gt;&lt;BR /&gt;1=check for process&lt;BR /&gt;OS=OS process&lt;BR /&gt;inetd=name of process&lt;BR /&gt;Exact=condition Min-Max or Exact&lt;BR /&gt;1=number of times running (Exact 1 time, Min 1 time) etc...&lt;BR /&gt;Critical=status IF down&lt;BR /&gt;2=frequency&lt;BR /&gt;&lt;BR /&gt;And in order to e-mail once, had to add the following test:&lt;BR /&gt;else&lt;BR /&gt;    test ${NOTIFIED[${COUNT}]}="YES" &amp;amp;&amp;amp; echo "Service down...etc...&lt;BR /&gt;&lt;BR /&gt;This way it only sends one e-mail to notify for a process DOWN, and only one e-amil to notify a process is UP again, works great!&lt;BR /&gt;Thanks again!&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;C.&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Nov 2003 14:04:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-checking-processes/m-p/3121073#M150834</guid>
      <dc:creator>Carlos A. Garcia</dc:creator>
      <dc:date>2003-11-19T14:04:36Z</dc:date>
    </item>
  </channel>
</rss>

