<?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: Regarding Bill's adminalert.sh script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6751090#M488669</link>
    <description>&lt;P&gt;&amp;gt;Or need to modify it as per my requirement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The latter, you need to modify it.&lt;/P&gt;</description>
    <pubDate>Sat, 30 May 2015 20:53:53 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2015-05-30T20:53:53Z</dc:date>
    <item>
      <title>Reg Bill's adminalert.sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750464#M488656</link>
      <description>&lt;P&gt;Hi Bill ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its an excellent script.&lt;/P&gt;&lt;P&gt;But somehow its not running for one of my process .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ps -ef |grep -i &lt;STRONG&gt;str F0004&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test&amp;nbsp;28899 1 0 13:31:02 pts/3 0:00 str F0004&lt;BR /&gt;rte&amp;nbsp;28254 1 0 May 21 ? 0:01 str F0004&lt;BR /&gt;dfr&amp;nbsp;3509 16295 1 15:58:12 pts/0 0:00 grep -i F0004&lt;BR /&gt;ddk17349 1 0 May 21 ? 0:04 str F0004&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when am mentioning ;&lt;/P&gt;&lt;P&gt;ProcMon=1&lt;BR /&gt;PROCS=F0004:1:2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where do i put second argument "str" ??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 12:58:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750464#M488656</guid>
      <dc:creator>chindi</dc:creator>
      <dc:date>2015-05-28T12:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Bill's adminalert.sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750471#M488657</link>
      <description>&lt;P&gt;According to your 'ps' output the script that is running is actually 'str' and the first argument to 'str' is F0004.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if you are wanting to check to make sure 'str F0004' is running, I'm not sure how to do that. &amp;nbsp;I don't know that Bill designed the script to handle spaces in the process name(s) it is looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I sent Bill an e-mail alerting him to your question.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 13:31:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750471#M488657</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2015-05-28T13:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Bill's adminalert.sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750475#M488658</link>
      <description>&lt;P&gt;There is no process named "&lt;STRONG&gt;str F0004&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;The process name is &lt;STRONG&gt;str&lt;/STRONG&gt; as reported by &lt;STRONG&gt;ps&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;The string "&lt;STRONG&gt;F0004&lt;/STRONG&gt;" is just an argument. There is no provision to look for a process and then look for arguments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The correct entry would be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ProcMon=1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;PROCS=str:1:2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which will email a message if "&lt;STRONG&gt;str&lt;/STRONG&gt;" is not running, or there are more than 2 copies running.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 13:41:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750475#M488658</guid>
      <dc:creator>pooderbill</dc:creator>
      <dc:date>2015-05-28T13:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Bill's adminalert.sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750484#M488659</link>
      <description>&lt;P&gt;&amp;nbsp;Thanks Patrick :-)&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 14:00:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750484#M488659</guid>
      <dc:creator>chindi</dc:creator>
      <dc:date>2015-05-28T14:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Bill's adminalert.sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750527#M488660</link>
      <description>&lt;P&gt;Hi Pooderbill,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to grep F0004 primarily , not str .&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 14:48:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750527#M488660</guid>
      <dc:creator>chindi</dc:creator>
      <dc:date>2015-05-28T14:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Bill's adminalert.sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750605#M488661</link>
      <description>&lt;P&gt;So &lt;STRONG&gt;F0004&lt;/STRONG&gt; might appear on the command line for multiple programs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a reminder, &lt;STRONG&gt;grep&lt;/STRONG&gt; and &lt;STRONG&gt;ps&lt;/STRONG&gt; can be an unstable combination. &lt;STRONG&gt;grep&lt;/STRONG&gt; matches any string of characters, anywhere on the &lt;STRONG&gt;ps&lt;/STRONG&gt; line. That means that a user named &lt;STRONG&gt;F0004&lt;/STRONG&gt; will be found, an argument on a command line such as &lt;STRONG&gt;A:AFF000423&lt;/STRONG&gt;, and of course the &lt;STRONG&gt;grep&lt;/STRONG&gt; command itself which will have &lt;STRONG&gt;F0004&lt;/STRONG&gt; on the command line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To narrow down the search (and make it more accurate), I would use the &lt;STRONG&gt;UNIX95=1&lt;/STRONG&gt; feature to enable these extra options:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-C&lt;/STRONG&gt; &amp;lt;process name(s)&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-H&lt;/STRONG&gt; to parent/child relationships&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-o&lt;/STRONG&gt; &amp;lt;columns to list&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The two options for this task would be &lt;STRONG&gt;-C&lt;/STRONG&gt; to list only the processes that might have &lt;STRONG&gt;F0004&lt;/STRONG&gt; on the command line, and &lt;STRONG&gt;-o&lt;/STRONG&gt; which allows you to customize the output for easier scripting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's assume that there are 3 different processes that might have &lt;STRONG&gt;F0004&lt;/STRONG&gt;, &lt;STRONG&gt;str&lt;/STRONG&gt;, &lt;STRONG&gt;strabc&lt;/STRONG&gt; and &lt;STRONG&gt;abc&lt;/STRONG&gt;. To find exactly those processes by name, NEVER use &lt;STRONG&gt;grep&lt;/STRONG&gt; but rather, use this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UNIX95=1 ps -f -C str,strabc,abc&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will not find processes like &lt;STRONG&gt;abc123&lt;/STRONG&gt; or &lt;STRONG&gt;str2&lt;/STRONG&gt;, only exact name matches.&lt;/P&gt;&lt;P&gt;Now that you have only the programs to be tested, you can then choose which columns to have displayed by &lt;STRONG&gt;ps&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;This is done with the &lt;STRONG&gt;-o&lt;/STRONG&gt; option. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# UNIX95=1 ps -C httpd -o pid -o args
  PID COMMAND
 4282 /opt/hpws/apache/bin/httpd -d /opt/hpws/apache -k start
 4279 /opt/hpws/apache/bin/httpd -d /opt/hpws/apache -k start
 4364 /opt/hpws/apache/bin/httpd -d /opt/hpws/apache -k start
 4363 /opt/hpws/apache/bin/httpd -d /opt/hpws/apache -k start

