For example, to get CPU, memory, and disk statistics, you type c, m, and d. Once up, you select the subsystems to monitor by typing in its one-key commands. To run nmon, you start the tool from the shell. You can then view nmon’s real-time system measurements via its curses "graphical" interface. Nmon watches the performance information for several subsystems, such as processor utilization, memory utilization, run queue information, disk I/O statistics, network I/O statistics, paging activity, and process metrics. Nmon, short for Nigel’s Monitor, is a popular open-source tool to monitor Linux system performance. Some of the most commonly used options are: -a Show all socket information -r Show routing information -i Show network interface statistics -s Show network protocol statistics nmon It displays a lot of network-related information, such as socket usage, routing, interface, protocol, network statistics, and more. Netstat, like ps, is a Linux tool that administrators use every day. This overview can alert you to possible application problems before they get to the point of annoying users. It enables you to display overall CPU statistics per system or per processor. Mpstat also reports on the average activities of all your server’s CPUs. These days, thanks to multi-core processors, that’s almost all servers. The mpstat command reports on the activities of each of the available CPUs on a multi-processor server. In short, free gives you the overview meminfo gives you the details. Gives you the details of what’s going on in your server’s memory at any given moment.įor a quick “just the facts” look at memory, you can use the free command. Typically you access meminfo’s data by using another program such as cat or grep. Meminfo gives you a detailed list of what’s going on in memory. Trust me, you want to spot these problems before your users do! meminfo and free You usually use iostat to monitor how well your storage subsystems are working in general and to spot slow I/O problems before your clients notice that the server is running slowly. The iostat command shows in detail what your storage subsystem is up to. Once your server is running at init 3, you can start using the following shell programs to see what’s happening inside your server. If you don’t want to reboot after this change, you can also set your server’s run level immediately with the command: init 3 The next time you boot into your server, it will boot into runlevel 3. If there is no inittab file, create it and add the id:3 line. Once there, find the initdefault line and change it from: id:5:initdefault: To do so, head to a terminal window, su to the root user, and use your favorite editor on /etc/inittab. If your server starts by booting into a graphical desktop, you need to change this. If you really need a graphical desktop, you can always get one by running startx from a shell prompt. For optimum performance, a Linux server should run at runlevel 3, which fully supports networking and multiple users but doesn’t start the GUI when the machine boots. This also means you should start a GUI on a server only when it’s required don’t leave it running. So, while using a GUI program is fine for basic server health checkups, if you want to know what’s really happening, turn off the GUI and use these tools from the Linux command shell. That’s because Linux GUIs take up system resources that could be better used elsewhere. However, it’s a Linux administrator truism that you should run a GUI on a server only when you absolutely must. And there are universal tools, such as Webmin and cPanel, which can be used on any Linux server. SUSE Linux Enterprise Server and openSUSE, for example, have an excellent graphical configuration and management tool, YaST. Sure, you can use a GUI program to pull up much of the information that these shell commands can give you, depending on the Linux distribution. Once you’ve learned them, you’ll be well on your way to being an expert Linux system administrator. Want to know what’s really going on with your server? Then you need to know these essential commands.
0 Comments
Leave a Reply. |