Linux systems have some basic commands that can be used for server monitoring.
For a brief introduction, the specific usage can be viewed or consulted by –help
Network: ifconfig, netstat Disk: df CPU:w Process: ps Memory: free I/O: iostat ifconfig< Br>
Enter ifconfig, the output is:
eth0: flags=4163 mtu 1500 inet 10.144.81.226 netmask 255.255.240.0 broadcast 10.144.95.255 ether 00:16:3e:02:04:ba txqueuelen 1000 (Ethernet) RX packets 69775 bytes 91364566 (87.1 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 26057 bytes 1937311 (1.8 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73 mtu 65536 inet 127.0 .0.1 netmask 255.0.0.0 loop txqueuelen 0 (Local Loopback) RX packets 286 bytes 32054 (31.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 286 bytes 32054 (31.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0The result shows the number of NICs, IP addresses, and MAC addresses of the server. , Where the size of the MTU, the packet transceiver card. ethX (x is 0,1,2……), there are several NICs; inet is the IP address, netmask is the subnet mask, and broadcast is the broadcast address
netstatnetstat Is a command to view network related data,
Active Internet connections (servers and established)Proto Recv-Q Send-Q Local Address Foreign Address State Timertcp 0 0 127.0.0.1:8005 0.0.0.0:* LISTEN off ( 0.$tcp 0 0 0.0.0.0:8009 0.0.0.0:* LISTEN off (0.$tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN off (0.$tcp 0 0 0.0.0.0:8080 0.0 .0.0:* LISTEN off (0.$tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN off (0.$tcp 0 0 115.28.204.58:58433 42.156.166.25:80 ESTABLISHED off (0.$tcp 0 52 115.28.204.58:22 59.71.67.114:21489 ESTABLISHED on (0.4$udp 0 0 115.28.204.58:123 0.0.0. 0:* off (0.$udp 0 0 10.144.81.226:123 0.0.0.0:* off (0.$udp 0 0 127.0.0.1:123 0.0.0.0:* off (0.$udp 0 0 0.0.0.0 :123 0.0.0.0:* off (0.$udp6 0 0 :::123 :::*can be used to view all network layer connections on the server.
wThe w command is used to view the load of the server. Enter w and the command output is as follows:
16:59:52 up 4 days, 18:20, 1 user, load Average: 0.09, 0.04, 0.05USER TTY LOGIN@ IDLE JCPU PCPU WHATroot pts/0 16:51 0.00s 0.06s 0.00swThe result includes the server's runtime (4 days, 18:20), number of users, current The user and its running program, the load average three values are the average load of 1 minute, 5 minutes, 10 minutes.
The system counts the number of tasks currently running in the system and the number of tasks waiting for disk I/O every 5 seconds. The average value is calculated every 1 minute, 5 minutes, and 10 minutes. This value is the average load.
dfThe df command is used to view the disk. Enter df -h
Filesystem Size Used Avail Use% Mounted on/dev/xvda1 40G 2.1G 36G 6% /devtmpfs 489M 0 489M 0% /devtmpfs 497M 0 497M 0% /dev/shmtmpfs 497M 19M 478M 4% /runtmpfs 497M 0 497M 0% /sys/fs/cgrouptmpfs 100M 0 100M 0% /run/user/0Disk usage, directory of mounted disks, etc.
freefree command to view memory status
total used free shared buffers cachedMem: 1016656 940168 76488 19384 114052 543612-/+ buffers/cache: 282504 734152Swap: 0 0 0can see the total memory size, used memory and remaining memory.
swap is a swap partition, which can be understood as virtual memory
iostatio is I/O. This command is used to output I/O related data. Enter iostat -x
Linux 3.10.0-123.9.3.el7.x86_64 (iZ28yqvmjkrZ) 03/20/2016 _x86_64_ (1 CPU) avg-cpu: %user %nice %system %iowait %steal %idle 0.19 0.00 0.13 0.06 0.16 99.47Device: rrqm/s wrqm/sr/sw/s rkB/s wkB/s avgrq-sz avgqu-sz a$xvda 0.00 0.17 0.10 0.33 0.94 5.14 28.83 0.01 2$Device represents the disk device Data
psThis command is used to view process information. Enter ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMANDroot 1 0.0 0.3 188792 3804 ? Ss Mar15 0:10 /usr/lib/systemd/syste$root 2 0.0 0.0 0 0 ? S Mar15 0:00 [kthreadd]root 3 0.0 0.0 0 0 ? S Mar15 0:01 [ksoftirqd/0]root 5 0.0 0.0 0 0 ? S< Mar15 0:00 [kworker/0:0H]root 7 0.0 0.0 0 0 ? S Mar15 0:00 [migration/0]root 8 0.0 0.0 0 0 ? S Mar15 0:00 [rcu_bh]root 9 0.0 0.0 0 0 ? S Mar15 0:00 [rcuob/0]……The usage of the process identifier, CPU, memory, etc. can be output.
There are a lot of ps parameters, remember a few commonly used, and then consult the data when there are special needs
My computer has two hard drives, one solid state drive (sda) installed win7, another ordinary hard d
First find the iptables file Generally under /etc/sysconfig Then vi iptables Just like add
One: ssh schematic is: 1, is to allow the use of ssh between two Linux machines does not require a
Linux Weblogic related environment variable setting
Small note IptabLes and IptabLex virus cleanup process
Under Linux, how can ordinary users temporarily obtain root privileges?
Linux download artifact aMule installation tutorial
Linux pipeline and redirection detailed
Detailed explanation of Linux commands find
Linux remote synchronization data tool rsync
Detailed sort order command under Linux
How to restore to the old system
Enable IE multi-threading to speed up downloads
Transparent Windows 2008 system status changes
Win10 set the mouse main button tips
How to lock the screen of Win10 system
Win10 more than a month how to restore win7 win10 back win7 more than January solution
Solve IE "Does this page be allowed to access the clipboard?" Tip
Win7 boot press F8 can not enter safe mode how to do
How to speed up the operation of CorelDRAW X7 under Win7 system?