寻找在Solaris中非常简单的事情。
我有一台安装了很多区域的Solaris机器(所以不仅是主机,还包括可用的总区域),我想要看到:
- 可用、已使用和空闲的总内存。
- 可用、已使用和空闲的总交换空间。
我是个 Linux 操作系统的人,在 Linux 中 top 命令可以提供所有这些信息。那么在 Solaris 中该怎么做呢?
注意:我不能安装任何命令,请告诉我使用操作系统安装时自带的基本命令。
寻找在Solaris中非常简单的事情。
我有一台安装了很多区域的Solaris机器(所以不仅是主机,还包括可用的总区域),我想要看到:
我是个 Linux 操作系统的人,在 Linux 中 top 命令可以提供所有这些信息。那么在 Solaris 中该怎么做呢?
注意:我不能安装任何命令,请告诉我使用操作系统安装时自带的基本命令。
你需要的是prstat命令 - 它和top命令类似,但是为了得到想要的结果需要设置一些开关。例如,使用prstat -L可以查看线程。
显示结果非常类似于top命令。如果你需要完全像top那样的显示结果,那么你需要将这些东西脚本化。Linux是BSD,而Solaris是System V,两者相差甚远。
通常来说,Unix Rosetta Stone可以帮助您找到“在某个Unix系统中类似于zzz的xxx命令”的方法:
撞击
prstat -Z
查看每个区域消费的所有信息
其中一个是prtdiag
。其他像vmstat
、iostat
也值得一看。
prstat -aZ
查看 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 报告有关进程和用户的信息。在此模式下,prstat同时显示有关进程和用户的单独报告。