{"id":19287,"date":"2016-05-30T07:54:29","date_gmt":"2016-05-30T12:54:29","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=19287"},"modified":"2022-06-03T03:42:53","modified_gmt":"2022-06-03T08:42:53","slug":"basic-system-monitoring-tools-in-centos-7","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/basic-system-monitoring-tools-in-centos-7\/","title":{"rendered":"Basic system monitoring tools in CentOS 7"},"content":{"rendered":"
<\/p>\n
In this post, we are going to show you how to use the basic system monitoring tools on a Linux VPS running CentOS 7 as operating system.
\n<\/p>\n
Determining which processes are running, the amount of free memory on your system as well as the free SSD storage available to use is crucial when configuring the system. One of the basic system monitoring tools which is available on all Linux systems is The output of the command will provide you with information such as the process owner, ID of the process, CPU and memory usage, the time or date when the process was started, etc. The output should be similar to the one below:<\/p>\n For more usage examples and options visit the man page:<\/p>\n The next useful tool for system monitoring is To terminate the utility, enter To determine the memory usage, run the following command:<\/p>\n The Visit the man page for more information and usage options:<\/p>\n Next, the The output should look like the one below:<\/p>\n The man page will provide you with additional information about the usage.<\/p>\n The last tool we are going to write about is Sample output:<\/p>\n To learn more about the Of course you don\u2019t have to do any of this if you use one of our CentOS 7 VPS hosting<\/a> services, in which case you can simply ask our expert Linux admins to help you determine the resource usage on your server. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n PS<\/span><\/strong>. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In this post, we are going to show you how to use the basic system monitoring tools on a Linux … <\/p>\nps<\/code>. The
ps<\/code> command will report a snapshot of the current processes running on your CentOS VPS<\/a> and will display information about a selection of active processes. The
ps<\/code>\u00a0command has many different options which can be mixed. In many situations,
ps aux<\/code> will provide you with all the information you need.<\/p>\n
# ps aux<\/pre>\n
# ps aux\r\nUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND\r\nroot 1 0.5 0.2 41220 3660 ? Ss 08:53 0:00 init -z\r\nroot 2 0.0 0.0 0 0 ? S 08:53 0:00 [kthreadd]\r\nroot 3 0.0 0.0 0 0 ? S 08:53 0:00 [khelper]\r\nroot 65 0.0 0.1 36768 1820 ? Ss 08:53 0:00 \/usr\/lib\/systemd\/systemd-journald\r\nroot 73 0.0 0.1 41600 1700 ? Ss 08:53 0:00 \/usr\/lib\/systemd\/systemd-udevd\r\nroot 103 0.0 0.0 24224 1536 ? Ss 08:53 0:00 \/usr\/lib\/systemd\/systemd-logind\r\nroot 109 0.0 0.1 293512 2608 ? Ssl 08:53 0:00 \/usr\/sbin\/rsyslogd -n\r\ndbus 112 0.0 0.1 26548 1680 ? Ss 08:53 0:00 \/bin\/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation\r\nroot 137 0.0 0.2 82504 3576 ? Ss 08:53 0:00 \/usr\/sbin\/sshd -D\r\n...<\/pre>\n
# man ps<\/pre>\n
top<\/code>. Similarly to
ps<\/code>,
top<\/code> displays the Linux processes running on your server in real-time but the output is dynamic. Run
top<\/code> to check the output:<\/p>\n
# top\r\ntop - 09:01:41 up 8 min, 0 users, load average: 0.00, 0.00, 0.00\r\nTasks: 32 total, 1 running, 31 sleeping, 0 stopped, 0 zombie\r\n%Cpu(s): 0.2 us, 0.0 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st\r\nKiB Mem : 1572864 total, 1318572 free, 28772 used, 225520 buff\/cache\r\nKiB Swap: 0 total, 0 free, 0 used. 1331552 avail Mem\r\n\r\n PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND\r\n 718 root 20 0 155404 2144 1540 R 0.3 0.1 0:00.05 top\r\n 1 root 20 0 41220 3660 2276 S 0.0 0.2 0:00.25 systemd\r\n 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd\r\n 3 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper\r\n 65 root 20 0 36768 1820 1540 S 0.0 0.1 0:00.02 systemd-journal\r\n 73 root 20 0 41600 1700 1272 S 0.0 0.1 0:00.00 systemd-udevd\r\n 103 root 20 0 24224 1540 1292 S 0.0 0.1 0:00.00 systemd-logind\r\n 109 root 20 0 293512 2608 2008 S 0.0 0.2 0:00.00 rsyslogd<\/pre>\n
q<\/code>. To sort the list by memory or CPU usage, enter
M<\/code> or
P<\/code> respectively. The man page of
top<\/code> will provide you with additional information about the usage.<\/p>\n
# man top<\/pre>\n
# free -m<\/pre>\n
free<\/code> command will display amount of free and used memory in the system in megabytes. It will provide you with information about the total amount of memory, the amount of memory which is used, free, shared, cached and available. The
free<\/code> command will provide you with information about the swap space too.<\/p>\n
# free -m\r\n total used free shared buff\/cache available\r\nMem: 1536 31 1282 136 221 1296\r\nSwap: 0 0 0\r\n<\/pre>\n
# man free<\/pre>\n
df<\/code> command will display a report of the file system disk space usage. To view the information in human readable format, run:<\/p>\n
# df -h<\/pre>\n
# df -h\r\nFilesystem Size Used Avail Use% Mounted on\r\n\/dev\/simfs 30G 1.9G 29G 7% \/\r\ndevtmpfs 768M 0 768M 0% \/dev\r\ntmpfs 768M 0 768M 0% \/dev\/shm\r\ntmpfs 768M 8.1M 760M 2% \/run\r\ntmpfs 768M 0 768M 0% \/sys\/fs\/cgroup<\/pre>\n
# man df<\/pre>\n
du<\/code>. This command will display an estimate file space usage. For example, to display the total space usage of the \/home directory, you can use the following command:<\/p>\n
# du -sxch \/home\/<\/pre>\n
# du -sxch \/home\/\r\n391M \/home\/\r\n391M total\r\n<\/pre>\n
du<\/code> command and the other usage options, visit the man page:<\/p>\n
# man du<\/pre>\n
\n