<?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: Script to check the process in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513918#M366149</link>
    <description>Hi,&lt;BR /&gt;tell me one thing if your script fail then how many lines are display.&lt;BR /&gt;&lt;BR /&gt;Suraj</description>
    <pubDate>Wed, 14 Oct 2009 09:56:52 GMT</pubDate>
    <dc:creator>Suraj K Sankari</dc:creator>
    <dc:date>2009-10-14T09:56:52Z</dc:date>
    <item>
      <title>Script to check the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513917#M366148</link>
      <description>I have a script ( /tmp/my_script ) to check the process ,&lt;BR /&gt;&lt;BR /&gt;$/tmp/my_script &lt;BR /&gt;report1 ok &lt;BR /&gt;report2 ok&lt;BR /&gt;report3 ok&lt;BR /&gt;&lt;BR /&gt;my reqiurement is :&lt;BR /&gt;if run myscript , the result generated three lines ( as above ) , then it is normal , if the result is not three lines , then it is not normal , I want to send a notify mail to me in case it is not normal , the logic is as below .&lt;BR /&gt;&lt;BR /&gt;====================&lt;BR /&gt;/tmp/my_script &lt;BR /&gt;if result is three lines ; then do nothing&lt;BR /&gt; else &lt;BR /&gt;  send notify mail to me &lt;BR /&gt;fi&lt;BR /&gt;=====================&lt;BR /&gt;&lt;BR /&gt;can advise how can I write this script ? thx &lt;BR /&gt;</description>
      <pubDate>Wed, 14 Oct 2009 09:52:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513917#M366148</guid>
      <dc:creator>Son dam bi</dc:creator>
      <dc:date>2009-10-14T09:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script to check the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513918#M366149</link>
      <description>Hi,&lt;BR /&gt;tell me one thing if your script fail then how many lines are display.&lt;BR /&gt;&lt;BR /&gt;Suraj</description>
      <pubDate>Wed, 14 Oct 2009 09:56:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513918#M366149</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-10-14T09:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Script to check the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513919#M366150</link>
      <description>thx reply ,&lt;BR /&gt;&lt;BR /&gt;not regular , may be one , two or over three lines or even a empty result , so what I want is if the result is not three lines , then define it is a fail case , then send notify mail .&lt;BR /&gt;&lt;BR /&gt;thx for help .</description>
      <pubDate>Wed, 14 Oct 2009 10:17:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513919#M366150</guid>
      <dc:creator>Son dam bi</dc:creator>
      <dc:date>2009-10-14T10:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Script to check the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513920#M366151</link>
      <description>A small sh script can do this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sh /tmp/my_script |grep -v "report1 ok" |grep -v "report2 ok"|grep -v "report3 ok" &amp;gt; /dev/null&lt;BR /&gt;if $?=0&lt;BR /&gt;then&lt;BR /&gt;echo mail&lt;BR /&gt;else&lt;BR /&gt;echo "no mail" &lt;BR /&gt;fi</description>
      <pubDate>Wed, 14 Oct 2009 10:29:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513920#M366151</guid>
      <dc:creator>F Verschuren</dc:creator>
      <dc:date>2009-10-14T10:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Script to check the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513921#M366152</link>
      <description>You can write like this code:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;if (( `cat myscript|wc -l` != 3 ))&lt;BR /&gt; then&lt;BR /&gt; mailx .. &lt;BR /&gt; else&lt;BR /&gt; echo good&lt;BR /&gt; fi</description>
      <pubDate>Wed, 14 Oct 2009 10:35:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513921#M366152</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2009-10-14T10:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Script to check the process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513922#M366153</link>
      <description>Hello,&lt;BR /&gt;you could use this way:&lt;BR /&gt;create a new script:&lt;BR /&gt;#/usr/bin/sh&lt;BR /&gt;cd /tmp&lt;BR /&gt;my_script 2&amp;gt;my_script.err 1&amp;gt; my_script.log&lt;BR /&gt;cat my_script.log&lt;BR /&gt;if [[ $(wc -l my_script.log != 3 ]] || [[ $(wc -l my_script.err &amp;gt; 0 ]]; then&lt;BR /&gt;(echo; uuencode my_script.err my_script_err.txt; echo;uuencode my_script.log my_script_log.txt) \&lt;BR /&gt;mailx -m -s "my_script KO" your@address&lt;BR /&gt;fi&lt;BR /&gt;#eof&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Oct 2009 07:58:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-the-process/m-p/4513922#M366153</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2009-10-15T07:58:44Z</dc:date>
    </item>
  </channel>
</rss>

