{"id":5720,"date":"2016-06-21T10:51:32","date_gmt":"2016-06-21T07:51:32","guid":{"rendered":"http:\/\/www.karadere.com\/blog\/?p=5720"},"modified":"2016-06-21T13:44:04","modified_gmt":"2016-06-21T10:44:04","slug":"ubuntu-sistem-monitor-how-do-you-monitor-your-systems-health","status":"publish","type":"post","link":"https:\/\/www.karadere.com\/blog\/ubuntu-sistem-monitor-how-do-you-monitor-your-systems-health.html","title":{"rendered":"Ubuntu sistem monitor. How Do You Monitor Your System&#8217;s Health?"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"http:\/\/design.ubuntu.com\/wp-content\/uploads\/ubuntu-logo14.png\" width=\"540\" height=\"243\" \/><\/p>\n<h3>Ubuntu ile command line shell den cpu dik ve sistem performanslar\u0131n\u0131 kontrol etmek ?<\/h3>\n<h3><strong>How Do You Monitor Your System&#8217;s Health?<\/strong><\/h3>\n<p>Every computer system benefits from proper administration and monitoring. Keeping an eye on how your system is running will help you discover issues and resolve them quickly.<\/p>\n<p>There are plenty of command line utilities created for this purpose. This guide will introduce you to some of the most helpful applications to have in your toolbox.<\/p>\n<h3><strong>Table of Contents<\/strong><\/h3>\n<ol>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#process\">How Do I Monitor Process Utilization?<\/a>\n<ul>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#top\">top<\/a><\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#htop\">htop<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#network\">How Do I Find Out Which Program Is Using My Bandwidth?<\/a>\n<ul>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#nethogs\">nethogs<\/a><\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#iptraf\">IPTraf<\/a><\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#netstat\">netstat<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#disk\">How Do I Find Out How Much Disk Space I Have Left?<\/a>\n<ul>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#df\">df<\/a><\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#du\">du<\/a><\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#improvements\">Improvements<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#memory\">How Do I Find Out How Much of my Memory Is In Use?<\/a>\n<ul>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#free\">free<\/a><\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#vmstat\">vmstat<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources#conclusion\">Conclusion<\/a><\/li>\n<\/ol>\n<div data-unique=\"how-do-i-monitor-process-utilization\"><\/div>\n<h2 id=\"process\">How Do I Monitor Process Utilization?<\/h2>\n<h3 id=\"top\"><strong>top<\/strong><\/h3>\n<p>One of the most common tools for checking the resource utilization of processes is &#8220;<strong>top<\/strong>&#8220;.<\/p>\n<p>Top provides a simple, real-time table of your processes, with the largest consumers on top:<\/p>\n<pre>top<\/pre>\n<pre>top - 14:45:52 up 29 min,  1 user,  load average: 0.10, 0.09, 0.06\r\nTasks:  56 total,   1 running,  55 sleeping,   0 stopped,   0 zombie\r\nCpu(s):  0.0%us,  0.3%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st\r\nMem:   1019600k total,   393756k used,   625844k free,    11136k buffers\r\nSwap:        0k total,        0k used,        0k free,   316748k cached\r\n\r\n  PID %MEM  VIRT SWAP  RES CODE DATA  SHR nFLT nDRT S  PR  NI %CPU COMMAND     \r\n  832  1.3 32364  18m  12m  896  11m 1688    1    0 S  20   0  0.0 bash         \r\n  820  0.4 89456  83m 4008  488  948 3040   12    0 S  20   0  0.0 sshd         \r\n  812  0.3 49948  46m 2828  488  616 2216    0    0 S  20   0  0.0 sshd         \r\n    1  0.2 24192  21m 2108  152  868 1300   23    0 S  20   0  0.0 init         \r\n  400  0.1  243m 242m 1420  344 216m 1084    0    0 S  20   0  0.0 rsyslogd<\/pre>\n<p>The top portion has some system statistics, including load averages for the past minute, 5 minutes, and 15 minutes. It also shows memory and swap usage, and the count of various process states.<\/p>\n<p>The bottom portion has every process on the system, organized by the top users of resources. This list is updated in real-time.<\/p>\n<h3 id=\"htop\"><strong>htop<\/strong><\/h3>\n<p>Although &#8220;top&#8221; is included in almost every distribution by default, an improved version, called &#8220;<strong>htop<\/strong>&#8221; is available for download from most repositories.<\/p>\n<p>To install htop on Ubuntu, type the following:<\/p>\n<pre>sudo apt-get install htop<\/pre>\n<p>Running htop, we can see that it has a similar output, but is colorized, and is more interactive:<\/p>\n<pre>htop<\/pre>\n<pre>CPU[|                         0.7%]     Tasks: 21, 3 thr; 1 running\r\n  Mem[|||||||||||||         64\/995MB]     Load average: 0.00 0.02 0.05 \r\n  Swp[                         0\/0MB]     Uptime: 00:37:37\r\n\r\n  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command\r\n 2752 root       20   0 25660  1876  1364 R  0.0  0.2  0:00.06 htop\r\n    1 root       20   0 24192  2108  1300 S  0.0  0.2  0:00.55 \/sbin\/init\r\n  312 root       20   0 17224   640   444 S  0.0  0.1  0:00.04 upstart-udev-brid\r\n  314 root       20   0 21592  1360   760 S  0.0  0.1  0:00.04 \/sbin\/udevd --dae\r\n  394 messagebu  20   0 23808   688   436 S  0.0  0.1  0:00.01 dbus-daemon --sys\r\n  401 syslog     20   0  243M  1420  1084 S  0.0  0.1  0:00.07 rsyslogd -c5\r\n  402 syslog     20   0  243M  1420  1084 S  0.0  0.1  0:00.00 rsyslogd -c5<\/pre>\n<p>The top portion is much easier to read and the bottom portion is organized in a more clear fashion.<\/p>\n<p>Here are some keys that will help you use htop more effectively:<\/p>\n<ul>\n<li><strong>M<\/strong>: Sort processes by memory usage<\/li>\n<li><strong>P<\/strong>: Sort processes by processor usage<\/li>\n<li><strong>?<\/strong>: Access help<\/li>\n<li><strong>k<\/strong>: Kill current\/tagged process<\/li>\n<li><strong>F2<\/strong>: Setup htop. You can choose display options here.<\/li>\n<li><strong>\/<\/strong>: Search processes<\/li>\n<\/ul>\n<p>There are plenty of more options you that you can access through help or setup. These should be your first stops in exploring htop&#8217;s functionality.<\/p>\n<div data-unique=\"how-do-i-find-out-which-program-is-using-my-bandwidth\"><\/div>\n<h2 id=\"network\">How Do I Find Out Which Program Is Using My Bandwidth?<\/h2>\n<h3 id=\"nethogs\"><strong>nethogs<\/strong><\/h3>\n<p>If your network connection seems saturated and you are unsure which application is the culprit, a program called &#8220;<strong>nethogs<\/strong>&#8221; is a good choice for finding out.<\/p>\n<p>On Ubuntu, you can install nethogs with the following command:<\/p>\n<pre>sudo apt-get install nethogs<\/pre>\n<p>We can run it by simply typing:<\/p>\n<pre>nethogs<\/pre>\n<pre>NetHogs version 0.8.0\r\n\r\n  PID USER     PROGRAM                      DEV        SENT      RECEIVED       \r\n3379  root     \/usr\/sbin\/sshd               eth0       0.485       0.182 KB\/sec\r\n820   root     sshd: root@pts\/0             eth0       0.427       0.052 KB\/sec\r\n?     root     unknown TCP                             0.000       0.000 KB\/sec\r\n\r\n  TOTAL                                                0.912       0.233 KB\/sec<\/pre>\n<p>As you can see, above all, nethogs output is simple. It associates each application with its associated network traffic.<\/p>\n<p>There are only a few commands that you can use to control net hogs:<\/p>\n<ul>\n<li><strong>m<\/strong>: Change displays between &#8220;kb\/s&#8221;, &#8220;kb&#8221;, &#8220;b&#8221;, and &#8220;mb&#8221;.<\/li>\n<li><strong>r<\/strong>: Sort by traffic received.<\/li>\n<li><strong>s<\/strong>: Sort by traffic sent.<\/li>\n<li><strong>q<\/strong>: quit<\/li>\n<\/ul>\n<p>Although this is a simple tool, nethogs is a great way to associate traffic with a specific applications.<\/p>\n<h3 id=\"iptraf\"><strong>IPTraf<\/strong><\/h3>\n<p><strong>IPTraf<\/strong> is another great way to monitor network traffic. It provides a number of different interactive monitoring interfaces.<\/p>\n<p>On Ubuntu, you can install IPTraf with the following command:<\/p>\n<pre>sudo apt-get install iptraf<\/pre>\n<p>To run the program, simply call it from the command line with root privileges:<\/p>\n<pre>sudo iptraf<\/pre>\n<pre>                      ???????????????????????????????????\r\n                      ? IP traffic monitor              ?\r\n                      ? General interface statistics    ?\r\n                      ? Detailed interface statistics   ?\r\n                      ? Statistical breakdowns...       ?\r\n                      ? LAN station monitor             ?\r\n                      ???????????????????????????????????\r\n                      ? Filters...                      ?\r\n                      ???????????????????????????????????\r\n                      ? Configure...                    ?\r\n                      ???????????????????????????????????\r\n                      ? Exit                            ?\r\n                      ???????????????????????????????????<\/pre>\n<p>With this menu, you can select which interface you would like to access.<\/p>\n<p>For example, to get an overview of all network traffic, we can select the first menu and then &#8220;All interfaces&#8221;. It will give you a screen that looks like this:<\/p>\n<pre>IPTraf\r\n? TCP Connections (Source Host:Port) ?????????? Packets ??? Bytes Flags  Iface ?\r\n??192.241.xxx.xxx:22                          &gt;     369     82420 -PA-   eth0  ?\r\n??72.43.xxx.xxx:49488                         &gt;     381     19860 --A-   eth0  ?\r\n?                                                                              ?\r\n?                                                                              ?<\/pre>\n<p>Here, you can see what IP addresses you are communicating on all of your network interfaces.<\/p>\n<p>If you would like to have those IP addresses resolved into domains, you can enable reverse DNS lookup by exiting the traffic screen, selecting &#8220;Configure&#8221; and then selecting &#8220;<em>Reverse DNS lookups<\/em>&#8220;.<\/p>\n<p>You can also enable &#8220;<em>TCP\/UDP service names<\/em>&#8221; to display using the names of the services instead of the port.<\/p>\n<p>With both of these options enabled, the display may look like this:<\/p>\n<pre> TCP Connections (Source Host:Port) ?????????? Packets ??? Bytes Flags  Iface ?\r\n??192.241.xxx.xxx:ssh                         &gt;     151     34924 -PA-   eth0  ?\r\n??rrcs-72-43-xxx-xxx.nyc.biz.rr.co:49488      &gt;     155      8108 --A-   eth0  ?\r\n?                                                                              ?\r\n?                                                                              ?\r\n?                                                                              ?\r\n?                                                                              ?\r\n?                                                                              ?\r\n?                                                                              ?\r\n?                                                                              ?\r\n?                                                                              ?\r\n?                                                                              ?\r\n?                                                                              ?\r\n? TCP:      1 entries ???????????????????????????????????????????????? Active ??\r\n????????????????????????????????????????????????????????????????????????????????\r\n? UDP (72 bytes) from 192.241.xxx.xxx:43463 to 8.8.8.8:domain on eth0          ?\r\n? UDP (66 bytes) from 192.241.xxx.xxx:53140 to 8.8.8.8:domain on eth0          ?\r\n? UDP (135 bytes) from 8.8.8.8:domain to 192.241.xxx.xxx:41429 on eth0         ?\r\n? UDP (119 bytes) from 8.8.8.8:domain to 192.241.xxx.xxx:43463 on eth0         ?\r\n? UDP (110 bytes) from google-public-dns-a.googl:domain to 192.241.xxx.xxx:531 ?<\/pre>\n<p>There are several other interfaces to investigate on your own.<\/p>\n<h3 id=\"netstat\"><strong>netstat<\/strong><\/h3>\n<p>The &#8220;<strong>netstat<\/strong>&#8221; command is a versatile tool for gathering network information. It is extremely flexible and powerful.<\/p>\n<p>By default, netstat prints a list of open sockets:<\/p>\n<pre>netstat<\/pre>\n<pre>Active Internet connections (w\/o servers)\r\nProto Recv-Q Send-Q Local Address           Foreign Address         State      \r\ntcp        0      0 192.241.187.204:ssh     ip223.hichina.com:50324 ESTABLISHED\r\ntcp        0      0 192.241.187.204:ssh     rrcs-72-43-115-18:50615 ESTABLISHED\r\nActive UNIX domain sockets (w\/o servers)\r\nProto RefCnt Flags       Type       State         I-Node   Path\r\nunix  5      [ ]         DGRAM                    6559     \/dev\/log\r\nunix  3      [ ]         STREAM     CONNECTED     9386     \r\nunix  3      [ ]         STREAM     CONNECTED     9385     \r\n. . .<\/pre>\n<p>If we add an &#8220;-a&#8221; option, it will list all ports, listening and non-listening:<\/p>\n<pre>netstat -a<\/pre>\n<pre>Active Internet connections (servers and established)\r\nProto Recv-Q Send-Q Local Address           Foreign Address         State      \r\ntcp        0      0 *:ssh                   *:*                     LISTEN     \r\ntcp        0      0 192.241.187.204:ssh     rrcs-72-43-115-18:50615 ESTABLISHED\r\ntcp6       0      0 [::]:ssh                [::]:*                  LISTEN     \r\nActive UNIX domain sockets (servers and established)\r\nProto RefCnt Flags       Type       State         I-Node   Path\r\nunix  2      [ ACC ]     STREAM     LISTENING     6195     @\/com\/ubuntu\/upstart\r\nunix  2      [ ACC ]     STREAM     LISTENING     7762     \/var\/run\/acpid.socket\r\nunix  2      [ ACC ]     STREAM     LISTENING     6503     \/var\/run\/dbus\/system_bus_socket\r\n. . .<\/pre>\n<p>If you&#8217;d like to filter to see only TCP or UDP connections, use the &#8220;-t&#8221; or &#8220;-u&#8221; flags respectively:<\/p>\n<pre>netstat -at<\/pre>\n<pre>Active Internet connections (servers and established)\r\nProto Recv-Q Send-Q Local Address           Foreign Address         State      \r\ntcp        0      0 *:ssh                   *:*                     LISTEN     \r\ntcp        0      0 192.241.187.204:ssh     rrcs-72-43-115-18:50615 ESTABLISHED\r\ntcp6       0      0 [::]:ssh                [::]:*                  LISTEN<\/pre>\n<p>See statistics by passing the &#8220;-s&#8221; flag:<\/p>\n<pre>netstat -s<\/pre>\n<pre>Ip:\r\n    13500 total packets received\r\n    0 forwarded\r\n    0 incoming packets discarded\r\n    13500 incoming packets delivered\r\n    3078 requests sent out\r\n    16 dropped because of missing route\r\nIcmp:\r\n    41 ICMP messages received\r\n    0 input ICMP message failed.\r\n    ICMP input histogram:\r\n        echo requests: 1\r\n        echo replies: 40\r\n. . .<\/pre>\n<p>If you would like to continuously update the output, you can use the &#8220;-c&#8221; flag.<\/p>\n<p>There are many other options that can change the output. Explore the man pages for more ideas.<\/p>\n<div data-unique=\"how-do-i-find-out-how-much-disk-space-i-have-left\"><\/div>\n<h2 id=\"disk\">How Do I Find Out How Much Disk Space I Have Left?<\/h2>\n<h3 id=\"df\"><strong>df<\/strong><\/h3>\n<p>For a quick overview of how much disk space you have left on your drives, you can use the &#8220;<strong>df<\/strong>&#8221; program.<\/p>\n<p>Without any options, its output looks like this:<\/p>\n<pre>df<\/pre>\n<pre>Filesystem     1K-blocks    Used Available Use% Mounted on\r\n\/dev\/vda        31383196 1228936  28581396   5% \/\r\nudev              505152       4    505148   1% \/dev\r\ntmpfs             203920     204    203716   1% \/run\r\nnone                5120       0      5120   0% \/run\/lock\r\nnone              509800       0    509800   0% \/run\/shm<\/pre>\n<p>This outputs disk usage in bytes, which may be a bit hard to read.<\/p>\n<p>To fix this problem, we can specify to output in a human-readable format:<\/p>\n<pre>Filesystem      Size  Used Avail Use% Mounted on\r\n\/dev\/vda         30G  1.2G   28G   5% \/\r\nudev            494M  4.0K  494M   1% \/dev\r\ntmpfs           200M  204K  199M   1% \/run\r\nnone            5.0M     0  5.0M   0% \/run\/lock\r\nnone            498M     0  498M   0% \/run\/shm<\/pre>\n<p>If we want to see the total disk space available on all filesystems, we can pass the &#8220;&#8211;total&#8221; option. This will add a row at the bottom with summary information:<\/p>\n<pre>df -h --total<\/pre>\n<pre>Filesystem      Size  Used Avail Use% Mounted on\r\n\/dev\/vda         30G  1.2G   28G   5% \/\r\nudev            494M  4.0K  494M   1% \/dev\r\ntmpfs           200M  204K  199M   1% \/run\r\nnone            5.0M     0  5.0M   0% \/run\/lock\r\nnone            498M     0  498M   0% \/run\/shm\r\ntotal            32G  1.2G   29G   4%<\/pre>\n<h3 id=\"du\"><strong>du<\/strong><\/h3>\n<p>While df is an easy way of geting an overview, &#8220;<strong>du<\/strong>&#8221; gives a better picture of what is taking up space on your system.<\/p>\n<p>The command will analyze usage for the current directory and any subdirectories. The default output of du looks like this:<\/p>\n<pre>du<\/pre>\n<pre>4\t.\/.cache\r\n8\t.\/.ssh\r\n28\t.<\/pre>\n<p>Once again, we can specify human-readable output by passing it &#8220;-h&#8221;:<\/p>\n<pre>du -h<\/pre>\n<pre>4.0K\t.\/.cache\r\n8.0K\t.\/.ssh\r\n28K\t.<\/pre>\n<p>To see file sizes as well as directories, type the following:<\/p>\n<pre>du -a<\/pre>\n<pre>0\t.\/.cache\/motd.legal-displayed\r\n4\t.\/.cache\r\n4\t.\/.ssh\/authorized_keys\r\n8\t.\/.ssh\r\n4\t.\/.profile\r\n4\t.\/.bashrc\r\n4\t.\/.bash_history\r\n28\t.<\/pre>\n<p>For a total at the bottom, you can add the &#8220;-c&#8221; option:<\/p>\n<pre>du -c<\/pre>\n<pre>4\t.\/.cache\r\n8\t.\/.ssh\r\n28\t.\r\n28\ttotal<\/pre>\n<p>If you are only interested in the total and not the specifics, you can issue:<\/p>\n<pre>du -s<\/pre>\n<pre>28\t.<\/pre>\n<h3 id=\"improvements\"><strong>Improvements<\/strong><\/h3>\n<p>These two tools have improved versions that can be installed on Ubuntu.<\/p>\n<p>An improved version of df is &#8220;<strong>pydf<\/strong>&#8220;. It can be installed with this command:<\/p>\n<pre>sudo apt-get install pydf<\/pre>\n<p>The pydf command organizes everything in neat charts with colorized output. It shows disk usage graphically with usage bars:<\/p>\n<pre>pydf -a<\/pre>\n<pre>dev\/vda     30G 1200M   27G  3.9 [........] \/                       \r\nudev        493M 4096B  493M  0.0 [........] \/dev                    \r\ndevpts         0     0     0    - [........] \/dev\/pts                \r\nproc           0     0     0    - [........] \/proc                   \r\ntmpfs       199M  204k  199M  0.1 [........] \/run                    \r\nnone       5120k     0 5120k  0.0 [........] \/run\/lock               \r\nnone        498M     0  498M  0.0 [........] \/run\/shm\r\n. . .<\/pre>\n<p>An improvement on du is &#8220;<strong>ncdu<\/strong>&#8220;. This command can be installed by typing:<\/p>\n<pre>sudo apt-get install ncdu<\/pre>\n<p>This command uses an interactive ncurses display to graphically represent your disk usage:<\/p>\n<pre>ncdu<\/pre>\n<pre>--- \/root ----------------------------------------------------------------------\r\n    8.0KiB [##########] \/.ssh                                                   \r\n    4.0KiB [#####     ] \/.cache\r\n    4.0KiB [#####     ]  .bashrc\r\n    4.0KiB [#####     ]  .profile\r\n    4.0KiB [#####     ]  .bash_history<\/pre>\n<p>You can step through the filesystem by using the up and down arrows and pressing &#8220;enter&#8221; on any directory entry.<\/p>\n<div data-unique=\"how-do-i-find-out-how-much-of-my-memory-is-in-use\"><\/div>\n<h2 id=\"memory\">How Do I Find Out How Much of my Memory Is In Use?<\/h2>\n<h3 id=\"free\"><strong>free<\/strong><\/h3>\n<p>The easiest way of finding out the current memory usage on your system is using the &#8220;<strong>free<\/strong>&#8221; command.<\/p>\n<p>When used without options, the output looks like this:<\/p>\n<pre>free<\/pre>\n<pre>             total       used       free     shared    buffers     cached\r\nMem:        507620     408172      99448          0     123672     248224\r\n-\/+ buffers\/cache:      36276     471344\r\nSwap:            0          0          0<\/pre>\n<p>To display in a more readable format, we can pass the &#8220;-m&#8221; option to display the output in megabytes:<\/p>\n<pre>free -m<\/pre>\n<pre>             total       used       free     shared    buffers     cached\r\nMem:           495        398         97          0        120        242\r\n-\/+ buffers\/cache:         35        460\r\nSwap:            0          0          0<\/pre>\n<p>The middle line, marked &#8220;-\/+ buffers\/cache&#8221;, will show the actual memory used by applications.<\/p>\n<p>The &#8220;Mem&#8221; line includes the memory used for buffering and caching, which is freed up as soon as needed for other purposes.<\/p>\n<h3 id=\"vmstat\"><strong>vmstat<\/strong><\/h3>\n<p>The &#8220;<strong>vmstat<\/strong>&#8221; command can output various information about your system, including memory, swap, disk io, and cpu information.<\/p>\n<p>We will use the command to get another view into memory usage:<\/p>\n<pre>vmstat<\/pre>\n<pre>procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----\r\n r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa\r\n 1  0      0  99340 123712 248296    0    0     0     1    9    3  0  0 100  0<\/pre>\n<p>We can see this in megabytes by choosing our unit with the &#8220;-S&#8221; flag:<\/p>\n<pre>vmstat -S M<\/pre>\n<pre>procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----\r\n r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa\r\n 1  0      0     96    120    242    0    0     0     1    9    3  0  0 100  0<\/pre>\n<p>As you can see, this tool helps us break down the &#8220;-\/+ buffers\/cache&#8221; category of the &#8220;free&#8221; command.<\/p>\n<p>We get to see how much of that block is used for buffering and how much for cache.<\/p>\n<p>To get some general statistics about memory usage, type:<\/p>\n<pre>vmstat -s -S M<\/pre>\n<pre>          495 M total memory\r\n          398 M used memory\r\n          252 M active memory\r\n          119 M inactive memory\r\n           96 M free memory\r\n          120 M buffer memory\r\n          242 M swap cache\r\n            0 M total swap\r\n            0 M used swap\r\n            0 M free swap\r\n. . .<\/pre>\n<p>To get information about individual system processes&#8217; cache usage, type:<\/p>\n<pre>vmstat -m -S M<\/pre>\n<pre>Cache                       Num  Total   Size  Pages\r\next4_groupinfo_4k           195    195    104     39\r\nUDPLITEv6                     0      0    768     10\r\nUDPv6                        10     10    768     10\r\ntw_sock_TCPv6                 0      0    256     16\r\nTCPv6                        11     11   1408     11\r\nkcopyd_job                    0      0   2344     13\r\ndm_uevent                     0      0   2464     13\r\nbsg_cmd                       0      0    288     14\r\n. . .<\/pre>\n<p>This will give you details about what kind of information is stored in the cache.<\/p>\n<div data-unique=\"conclusion\"><\/div>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>Using these tools, you should begin to be able to monitor your server from the command line. There are many other utilities that perform simple monitoring operations, but these are a good starting point.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu ile command line shell den cpu dik ve sistem performanslar\u0131n\u0131 kontrol etmek ? How Do You Monitor Your System&#8217;s Health? Every computer system benefits from proper administration and monitoring. Keeping an eye on how your system is running will help you discover issues and resolve them quickly. There are plenty of command line utilities [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[2],"tags":[2603,1506,2600,2602,2120,2601],"class_list":["post-5720","post","type-post","status-publish","format-standard","hentry","category-2015-2016","tag-health","tag-monitor","tag-sistem-monitor-how-do-you-monitor","tag-systems","tag-ubuntu","tag-your","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"aioseo_notices":[],"views":923,"_links":{"self":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts\/5720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/comments?post=5720"}],"version-history":[{"count":2,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts\/5720\/revisions"}],"predecessor-version":[{"id":5726,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts\/5720\/revisions\/5726"}],"wp:attachment":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/media?parent=5720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/categories?post=5720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/tags?post=5720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}