<?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: How to retrieve system values for use within script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465192#M774158</link>
    <description>All great answers and observations.  I'm developing a number std out files and will monitor for specific values and message back any questionable metrics. &lt;BR /&gt;The process will be a cron job on each server, reporting back centrally. &lt;BR /&gt;&lt;BR /&gt;Kofi, et all,  The idea of centrally polling the servers for the same metrics sounds great.  Any ideas on how that might be accomplished would be great!!&lt;BR /&gt;&lt;BR /&gt;Thanks again for the support&lt;BR /&gt;&lt;BR /&gt;Dave</description>
    <pubDate>Fri, 17 Nov 2000 21:31:49 GMT</pubDate>
    <dc:creator>David Fosgate_1</dc:creator>
    <dc:date>2000-11-17T21:31:49Z</dc:date>
    <item>
      <title>How to retrieve system values for use within script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465184#M774150</link>
      <description>As a newbie to the Unix script language I'm not sure how to retrieve the server name within script. Or how to retrieve system values for use within the script.   The script I'm writing for reporting system status will be run on 9 servers. I would like to include the server name in the messaging sent to operations when there is a problem.&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;&lt;BR /&gt;Dave&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Nov 2000 19:20:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465184#M774150</guid>
      <dc:creator>David Fosgate_1</dc:creator>
      <dc:date>2000-11-16T19:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve system values for use within script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465185#M774151</link>
      <description>David:&lt;BR /&gt;&lt;BR /&gt;Here's two forms:&lt;BR /&gt;&lt;BR /&gt;# X="I am $(hostname)"&lt;BR /&gt;# Y="I am `hostname`"&lt;BR /&gt;&lt;BR /&gt;Either will work.  Both X and Y hold the same string.  The "X" form is the POSIX "preference".&lt;BR /&gt;&lt;BR /&gt;Regards.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 16 Nov 2000 19:32:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465185#M774151</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-11-16T19:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve system values for use within script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465186#M774152</link>
      <description>To get various parameters, you can issue the system command and the command is in back-ticks.&lt;BR /&gt;&lt;BR /&gt;Example:  HOST=`hostname`&lt;BR /&gt;echo $HOST&lt;BR /&gt;&lt;BR /&gt;OS=`uname -s`&lt;BR /&gt;echo $OS&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Nov 2000 19:53:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465186#M774152</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2000-11-16T19:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve system values for use within script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465187#M774153</link>
      <description>Which shell are you using?  If it is the POSIX - HP-UX's default shell - or Korn shell, all of the previous suggestions will work fine.  If the C or Bourne shell is being used, then the $(cmd) syntax will not work.  The "backticks" should work in all 4 shells.</description>
      <pubDate>Thu, 16 Nov 2000 20:13:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465187#M774153</guid>
      <dc:creator>Bruce Regittko_1</dc:creator>
      <dc:date>2000-11-16T20:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve system values for use within script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465188#M774154</link>
      <description>David:&lt;BR /&gt;&lt;BR /&gt;my favorite for capturing host name information is:&lt;BR /&gt;&lt;BR /&gt;uname -a | read OS HOST VER DUMMY&lt;BR /&gt;echo $HOST $OS - $VER&lt;BR /&gt;&lt;BR /&gt;Some advise.  rather than have each server monitor itself, how about letting a central server probe your list of servers and send a message if there is a problem with one of them?&lt;BR /&gt;&lt;BR /&gt;I find that if you rely on each server to report its failure(?) when mail on that server fails, how will it get its message to operations?</description>
      <pubDate>Thu, 16 Nov 2000 20:14:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465188#M774154</guid>
      <dc:creator>Kofi ARTHIABAH</dc:creator>
      <dc:date>2000-11-16T20:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve system values for use within script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465189#M774155</link>
      <description>David:&lt;BR /&gt;&lt;BR /&gt;This is how I do it:&lt;BR /&gt;&lt;BR /&gt;var=`hostname`&lt;BR /&gt;echo $var&lt;BR /&gt;&lt;BR /&gt;(where var is your variable name)&lt;BR /&gt;&lt;BR /&gt;Hope this helps</description>
      <pubDate>Thu, 16 Nov 2000 20:34:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465189#M774155</guid>
      <dc:creator>Maureen Gunkel</dc:creator>
      <dc:date>2000-11-16T20:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve system values for use within script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465190#M774156</link>
      <description>David:&lt;BR /&gt;&lt;BR /&gt;For variety, here's another variation of Kofi's post:&lt;BR /&gt;&lt;BR /&gt;# uname -a|awk '{print $1,$2,$3}'&lt;BR /&gt;&lt;BR /&gt;This will echo the first 3-fields or the OS, HOSTNAME and VERSION returned from uname.&lt;BR /&gt;&lt;BR /&gt;Or, to capture this in a variable, and then echo it, do:&lt;BR /&gt;&lt;BR /&gt;# X=`uname -a|awk '{print $1,$2,$3}'`&lt;BR /&gt;# echo $X&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 16 Nov 2000 20:41:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465190#M774156</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-11-16T20:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve system values for use within script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465191#M774157</link>
      <description>&amp;gt;&amp;gt;For variety, here's another variation of &amp;gt;&amp;gt;Kofi's post: &lt;BR /&gt;&amp;gt;&amp;gt;# uname -a|awk '{print $1,$2,$3}' &lt;BR /&gt;&amp;gt;&amp;gt;This will echo the first 3-fields or the OS, &amp;gt;&amp;gt;HOSTNAME and VERSION returned from uname. &lt;BR /&gt;&amp;gt;&amp;gt;Or, to capture this in a variable, and then &amp;gt;&amp;gt;echo it, do: &lt;BR /&gt;&amp;gt;&amp;gt;# X=`uname -a|awk '{print $1,$2,$3}'` &lt;BR /&gt;&amp;gt;&amp;gt;# echo $X &lt;BR /&gt;&lt;BR /&gt;Another way, similar to James' above but without awk -&lt;BR /&gt;&lt;BR /&gt;% uname -a&lt;BR /&gt;HP-UX alba B.10.20 A 9000/778 2015484926 two-user license&lt;BR /&gt;% uname -s -n -r&lt;BR /&gt;HP-UX alba B.10.20&lt;BR /&gt;% &lt;BR /&gt;&lt;BR /&gt;So,&lt;BR /&gt;% X=$(uname -snr) &lt;BR /&gt;% echo $X&lt;BR /&gt;HP-UX alba B.10.20&lt;BR /&gt;%&lt;BR /&gt;&lt;BR /&gt;Or&lt;BR /&gt;&lt;BR /&gt;% X=`uname -snr`&lt;BR /&gt;&lt;BR /&gt;will get the same thing.  &lt;BR /&gt;% man uname &lt;BR /&gt;will show you allot of options.&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;&lt;BR /&gt;Jay&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Nov 2000 20:46:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465191#M774157</guid>
      <dc:creator>Jay Gaffney_4</dc:creator>
      <dc:date>2000-11-17T20:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve system values for use within script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465192#M774158</link>
      <description>All great answers and observations.  I'm developing a number std out files and will monitor for specific values and message back any questionable metrics. &lt;BR /&gt;The process will be a cron job on each server, reporting back centrally. &lt;BR /&gt;&lt;BR /&gt;Kofi, et all,  The idea of centrally polling the servers for the same metrics sounds great.  Any ideas on how that might be accomplished would be great!!&lt;BR /&gt;&lt;BR /&gt;Thanks again for the support&lt;BR /&gt;&lt;BR /&gt;Dave</description>
      <pubDate>Fri, 17 Nov 2000 21:31:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-retrieve-system-values-for-use-within-script/m-p/2465192#M774158</guid>
      <dc:creator>David Fosgate_1</dc:creator>
      <dc:date>2000-11-17T21:31:49Z</dc:date>
    </item>
  </channel>
</rss>

