- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script to get the report of the process runni...
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-29-2011 02:10 PM
тАО03-29-2011 02:10 PM
I need you valuable belp in creating a script that will login 30 servers and create a report of the process run by users other that root.
Regards
-Binu
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2011 02:36 PM
тАО03-29-2011 02:36 PM
SolutionWhat have you tried?
I suggest using 'ssh -n
Something driven like:
while read HOST
do
ssh -n ${HOST} ps -ef
done < /home/binu/hostnames
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2011 05:53 AM
тАО03-30-2011 05:53 AM
Re: Script to get the report of the process running in 30 Servers
for this you will need at least the following:
- a file containing the name of the servers
- ssh keyed access (you don't want to type all the passwords per hand, do you?)
anyway, a while loop would do this, see above...
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2011 06:06 AM
тАО03-30-2011 06:06 AM
Re: Script to get the report of the process running in 30 Servers
Where can I mention the host file details in the the script
Regards
-Binu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2011 06:10 AM
тАО03-30-2011 06:10 AM
Re: Script to get the report of the process running in 30 Servers
it is in the last line, where you specify that file. in our case it's /home/binu/hostnames :
#
while read HOST
do
ssh -n ${HOST} ps -ef
done < /home/binu/hostnames
#
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2011 06:15 AM
тАО03-30-2011 06:15 AM
Re: Script to get the report of the process running in 30 Servers
> Where can I mention the host file details in the the script
The file that I showed in my example --- '/home/binu/hostnames' simply consists of a server's hostname, one name per line of the file.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2011 06:23 AM
тАО03-30-2011 06:23 AM
Re: Script to get the report of the process running in 30 Servers
Where will be the output of ps -ef get stored ..Is it possible to store the output of ps -ef of all servers in a single file.
Regards
-Binu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2011 06:30 AM
тАО03-30-2011 06:30 AM
Re: Script to get the report of the process running in 30 Servers
yes, use redirection:
while read HOST
do
ssh -n ${HOST} ps -ef
done < /home/binu/hostnames 1> /home/binu/output 2>&1
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2011 07:41 AM
тАО03-30-2011 07:41 AM
Re: Script to get the report of the process running in 30 Servers
and Is there way to arrange the output file according to the hostname
Regards
-Binu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2011 11:37 AM
тАО03-30-2011 11:37 AM
Re: Script to get the report of the process running in 30 Servers
If you don't know how to do this, I personally described this process at least in 10 different posts. Look at my answer history and find one of those. It is not hard but it needs precise execution for file ownerships and permissions.
Or search google for creating shh keys for passwordless login and you will find a tgon of documents explaining how to do this.
UNIX because I majored in cryptology...