HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script help, parsing files
Operating System - HP-UX
1833924
Members
3243
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2003 11:26 PM
07-14-2003 11:26 PM
I have a little suite of scripts that perform the system alerting on my HP-UX, Solaris & AIX servers.
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).
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;
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
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.
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.
serverA / /var/ /usr /opt /u00 /u01
serverB / /stand /etc/ /var /usr /data /home
serverC / /var /usr /etc /var/spool
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)?
Regards
Brendan
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).
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;
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
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.
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.
serverA / /var/ /usr /opt /u00 /u01
serverB / /stand /etc/ /var /usr /data /home
serverC / /var /usr /etc /var/spool
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)?
Regards
Brendan
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2003 11:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2003 05:01 AM
07-15-2003 05:01 AM
Re: Script help, parsing files
Nice one Ollie!
I'd made my script a little too complex with the use of the array (at the time it fitted the bill).
Now I have a distributable text file with all the values for all the servers I want to monitor.
I'd made my script a little too complex with the use of the array (at the time it fitted the bill).
Now I have a distributable text file with all the values for all the servers I want to monitor.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP