<?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>question Re: Solaris 11 active process discovery without /usr/ucb in ITOM forum</title>
    <link>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959285#M58974</link>
    <description>&lt;P&gt;So the answer is that Solaris 11 provides a backwards compatibility option for /usr/bin/ps to generate output that matches the ucb version of ps.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;For example, the &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;"Solaris - Active Processes" probe runs "/usr/ucb/ps -awwx" to get process information.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;The equivalent Solaris 11 ps command is "/usr/bin/ps awwx". &amp;nbsp; Eliminating the leading '-' in the command arg tells ps to go retro and run like the ucb ps.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;I modified the bash script in the probe to check the OS version and run the ucb ps or the Solaris 11 ps depending on OS (11 or 5.11 for example).&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 13 Jul 2017 01:55:17 GMT</pubDate>
    <dc:creator>Paul Ciarfella</dc:creator>
    <dc:date>2017-07-13T01:55:17Z</dc:date>
    <item>
      <title>Solaris 11 active process discovery without /usr/ucb</title>
      <link>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959282#M58971</link>
      <description>&lt;P&gt;The Solaris probe "Solaris - Active Processes" requires /usr/ucb/ps. &amp;nbsp; But our server architect is against installing /usr/ucb and polluting the beauty of the Solaris installation with outside packages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone successfully modified active process discovery to support Solaris 11 without /usr/ucb installed? &amp;nbsp; &amp;nbsp; &amp;nbsp; Discovery documentation says its required for Solaris 10 and below, and /usr/bin/ps for Solaris 11, but the probes definitely do not work on Solaris 11 if /usr/ucb is not installed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm thinking we're going to need to write a custom probe assuming that the output from /usr/bin/ps can be output in a compatible digestible format.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 20:37:08 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959282#M58971</guid>
      <dc:creator>Paul Ciarfella</dc:creator>
      <dc:date>2017-07-11T20:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Solaris 11 active process discovery without /usr/ucb</title>
      <link>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959283#M58972</link>
      <description>&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;/usr/ucb is needed for Solaris 11 as Discovery need to use this command for output.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Documentation &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="https://docs.servicenow.com/bundle/istanbul-it-operations-management/page/product/discovery/reference/r_CmdsReqRootDiscoAndOrch.html" title="https://docs.servicenow.com/bundle/istanbul-it-operations-management/page/product/discovery/reference/r_CmdsReqRootDiscoAndOrch.html"&gt;UNIX and Linux commands requiring root privileges for Discovery and Orchestration&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;KB:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="https://hi.service-now.com/kb_view.do?sysparm_article=KB0564262" title="https://hi.service-now.com/kb_view.do?sysparm_article=KB0564262"&gt;ServiceNow Customer Service System&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I hope this sufficient to convince the server architect &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="218_337.875_16_16" src="https://www.servicenow.com/8.0.4.21bdc7e/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Kar Meng&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Jul 2017 04:24:46 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959283#M58972</guid>
      <dc:creator>karmeng</dc:creator>
      <dc:date>2017-07-12T04:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Solaris 11 active process discovery without /usr/ucb</title>
      <link>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959284#M58973</link>
      <description>&lt;P&gt;Thanks for pointing out the documentation. &amp;nbsp; I didn't notice that it was updated in Helsinki.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;That's probably not enough to convince the architect and we'd need to update over 300 production servers, which is another big roadblock.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;We'll see if we can modify the probe to get at least some of the running process information.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Jul 2017 11:15:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959284#M58973</guid>
      <dc:creator>Paul Ciarfella</dc:creator>
      <dc:date>2017-07-12T11:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Solaris 11 active process discovery without /usr/ucb</title>
      <link>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959285#M58974</link>
      <description>&lt;P&gt;So the answer is that Solaris 11 provides a backwards compatibility option for /usr/bin/ps to generate output that matches the ucb version of ps.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;For example, the &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;"Solaris - Active Processes" probe runs "/usr/ucb/ps -awwx" to get process information.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;The equivalent Solaris 11 ps command is "/usr/bin/ps awwx". &amp;nbsp; Eliminating the leading '-' in the command arg tells ps to go retro and run like the ucb ps.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;I modified the bash script in the probe to check the OS version and run the ucb ps or the Solaris 11 ps depending on OS (11 or 5.11 for example).&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jul 2017 01:55:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959285#M58974</guid>
      <dc:creator>Paul Ciarfella</dc:creator>
      <dc:date>2017-07-13T01:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Solaris 11 active process discovery without /usr/ucb</title>
      <link>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959286#M58975</link>
      <description>&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks for your update. Sounds that you found the workaround for the issue by modified the bash script. Glad you update the result and I believe it will benefit community members who have similar requirement &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="71_496.046875_16_16" src="https://www.servicenow.com/8.0.4.21bdc7e/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Appreciate if you can mark this thread as answered with the comment that you provide earlier.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Kar Meng&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jul 2017 02:33:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959286#M58975</guid>
      <dc:creator>karmeng</dc:creator>
      <dc:date>2017-07-13T02:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Solaris 11 active process discovery without /usr/ucb</title>
      <link>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959287#M58976</link>
      <description>&lt;P&gt;Paul,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Do you know of any documentation of this "no dash" mode for /usr/bin/ps, and if it is supported in all versions of Solaris 11? &amp;nbsp; Below is all I could find, none of it "official" such as an Oracle man page:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;- Solaris 11 man page for /usr/bin/ps &lt;A href="https://docs.oracle.com/cd/E23824_01/html/821-1461/ps-1.html#scrolltoc" title="https://docs.oracle.com/cd/E23824_01/html/821-1461/ps-1.html#scrolltoc"&gt;Synopsis - man pages section 1: User Commands&lt;/A&gt; &amp;nbsp; doesn't show a "no dash" syntax.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;- Oracle blog &lt;A href="https://blogs.oracle.com/casper/solaris-113-sru-56:-updates-in-ps1-and-procltpidgtcmdline,environ,execname" title="https://blogs.oracle.com/casper/solaris-113-sru-56:-updates-in-ps1-and-procltpidgtcmdline,environ,execname"&gt;SRU 5.6: updates in ps(1) and /proc/&amp;amp;lt;pid&amp;amp;gt;/{cmdline,environ,execname} | Oracle Casper Dik's Blog&lt;/A&gt; talks about /usr/bin/ps removing the 80 column limit starting with Solaris 11.3, but no mention about "no dash" mode.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;- &lt;A href="https://superuser.com/questions/148271/ps-command-in-solaris" title="https://superuser.com/questions/148271/ps-command-in-solaris"&gt;unix - PS Command in Solaris - Super User&lt;/A&gt; &amp;nbsp; says "&lt;EM style="color: #242729; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;On Solaris 11, if you use options without a dash (like /usr/bin/ps auxwww) t&lt;/EM&gt;&lt;SPAN style="color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px;"&gt;&lt;EM&gt;hey will be treated as UCB style options, and the output will show extra long lines, even when you are NOT running as root."&lt;/EM&gt; &amp;nbsp; but does he mean all versions of Solaris 11? &amp;nbsp; His comment contains 3 more links, but they didn't help much.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;thanks, Jim&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jul 2017 00:21:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959287#M58976</guid>
      <dc:creator>jimfreeman</dc:creator>
      <dc:date>2017-07-27T00:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Solaris 11 active process discovery without /usr/ucb</title>
      <link>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959288#M58977</link>
      <description>&lt;P&gt;Hi Jim - &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Here is where I learned about the BSD compatibility option:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="http://www.scalingbits.com/content/solaris-11-changes-where-bsd-style-ps-command" title="http://www.scalingbits.com/content/solaris-11-changes-where-bsd-style-ps-command"&gt;Solaris 11 Changes: Where is the BSD style ps command? | Scaling Bits&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I've not yet been able to try this on a Solaris 11 system, only 5.11.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jul 2017 15:54:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959288#M58977</guid>
      <dc:creator>Paul Ciarfella</dc:creator>
      <dc:date>2017-07-27T15:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Solaris 11 active process discovery without /usr/ucb</title>
      <link>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959289#M58978</link>
      <description>&lt;P&gt;Paul, thanks for that Scaling Bits blog link. &amp;nbsp; Wish we could find some official Oracle documentation supporting this.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jul 2017 22:36:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959289#M58978</guid>
      <dc:creator>jimfreeman</dc:creator>
      <dc:date>2017-07-27T22:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Solaris 11 active process discovery without /usr/ucb</title>
      <link>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959290#M58979</link>
      <description>&lt;P&gt;Paul, I am facing the same issue here wherein the "Active Processes" are not being picked by the solaris probe for V11.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Since, i am not familiar with solaris commands, can you help me out in modifying the existing probe. Following is the code:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;#!/bin/sh&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;#&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# Only get our processes, not our child zone processes&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;#&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;ZONENAME=$1&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;IFS="&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;ZONECMD=/usr/bin/zonename&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;PSCMD="/usr/bin/ps"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;UCBPSCMD="/usr/ucb/ps"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;PSARGS="-o pid,ppid"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;AWKCMD="awk"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# First output just the heading for ps's output, tacking on a COMMAND column&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;echo PID PPID COMMAND&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# Check for existence of zonename command&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;if [ ! -z "$ZONENAME" ]; then&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ZONEPARAM="-z ${ZONENAME}"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;elif [ -f $ZONECMD ]; then&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# exists: limit ps to display processes for this zone&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ZONEPARAM="-z `$ZONECMD`"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;else&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# doesn't exist: ps to display all processes &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ZONEPARAM="-e"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;fi&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# Replace awk command with nawk if it is available &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# awk has a byte limit of 2559 bytes on older solaris machines&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;if hash nawk 2&amp;gt;/dev/null; then&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; AWKCMD="nawk"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;fi&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# Iterate through each line of ps output...&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;for LINE in `$PSCMD $ZONEPARAM $PSARGS`; do&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;PID=`echo $LINE | $AWKCMD '{print $1}'`&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# Check that this line isn't the header, and it's valid in /proc&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;if [ "$PID" != "PID" -a -f "/proc/$PID/status" ]; then&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# use ucb/ps to get full, non-truncated command+args&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;CMD=`$UCBPSCMD -awwx $PID | tail +2 | $AWKCMD '{$1="";$2="";$3="";$4="";print $0}'`&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# tack on the command+args to the output&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;echo $LINE $CMD&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fi&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;done&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;------------------&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Also, would this command work: ps -aux&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;What changes do i need to make to the sensor script?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Dec 2017 13:28:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959290#M58979</guid>
      <dc:creator>Abhishek Raj To</dc:creator>
      <dc:date>2017-12-06T13:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Solaris 11 active process discovery without /usr/ucb</title>
      <link>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959291#M58980</link>
      <description>&lt;P&gt;Abhishek,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Here's the revised ps.sh script:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;#!/bin/sh -x&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;#&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# Only get our processes, not our child zone processes&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;#&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;ZONENAME=$1&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;IFS="&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;ZONECMD=/usr/bin/zonename&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;PSCMD="/usr/bin/ps"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;UCBPSCMD="/usr/ucb/ps -awwx"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;PSARGS="-o pid,ppid"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;AWKCMD="awk"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;#&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# PWC Solaris 10 and older have ucb/ps installed. &amp;nbsp; Solaris 11 does not.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; But Solaris 11 generates /usr/bin/ps compatible output for &amp;nbsp; when -&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; is not at the front of the first command argument.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;#&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;SOLVERSION=`uname -r`&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# First output just the heading for ps's output, tacking on a COMMAND column&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;echo PID PPID COMMAND&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# Check for existence of zonename command&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;if [ ! -z "$ZONENAME" ]; then&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ZONEPARAM="-z ${ZONENAME}"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;elif [ -f $ZONECMD ]; then&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# exists: limit ps to display processes for this zone&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ZONEPARAM="-z `$ZONECMD`"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;else&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# doesn't exist: ps to display all processes&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ZONEPARAM="-e"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;fi&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# Replace awk command with nawk if it is available&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# awk has a byte limit of 2559 bytes on older solaris machines&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;if hash nawk 2&amp;gt;/dev/null; then&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; AWKCMD="nawk"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;fi&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;# Iterate through each line of ps output...&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;for LINE in `$PSCMD $ZONEPARAM $PSARGS`; do&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PID=`echo $LINE | $AWKCMD '{print $1}'`&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Check that this line isn't the header, and it's valid in /proc&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if [ "$PID" != "PID" -a -f "/proc/$PID/status" ]; then&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # use ucb/ps to get full, non-truncated command+args&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if [[ "$SOLVERSION" == *"11"* ]]; then&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CMD=`/usr/bin/ps awwx $PID | tail +2 | $AWKCMD '{$1="";$2="";$3="";$4="";print $0}'`&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CMD=`/usr/ucb/ps -awwx $PID | tail +2 | $AWKCMD '{$1="";$2="";$3="";$4="";print $0}'`&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fi&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # tack on the command+args to the output&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo $LINE $CMD&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;fi&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;done&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Dec 2017 20:12:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959291#M58980</guid>
      <dc:creator>Paul Ciarfella</dc:creator>
      <dc:date>2017-12-06T20:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Solaris 11 active process discovery without /usr/ucb</title>
      <link>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959292#M58981</link>
      <description>&lt;P&gt;I sure wish Oracle would document this BSD compatibility mode (/usr/bin/ps awwx), and if it's available starting with the first rev of v11.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Dec 2017 20:21:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/solaris-11-active-process-discovery-without-usr-ucb/m-p/959292#M58981</guid>
      <dc:creator>jimfreeman</dc:creator>
      <dc:date>2017-12-06T20:21:36Z</dc:date>
    </item>
  </channel>
</rss>