and without a title line:

# UNIX95=1 ps -C httpd -o pid= -o args=
 4282 /opt/hpws/apache/bin/httpd -d /opt/hpws/apache -k start
 4279 /opt/hpws/apache/bin/httpd -d /opt/hpws/apache -k start
 4364 /opt/hpws/apache/bin/httpd -d /opt/hpws/apache -k start
 4363 /opt/hpws/apache/bin/httpd -d /opt/hpws/apache -k start&lt;/PRE&gt;&lt;P&gt;The UNIX95=1 is a temporary assignment just for the ps command.&lt;/P&gt;&lt;P&gt;Don't assign the variable on a separate line as this change the behavior of other commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The column names are listed in the man page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To eliminate the title line, set the column name to nothing or use &lt;STRONG&gt;""&lt;/STRONG&gt; as in &lt;STRONG&gt;pid=&lt;/STRONG&gt; or &lt;STRONG&gt;pid=""&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If all you need is the PID, then this is the easiest way. Now you can grep &lt;STRONG&gt;F0004&lt;/STRONG&gt; from just the listed processes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# UNIX95=1 ps -C str,strabc,abc -o pid= -o args= | grep F0004
17546 str F00004
12789 abc -a "zz43 F0004" -w ww9&lt;/PRE&gt;&lt;P&gt;(Note for the purists: &lt;STRONG&gt;UNIX95=1&lt;/STRONG&gt; can be just &lt;STRONG&gt;UNIX95=&lt;/STRONG&gt; in order to define the variable. See &lt;STRONG&gt;man 5 standards&lt;/STRONG&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 16:11:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750605#M488661</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2015-05-28T16:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Bill's adminalert.sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750663#M488662</link>
      <description>&lt;P&gt;Hi Bill ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So where exactly i need to make changes ? to grep F0004 alongwith str ??&lt;/P&gt;&lt;P&gt;Will you please help me with it .&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 17:51:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750663#M488662</guid>
      <dc:creator>chindi</dc:creator>
      <dc:date>2015-05-28T17:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Bill's adminalert.sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750670#M488663</link>
      <description>&lt;P&gt;My script will not work for your requirement.&lt;/P&gt;&lt;P&gt;You'll need to create a script that performs the monitoring using &lt;STRONG&gt;ps&lt;/STRONG&gt; and &lt;STRONG&gt;grep&lt;/STRONG&gt; for &lt;STRONG&gt;F0004&lt;/STRONG&gt;, then add logic to see if it meets your requirements.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 17:58:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750670#M488663</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2015-05-28T17:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Bill's adminalert.sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750671#M488664</link>
      <description>&lt;P&gt;Oh :( .&lt;/P&gt;&lt;P&gt;Anyway thanks for the hint.&lt;/P&gt;&lt;P&gt;Will check it.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 18:08:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750671#M488664</guid>
      <dc:creator>chindi</dc:creator>
      <dc:date>2015-05-28T18:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Bill's adminalert.sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750858#M488667</link>
      <description>&lt;P&gt;&amp;gt; There is no process named "str F0004"&lt;BR /&gt;&amp;gt; The process name is str as reported by ps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Does the concept of a "process name" even exist on UNIX?&amp;nbsp; It does on&lt;BR /&gt;VMS (where a process name may have little or nothing to do with the&lt;BR /&gt;executable being run).&amp;nbsp; For example, given a process ID, one can request&lt;BR /&gt;its name (using the Get Job and Process Information service):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alp $ write sys$output f$getjpi( "20200410", "PRCNAM")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AUDIT_SERVER&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; On UNIX, one can pretend that argv[0] is a process name, but, because&lt;BR /&gt;multiple processes can run the same executable, multiple processes can&lt;BR /&gt;have the same "name" (argv[0]), so this "name" does not uniquely&lt;BR /&gt;identify a process.&amp;nbsp; Even on VMS, a process name is unique only within&lt;BR /&gt;a process group, but it's a better identifier there than argv[0] is on&lt;BR /&gt;UNIX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "man ps" mentions "args", "arguments", and "command name", but I&lt;BR /&gt;don't see "process name" anywhere.&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2015 06:53:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750858#M488667</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2015-05-29T06:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Bill's adminalert.sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750866#M488668</link>
      <description>&lt;P&gt;Hi Steven ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So are you saying that its possible by Bill's script ?&lt;/P&gt;&lt;P&gt;Or need to modify it as per my requirement ?&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2015 07:21:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6750866#M488668</guid>
      <dc:creator>chindi</dc:creator>
      <dc:date>2015-05-29T07:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Bill's adminalert.sh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6751090#M488669</link>
      <description>&lt;P&gt;&amp;gt;Or need to modify it as per my requirement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The latter, you need to modify it.&lt;/P&gt;</description>
      <pubDate>Sat, 30 May 2015 20:53:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-bill-s-adminalert-sh-script/m-p/6751090#M488669</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2015-05-30T20:53:53Z</dc:date>
    </item>
  </channel>
</rss>

