Unknown 16 Linux Server monitoring commands (1)

Source: Internet
Author: User

Do you want to know what your server is doing? You need to know the basic commands described in this article. Once you are familiar with these commands, it lays the foundation for becoming a professional Linux system administrator.

You can use a graphical user interface (GUI) program to obtain a large amount of information provided by these shell commands, depending on which Linux release is used. For example, SUSE Linux has an excellent, graphical configuration and management tool YaST, and KDE's KDE System Guard is also outstanding.

However, what Linux administrators need to understand is that they should run the GUI on the server only when absolutely necessary. This is because the Linux GUI consumes system resources, which can be used in other places more rationally. Therefore, even if you use a GUI program to perform a basic health check on the server, disable the GUI if you want to know what happened, start using these tools from the Linux Command Shell.

This also means that you should enable the GUI on the server as long as you need it; if you don't need it, turn it off in time. To ensure optimal performance, the Linux server should run under runlevel 3, which fully supports the network and multiple users, but does not enable the GUI when the machine starts. If you really need a graphical desktop, you can always run startx from the shell prompt to get a graphical desktop.

If your server enters the graphical desktop after it is started, you need to change this situation. To this end, enter the terminal window, use the su command to switch to the root user, and then open the/etc/inittab file in your frequently-used editor.

Once you enter the file, find the initdefault line and change id: 5: initdefault: to id: 3: initdefault :.

If the/etc/inittab file does not exist, create one and add the line id: 3. Save and exit. The next time you start to enter the server, it will start to enter the runtime Level 3. If you do not want to restart after such changes, you can also use the init 3 command to set the server running level immediately.

Once your server runs under init 3, you can start to use the following Shell programs to see what is happening on your server.

Iostat

The iostat command details the storage subsystem. You usually use iostat to monitor the overall running status of the storage subsystem, and detect the slow input/output before the user notices that the server is running slowly. Believe me, you should discover these problems before the user discovers them!

Meminfo and free

Meminfo displays the memory details for you. You can use another program, such as cat and grep, to access meminfo information. For example, cat/proc/meminfo shows you the usage of the server at any time.

If you want to quickly understand the memory summary, you can use the free command. In short, free provides you with summary information; meminfo provides you with details.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.