- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script to get the report of the process r...
Operating System - HP-UX
1748013
Members
3786
Online
108757
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
Discussions
Discussions
Forums
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
тАО03-30-2011 12:04 PM
тАО03-30-2011 12:04 PM
Re: Script to get the report of the process running in 30 Servers
Thank you all your help ..I was able to do completed the script as foollows
while read HOST
do
ssh -n ${HOST} hostname
ssh -n ${HOST} ps aux | grep -v root
done < /home/binu/scripts/hostnames 1> /home/binu/scripts/output 2>&
Thanks
-Binu
while read HOST
do
ssh -n ${HOST} hostname
ssh -n ${HOST} ps aux | grep -v root
done < /home/binu/scripts/hostnames 1> /home/binu/scripts/output 2>&
Thanks
-Binu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2011 12:14 PM
тАО03-30-2011 12:14 PM
Re: Script to get the report of the process running in 30 Servers
> ssh -n ${HOST} hostname
What does that tell you that you didn't
already know?
What does that tell you that you didn't
already know?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2011 12:29 PM
тАО03-30-2011 12:29 PM
Re: Script to get the report of the process running in 30 Servers
This entry made to update the output file with hostname and then the Process details ..Other wise we cannot make out which process is from which server
Looks like this
cpaiqp4a
USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND
tauser02 1396842 0.9 9.0 1385060 1385096 - A Mar 22 824:12 /opt/isv/WAS51
tauser02 3653858 0.4 9.0 1380776 1380812 - A Mar 22 350:33 /opt/isv/WAS51
www 4370646 0.1 2.0 283820 283588 - A Feb 28 243:21 /opt/isv/IBMIH
tauser02 4788304 0.0 1.0 136920 136956 - A Feb 28 55:44 /opt/isv/WAS51
Looks like this
cpaiqp4a
USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND
tauser02 1396842 0.9 9.0 1385060 1385096 - A Mar 22 824:12 /opt/isv/WAS51
tauser02 3653858 0.4 9.0 1380776 1380812 - A Mar 22 350:33 /opt/isv/WAS51
www 4370646 0.1 2.0 283820 283588 - A Feb 28 243:21 /opt/isv/IBMIH
tauser02 4788304 0.0 1.0 136920 136956 - A Feb 28 55:44 /opt/isv/WAS51
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2011 01:04 PM
тАО03-30-2011 01:04 PM
Re: Script to get the report of the process running in 30 Servers
> This entry made to update the output file
> with hostname [...]
Something simple (and local) might be faster:
echo ${HOST}
You're giving the name of the remote host to
"ssh", so that you can ask the remote host to
tell you its name? (I can imagine cases
where you might get a different answer back,
but none seems very likely.)
If you really want the name from the remote
host, do you need two "ssh" sessions?
> ssh -n ${HOST} ps aux | grep -v root
That does the "ps" on the other system, but
it does the "grep" locally, doesn't it? I
haven't tested it, but I'd try to do all the
work on the remote system:
ssh -n ${HOST} 'ps aux | grep -v root'
And, if that worked, then I'd try something
like:
[...] 'hostname ; ps aux | grep [...]'
in _one_ "ssh" command.
> with hostname [...]
Something simple (and local) might be faster:
echo ${HOST}
You're giving the name of the remote host to
"ssh", so that you can ask the remote host to
tell you its name? (I can imagine cases
where you might get a different answer back,
but none seems very likely.)
If you really want the name from the remote
host, do you need two "ssh" sessions?
> ssh -n ${HOST} ps aux | grep -v root
That does the "ps" on the other system, but
it does the "grep" locally, doesn't it? I
haven't tested it, but I'd try to do all the
work on the remote system:
ssh -n ${HOST} 'ps aux | grep -v root'
And, if that worked, then I'd try something
like:
[...] 'hostname ; ps aux | grep [...]'
in _one_ "ssh" command.
- « Previous
-
- 1
- 2
- Next »
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP