- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script help
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
Discussions
Discussions
Forums
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
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
тАО03-17-2005 12:42 AM
тАО03-17-2005 12:42 AM
I would like to create a script that i can run from one HPUX server that will run "dmesg", output this and then telnet to another server and run "dmesg" etc... then put it to a file that i can print or look at.. by doing this, i will be able to run once and review nightly.
my question is, how do i, in a script log into another server, run the command, then log into another etc.... is this possible?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2005 12:48 AM
тАО03-17-2005 12:48 AM
SolutionNow, after this , you can run a command like ...
for i in servera serverb serverc serverd
do
echo -------------------
echo Server $i
echo -------------------
ssh $i "/usr/sbin/dmesg"
echo --------------------
done >> dmesg_log_file
This will contact each server run dmesg on each and put the results in "dmesg_log_file".
Quite simple really - once you've got ssh working and configured.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2005 12:48 AM
тАО03-17-2005 12:48 AM
Re: script help
see man remsh
Run a remote shell and command
see also
www.shelldorado.com for learning
ex
hostname;remsh topaz -n pwd
xserv3
/usershome/steves
Local hostname then login dir on other machine topaz
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2005 12:50 AM
тАО03-17-2005 12:50 AM
Re: script help
alternative to Chris's ssh is using remsh (which will need files seting up on each server) or expect (downloadable, but you can then mimic telnet sessions).
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2005 03:24 AM
тАО03-17-2005 03:24 AM
Re: script help
what do you mean? echo what in this space..?
sorry, i am really bad at scripting. it's quite new to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2005 04:50 AM
тАО03-17-2005 04:50 AM
Re: script help
echo just that, 'print what I am putting here.'
This print can be on screen or to a file or to error.
I would suggest you go with ssh instead of remsh. Once you have it setup on systems you can avoid ever using the remsh/telnet/ftp commands again - these are all substituted in ssh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2005 05:00 AM
тАО03-17-2005 05:00 AM
Re: script help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2005 05:10 AM
тАО03-17-2005 05:10 AM
Re: script help
What data do you want to gather?
dmesg is overwritten with time...so eventually - the data that you are looking for will be gone - until you reboot...
Better to get dat via an utility - like /opt/ignite/bin/print_manifest
or cfg2html or sysinfo301
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2005 05:49 AM
тАО03-17-2005 05:49 AM
Re: script help
the buffer is full, it overwrites the earliest log. So a
better solution would be start a cron job that will run
once in every (say) 60 minutes and append it in a
file. The cron job should email this file once every
day.
Make sure that the cron job runs
# dmesg -
(dmesg with a dash as an argument). This will print
out only incremental dmesg logs.
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2005 07:28 AM
тАО03-17-2005 07:28 AM
Re: script help
Then use the syslogd utility, which is already running to log the messages that you want to that common log area.
All you will need to do is add a line to your /etc/syslog.conf file to log these messages to the log file
Sample line from syslog.conf
*.crit /nfsmountpoint/logs/syslog.glogal.crit
*.info;*.alert /nfsmountpoint/logs/syslog.general
restart syslogd by
/sbin/init.d/syslogd stop
/sbin/init.d/syslogd start
good luck