19

Looking for a very simple thing to do in Solaris.

I have a solaris box which has lot of zones ( so not only the host box, also the total available including zones ), i would want to see

  • What is the total memory available, used and free.
  • What is the total swap available, used, and free.

Am a linux guy, top gives me everything in Linux. What is the command to do it in Solaris.

Note: I cannot install any commands, so please tell me with the basic available commands that ship with OS installation.

thegeek
  • 2,388
  • 2
  • 13
  • 10
  • 1
    i think this question is very on topic. most programming at some point requires examining running processes and RAM available to determine whether something is frozen, in an infinite loop, etc. i needed this while trying to build an open source project on solaris. i think its a great question. – don bright Sep 27 '15 at 15:41

4 Answers4

22

You really want prstat - it does what top does, but it can take setting some switches to get what you want. For example prstat -L for lwp's.

The display is very much like top. And if you require to look like top exactly then you will have to script things together. Linux is BSD, Solaris is system V. A different world.

In general, the the unix rosetta stone helps finding 'commands like xxx from zzz on yyy unix':

http://bhami.com/rosetta.html

jim mcnamara
  • 16,005
  • 2
  • 34
  • 51
11

hit

prstat -Z 

to see all information about each zone consumption

sumana
  • 149
  • 2
  • 8
3

One of them is prtdiag. Others like vmstat, iostat also worth taking a look

ghostdog74
  • 327,991
  • 56
  • 259
  • 343
  • no above command is exact... I require it straight forward, like 1GB memory available 780 MB used. 2GB swap available, 200 MB used. Or atleast give me exact commands which can give me a good idea of available and used. prtdiag -v shows available memory. ( but where to find currently used [ including all zones ] ?! ) vmstat shows available swap. ( but where to find current usage ?! ) +1 for am able to see all available now. – thegeek Jul 15 '10 at 09:30
  • top is available for Solaris also, and current usage, do some shell scripting and calculate that value yourself. – Anders Jul 17 '10 at 22:01
1

prstat -aZ

Review prstat

Name prstat– report active process statistics Synopsis prstat [-acHJLmRrtTv] [-d u | d] [-C psrsetlist] [-h lgrplist] [-j projlist] [-k tasklist] [-n ntop[,nbottom]] [-p pidlist] [-P cpulist] [-s key | -S key ] [-u euidlist] [-U uidlist] [-z zoneidlist] [-Z] [interval [count]] Description The prstat utility iteratively examines all active processes on the system and reports statistics based on the selected output mode and sort order. prstat provides options to examine only processes matching specified PIDs, UIDs, zone IDs, CPU IDs, and processor set IDs.

The -j, -k, -C, -p, -P, -u, -U, and -z options accept lists as arguments. Items in a list can be either separated by commas or enclosed in quotes and separated by commas or spaces.

If you do not specify an option, prstat examines all processes and reports statistics sorted by CPU usage.

Options The following options are supported:

-a Report information about processes and users. In this mode prstat displays separate reports about processes and users at the same time.

phoxis
  • 60,131
  • 14
  • 81
  • 117
Tri Trinh
  • 43
  • 1
  • 1
  • 5