From http://tech.sina.com.cn/focus/FreeBSD/1999-11-26/99.shtml
FreeBSD provides a wealth of tools to view the system status. You can use them to understand the system status and optimize the system performance. These tools usually read/dev/MEM and/dev/kmem to obtain system information in the memory, and convert the variables in the information into names using/kernel. The most basic command for viewing system status is ps, which is used to report the status of processes running in the current system.
Pstat can display the number of files opened in the system, the usage of switching devices, and other system information. Pstat uses the/dev/MEM device file by default to read the data from the system memory, or you can specify a core file, so pstat reads data from the file. You also need to give pstat a parameter to tell pstat that the system information should be displayed. Generally, "pstat-F" is used to display the list of opened files, "pstat-s" shows the current status of the switch device, and "pstat-T" shows the status of the currently used terminal device file, "pstat-V" shows the current status of the activated v node. "Pstat-T" shows the status of these system tables, including the currently used and available system tablespaces. Therefore, it can be used to check the system's system tables under the current load, helps optimize system performance.
$ Pstat-T
69/8232 files
4 Mbps/137 Mbps swap space
Vmstat reports kernel statistics, including processes, virtual storage, processors, and disks. You can use the "-W" parameter to specify the number of seconds to report the system status.
$ Vmstat
Procs Memory Page disks faults CPU
R B W AVM fre FLT re PI Po fr Sr wd0 wd1 fd0 in SY CS us Sy ID
0 0 0 3752 30476 643 0 0 19 43 0 0 0 262 85 56 3 41
Other commands similar to vmstat include fstat, which reports the information of files opened in the system. You can use the file name, process number, user name, and the file system where the specified file is located to restrict the files to be displayed. Iostat reports Kernel Input and Output statistics, including the I/O status of disks, terminals, and other devices. Netstat Reports Network statistics. Nfsstat displays NFS statistics.
In addition, systat displays various system statistics in full screen mode. By default, systat reports the CPU usage, including the overall utilization status, idle usage, and utilization of various processes. By specifying parameters, systat can also perform I/O statistics, inventory statistics, and network statistics. These parameters include-iostat,-vmstat,-mbufs,-netstat,-IP, -ICMP,-TCP,-swap, etc.
/0/1/2/3/4/5/6/7/8/9/10
Load average |
/0/10/20/30/40/50/60/70/80/90/100
Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Root xf86_s3.cx xxxxxxx
WB kpanel xxx
WB kfm xx
WB kbgndwm xx
WB kblankscrn
WB krootwm
WB kwm
In addition to the commands provided by these systems, FreeBSD also provides a variety of effective system tools, such as the top ps, memory at, and vmst at functions. These software can be used in a variety of UNIX systems and is also a very common tool. You can also install the network management proxy snmpd In the FreeBSD system, and then use the network management system to obtain various system information of the FreeBSD host through the network.