<?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 Script help, parsing files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-parsing-files/m-p/3023664#M909643</link>
    <description>I have a little suite of scripts that perform the system alerting on my HP-UX, Solaris &amp;amp; AIX servers. &lt;BR /&gt;&lt;BR /&gt;Although the scripts work fine (they create an XML file that is ftp'd to a Wndows-hosted Web server for an alarm console) I'm struggling to get the system easily distributable. I'm finding that I'm customising some of the individual alert scripts on each host, whilst others are generic in nature and can be safely shipped-out to each platform (using rdist).&lt;BR /&gt;&lt;BR /&gt;Here's an example of what I mean. In one script I have the file systems checked, and an array is initialised with a list of the file systems to check;&lt;BR /&gt;&lt;BR /&gt;set -A FS / /stand /var /var/spool /var/opt /var/adm /usr /opt /home /logs /apps /data/psdata04 /data/psdata03 /data/psdata02 /reports/psreports01 /backup/psbackup01&lt;BR /&gt;&lt;BR /&gt;The obvious downside is I am hard-coding this list into each example of the alert script, and near enough each of my servers are different.&lt;BR /&gt;&lt;BR /&gt;What I'd like to do is have a global configuration text file I could send out to each server, containing all of the parameters that the scripts could check, with a tag to indicate the server name. i.e. &lt;BR /&gt;&lt;BR /&gt;serverA  / /var/ /usr /opt /u00 /u01 &lt;BR /&gt;serverB / /stand /etc/ /var /usr /data /home&lt;BR /&gt;serverC / /var /usr /etc /var/spool&lt;BR /&gt;&lt;BR /&gt;So the question is; does anyone have any pointers or examples of initialising ksh arrays from the contents of text files with a unique identifier (even a line number)?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Brendan&lt;BR /&gt;</description>
    <pubDate>Tue, 15 Jul 2003 06:26:29 GMT</pubDate>
    <dc:creator>Brendan Newport_2</dc:creator>
    <dc:date>2003-07-15T06:26:29Z</dc:date>
    <item>
      <title>Script help, parsing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-parsing-files/m-p/3023664#M909643</link>
      <description>I have a little suite of scripts that perform the system alerting on my HP-UX, Solaris &amp;amp; AIX servers. &lt;BR /&gt;&lt;BR /&gt;Although the scripts work fine (they create an XML file that is ftp'd to a Wndows-hosted Web server for an alarm console) I'm struggling to get the system easily distributable. I'm finding that I'm customising some of the individual alert scripts on each host, whilst others are generic in nature and can be safely shipped-out to each platform (using rdist).&lt;BR /&gt;&lt;BR /&gt;Here's an example of what I mean. In one script I have the file systems checked, and an array is initialised with a list of the file systems to check;&lt;BR /&gt;&lt;BR /&gt;set -A FS / /stand /var /var/spool /var/opt /var/adm /usr /opt /home /logs /apps /data/psdata04 /data/psdata03 /data/psdata02 /reports/psreports01 /backup/psbackup01&lt;BR /&gt;&lt;BR /&gt;The obvious downside is I am hard-coding this list into each example of the alert script, and near enough each of my servers are different.&lt;BR /&gt;&lt;BR /&gt;What I'd like to do is have a global configuration text file I could send out to each server, containing all of the parameters that the scripts could check, with a tag to indicate the server name. i.e. &lt;BR /&gt;&lt;BR /&gt;serverA  / /var/ /usr /opt /u00 /u01 &lt;BR /&gt;serverB / /stand /etc/ /var /usr /data /home&lt;BR /&gt;serverC / /var /usr /etc /var/spool&lt;BR /&gt;&lt;BR /&gt;So the question is; does anyone have any pointers or examples of initialising ksh arrays from the contents of text files with a unique identifier (even a line number)?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Brendan&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Jul 2003 06:26:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-parsing-files/m-p/3023664#M909643</guid>
      <dc:creator>Brendan Newport_2</dc:creator>
      <dc:date>2003-07-15T06:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script help, parsing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-parsing-files/m-p/3023665#M909644</link>
      <description>Hi Brendan,&lt;BR /&gt;&lt;BR /&gt;Try something like:&lt;BR /&gt;for FS in `grep "^$( hostname )" hosts.cfg | cut -f2-`&lt;BR /&gt;do&lt;BR /&gt;process_host&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Ollie.</description>
      <pubDate>Tue, 15 Jul 2003 06:52:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-parsing-files/m-p/3023665#M909644</guid>
      <dc:creator>Ollie R</dc:creator>
      <dc:date>2003-07-15T06:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script help, parsing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-parsing-files/m-p/3023666#M909645</link>
      <description>Nice one Ollie!&lt;BR /&gt;&lt;BR /&gt;I'd made my script a little too complex with the use of the array (at the time it fitted the bill).&lt;BR /&gt;&lt;BR /&gt;Now I have a distributable text file with all the values for all the servers I want to monitor.&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Jul 2003 12:01:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-parsing-files/m-p/3023666#M909645</guid>
      <dc:creator>Brendan Newport_2</dc:creator>
      <dc:date>2003-07-15T12:01:18Z</dc:date>
    </item>
  </channel>
</rss>

