HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Passing environment variable to SWA
Operating System - HP-UX
1832252
Members
2816
Online
110041
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
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
10-17-2008 05:56 AM
10-17-2008 05:56 AM
Passing environment variable to SWA
Hello all,
I'm new to SWA and trying to setup a process by which we can monitor multiple systems.
I'm currently attempting to pass a hostname to SWA using an environment variable so that the resulting output files can be uniquely identified (ex._swa_analisys.xml).
Is there a way to do this other than writing a wrapper script that will invoke SWA with comand line options (ex. -x analisyz_file=${1}_swa_analisys.xml) where an environment variable or parameter can be actualized?
Here are my current results:
# grep SWA_HOST /etc/opt/swa/swa.conf
analysis_file = ${user_dir}/cache/${SWA_HOST}_swa_analysis.xml
html_report = ${user_dir}/report/${SWA_HOST}_swa_report.html
# export SWA_HOST=romulus
# echo $SWA_HOST
romulus
# var/opt/swa/cache/swa_inventory_3481069612.xml <
======= 10/17/08 10:32:47 ADT#Canada#Canada BEGIN anada Run "analyze" Step
(user=boucherr) (jobid=romulus)
NOTE: SWA_HOST is not set.
WARNING: Variable SWA_HOST Undefined
* Performing Analysis
NOTE: SWA_HOST is not set.
WARNING: Variable SWA_HOST Undefined
======= 10/17/08 10:33:21 ADT#Canada#Canada END anada Run "analyze" Step
succeeded with 2 warnings. (user=boucherr) (jobid=romulus)
NOTE: More information may be found in the Software Assistant logfile
"/var/opt/swa/swa.log".
[boucherr@romulus] /var/opt/swa/cache $ ll -tr
total 24496
-rw-r--r-- 1 root sys 10375067 Oct 7 16:53 swa_catalog.xml
-rw-r--r-- 1 root sys 675493 Oct 16 11:43 swa_inventory_3481069612.xml
-rw------- 1 root sys 72249 Oct 17 10:33 _swa_analysis.xml
[boucherr@romulus] /var/opt/swa/cache $
Thanks
RayB
I'm new to SWA and trying to setup a process by which we can monitor multiple systems.
I'm currently attempting to pass a hostname to SWA using an environment variable so that the resulting output files can be uniquely identified (ex.
Is there a way to do this other than writing a wrapper script that will invoke SWA with comand line options (ex. -x analisyz_file=${1}_swa_analisys.xml) where an environment variable or parameter can be actualized?
Here are my current results:
# grep SWA_HOST /etc/opt/swa/swa.conf
analysis_file = ${user_dir}/cache/${SWA_HOST}_swa_analysis.xml
html_report = ${user_dir}/report/${SWA_HOST}_swa_report.html
# export SWA_HOST=romulus
# echo $SWA_HOST
romulus
# var/opt/swa/cache/swa_inventory_3481069612.xml <
======= 10/17/08 10:32:47 ADT#Canada#Canada BEGIN anada Run "analyze" Step
(user=boucherr) (jobid=romulus)
NOTE: SWA_HOST is not set.
WARNING: Variable SWA_HOST Undefined
* Performing Analysis
NOTE: SWA_HOST is not set.
WARNING: Variable SWA_HOST Undefined
======= 10/17/08 10:33:21 ADT#Canada#Canada END anada Run "analyze" Step
succeeded with 2 warnings. (user=boucherr) (jobid=romulus)
NOTE: More information may be found in the Software Assistant logfile
"/var/opt/swa/swa.log".
[boucherr@romulus] /var/opt/swa/cache $ ll -tr
total 24496
-rw-r--r-- 1 root sys 10375067 Oct 7 16:53 swa_catalog.xml
-rw-r--r-- 1 root sys 675493 Oct 16 11:43 swa_inventory_3481069612.xml
-rw------- 1 root sys 72249 Oct 17 10:33 _swa_analysis.xml
[boucherr@romulus] /var/opt/swa/cache $
Thanks
RayB
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2008 04:05 PM
10-17-2008 04:05 PM
Re: Passing environment variable to SWA
This may fail if SWA communicates with a demon, one that has already been started and can't possibly see your new environment variables.
Also, if /etc/opt/swa/swa.conf isn't a shell script, it won't do the substitutions.
So your wrapper idea seem like the only solution.
Also, if /etc/opt/swa/swa.conf isn't a shell script, it won't do the substitutions.
So your wrapper idea seem like the only solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2008 08:13 AM
10-20-2008 08:13 AM
Re: Passing environment variable to SWA
Yup,
I had thought that it would be permissable from references to ${user_dir} in the swa.conf file but it doesn't work so I developped a little script that works just file so far. Here it is if interested:
#!/usr/bin/ksh
#
# name swa_check.sh
#
# purpose To perform a security check on a given UNIX server
# and download required patches
#
# usage /usr/local/bin/swa_check.sh
#
# configuration See default configuration in /etc/opt/swa/swa.conf
# the -x options below override the configuration file
#
# history Oct 2008 new
#
#######################################################################
swa report -x catalog=/var/opt/swa/cache/swa_catalog.xml \
-x inventory_source=ssh://root@${1} \
-x analysis_file=/var/opt/swa/cache/${1}_swa_analysis.xml \
-x html_report=/var/opt/swa/report/${1}_swa_report.html \
-x download_cmd='/usr/bin/ssh swauser@dell curl'
swa get -t /var/opt/swa/cache/${1}_`date +%y%j`_depot \
-x analysis_file=/var/opt/swa/cache/${1}_swa_analysis.xml \
-x download_cmd='/usr/bin/ssh boucherr@stealthdell curl'
#
I had thought that it would be permissable from references to ${user_dir} in the swa.conf file but it doesn't work so I developped a little script that works just file so far. Here it is if interested:
#!/usr/bin/ksh
#
# name swa_check.sh
#
# purpose To perform a security check on a given UNIX server
# and download required patches
#
# usage /usr/local/bin/swa_check.sh
#
# configuration See default configuration in /etc/opt/swa/swa.conf
# the -x options below override the configuration file
#
# history Oct 2008 new
#
#######################################################################
swa report -x catalog=/var/opt/swa/cache/swa_catalog.xml \
-x inventory_source=ssh://root@${1} \
-x analysis_file=/var/opt/swa/cache/${1}_swa_analysis.xml \
-x html_report=/var/opt/swa/report/${1}_swa_report.html \
-x download_cmd='/usr/bin/ssh swauser@dell curl'
swa get -t /var/opt/swa/cache/${1}_`date +%y%j`_depot \
-x analysis_file=/var/opt/swa/cache/${1}_swa_analysis.xml \
-x download_cmd='/usr/bin/ssh boucherr@stealthdell curl'
#
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