LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 08-02-2008, 03:12 PM   #1
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 259

Rep: Reputation: 30
Script required for Top usage remotely


Hi

As I would like to know the script or command by which I can get below mentioned o/ps from all solaris servers remotely, without login into all servers. Note : the below o/p is from top command.

load averages: 1.14, 1.07, 0.91 16:03:53
87 processes: 85 sleeping, 2 on cpu
CPU states: 58.2% idle, 32.6% user, 9.1% kernel, 0.0% iowait, 0.0% swap
Memory: 2048M real, 367M free, 390M swap in use, 2076M swap free



Thanks
Rajan

Last edited by rajaniyer123; 08-02-2008 at 03:25 PM.
 
Old 08-03-2008, 01:32 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Top isn't bundled with Solaris. Assuming you have it installed on all hosts, you can run a script like that one:
Code:
for i in server1 server2 server3
do
  echo ==== $i ====
  ssh $i /usr/local/bin/top | head -4
done
You also need to have public key authentication configured for the user running the script to avoid password prompting.

If you do not care about security, you can use rsh instead of ssh.
 
Old 08-08-2008, 08:52 AM   #3
Rowley
Member
 
Registered: Jul 2008
Distribution: Solaris 10, OpenSolaris, CentOS 5
Posts: 40

Rep: Reputation: 15
Why not use something like nagios instead? If you really must go the remote script route and you are using solaris 8 or above, use prstat instead, its footprint is much lighter.
 
Old 08-09-2008, 11:37 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
prstat doesn't displays the set of statistics the OP is asking for. You would need a combination of several standard commands to provide them.
 
Old 08-10-2008, 06:37 AM   #5
Rowley
Member
 
Registered: Jul 2008
Distribution: Solaris 10, OpenSolaris, CentOS 5
Posts: 40

Rep: Reputation: 15
OK fair enough. Still, I wouldn't bother with top on a solaris box as it'll further skew any stats you get back. Also, he's probably got the system activity reporter service running in the background anyway so no harm in using sar too, e.g.
Code:
prstat -t 1 1 | grep -v ^$; sar -r 1 1
If you're running sol 10 then you can get even better, more specific results using dtrace.

Anyway, what do you do with all this ascii once you've collected it? Save yourself some time in the long run and install some decent monitoring software. You'll also find that historical data and decent graphing tools will help you catch problems before they become and issue. My two pennies worth anyway...

Last edited by Rowley; 08-10-2008 at 06:38 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU usage from top jr8rdt Linux - Newbie 10 08-17-2011 06:46 AM
Memory usage using TOP FantaJ Linux - Newbie 2 03-05-2008 12:35 PM
Usage of top twantrd Solaris / OpenSolaris 2 11-17-2004 07:36 PM
Blasting one distro to put another one on top, remotely... LiquidKernel Linux - General 1 12-28-2003 10:04 AM
Question re: 'top' and mem usage... pistonhonda Linux - Newbie 6 11-16-2003 02:12 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 12:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration