- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to retrieve system values for use within s...
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
11-16-2000 11:20 AM
11-16-2000 11:20 AM
Thanks
Dave
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2000 11:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2000 11:53 AM
11-16-2000 11:53 AM
Re: How to retrieve system values for use within script
Example: HOST=`hostname`
echo $HOST
OS=`uname -s`
echo $OS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2000 12:13 PM
11-16-2000 12:13 PM
Re: How to retrieve system values for use within script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2000 12:14 PM
11-16-2000 12:14 PM
Re: How to retrieve system values for use within script
my favorite for capturing host name information is:
uname -a | read OS HOST VER DUMMY
echo $HOST $OS - $VER
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?
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2000 12:34 PM
11-16-2000 12:34 PM
Re: How to retrieve system values for use within script
This is how I do it:
var=`hostname`
echo $var
(where var is your variable name)
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2000 12:41 PM
11-16-2000 12:41 PM
Re: How to retrieve system values for use within script
For variety, here's another variation of Kofi's post:
# uname -a|awk '{print $1,$2,$3}'
This will echo the first 3-fields or the OS, HOSTNAME and VERSION returned from uname.
Or, to capture this in a variable, and then echo it, do:
# X=`uname -a|awk '{print $1,$2,$3}'`
# echo $X
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2000 12:46 PM
11-17-2000 12:46 PM
Re: How to retrieve system values for use within script
>># uname -a|awk '{print $1,$2,$3}'
>>This will echo the first 3-fields or the OS, >>HOSTNAME and VERSION returned from uname.
>>Or, to capture this in a variable, and then >>echo it, do:
>># X=`uname -a|awk '{print $1,$2,$3}'`
>># echo $X
Another way, similar to James' above but without awk -
% uname -a
HP-UX alba B.10.20 A 9000/778 2015484926 two-user license
% uname -s -n -r
HP-UX alba B.10.20
%
So,
% X=$(uname -snr)
% echo $X
HP-UX alba B.10.20
%
Or
% X=`uname -snr`
will get the same thing.
% man uname
will show you allot of options.
Enjoy,
Jay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2000 01:31 PM
11-17-2000 01:31 PM
Re: How to retrieve system values for use within script
The process will be a cron job on each server, reporting back centrally.
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!!
Thanks again for the support
Dave