- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: executing commands across systems
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-07-2000 11:42 AM
11-07-2000 11:42 AM
I have 5 C class machines that I am required to check different information on daily. I such check is the logical volume sizes. I wrote a script to work on one of the systems. It executes a bdf -i, checks for the existence of certain files, and checks for a process. All results are written to a log file. I can run this script in the mornings then more the log file to check the results.
What I want to be able to do is when the script runs, execute the needed commands on each system, but write the output to the logfile on the machine that contains the corn job for this script.
Any suggestions?
Thanks,
Ron
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2000 11:54 AM
11-07-2000 11:54 AM
SolutionFor example you can set up .rhosts file to have an entry as shown below, in the home directory of "bill" with 744 permissions.
+jim
So that "jim" from any machine can login to the system as "bill".
Once it is setup you can use the command in your script as
remsh saturn -l bill -n " bdf |...." >logfile.
Where saturn is the remote-hostname.
Here the logfie is created in the current machine where the cron/script is setup to run.
Hope this helps.
...Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2000 12:26 PM
11-07-2000 12:26 PM
Re: executing commands across systems
Different options for the environment you are in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2000 12:26 PM
11-07-2000 12:26 PM
Re: executing commands across systems
1. You may want run your files localy then create a local logfile.
2. rcp the your files to your central server
3. append all files to one big log file "# cat smallfile >> bigfile".
-fnhalili
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2000 12:57 PM
11-07-2000 12:57 PM
Re: executing commands across systems
I just want to interject one comment. If you are using the direction symbols (>> or >) within your remote script, you won't get any output in the log that the remsh command is writing to. The only thing that remsh is able to direct to an output log is standard out. You can get around this by removing the direction symbols from your remote script or just add a cat statement to the end of your remote script. The information will then be piped back through the remsh command into the remsh log.
Hope this helps,
Josef
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2000 10:55 PM
11-07-2000 10:55 PM
Re: executing commands across systems
So you dont have to copy the logfiles between the machines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2000 11:38 PM
11-07-2000 11:38 PM
Re: executing commands across systems
Eveything has been said about the .rhosts files configuration, so I imagine they are OK.
As long as your script is writing to stdout you may write a simple loop as the following:
for host in SYS1 SYS2 SYS3 SYS4 SYS5
do
remsh $host "/foo/bar/your_script -arguments" >> /localdir/logfile
done
The command to be executed is between quotes.
The redirection being outside the quotes will be applied locally. The double (>>) sign is needed otherwise your file will be overwritten each time.
You could redirect this way as well:
for host in SYS1 SYS2 SYS3 SYS4 SYS5
do
remsh $host "/foo/bar/your_script -arguments"
done > /localdir/logfile
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2000 12:50 AM
11-08-2000 12:50 AM