There are a ton of great tools out there for server monitoring and diagnostics that are based on the original top command, and that can be used to help you monitor and manage linux boxes.

Inspired by a recent post on Hacker News by Anders Aarvik we have compiled in this post the top command line tools out there for monitoring system resources. We will put up another post with tools for monitoring network io, bandwidth and web based processes after this.

htop

Htop is an interactive process viewer and is a widely extended version of top, with a big overview (eg. full commands, visualization, gui and ui), a mouse-clicking interaction, and a lot of guidance on how to do process management.

Install it and try it out:
$ sudo apt-get install htop

htop

atop

Atop is a great tool for load and process management. The data is very precise, and the key-toggle interface is very easy to use, making it an all-you-need tool. One of the smartest things about Atop which other diagnostic tools can not offer is the history log. You can actually jump back in time and see diagnostic data from a month back.

Be sure that the atop service is started:
$ sudo service atop start

Take a look back a few days after and you will find logs in your /var/log directory. You can read them in the interface itself with atop -r, or with the report util from atop called atopsar, with atopsar -r, like here:
$ atop -r atop.log
$ atopsar -r atop.log

atop1

atop2

iotop

Iotop is a real-time monitor for IO. It displays information about each process thread in your system with their belonging detailed input and output (IO) usage.

This can be used together with $ tcpdump which respond with network traffic. If you can see that something is going on with your web server you can eg. check your port 80 (standard http port) networks traffics by running $ tcpdump port 80 to see details.

The most useful information is probably the DISK WRITE column, where you can see exactly how much process in K/s each IO uses.

Install it and try it out:
$ sudo apt-get install iotop

iotop

Glances

Glances displays columns in separated tables for various useful real-time data about what is going on on your machine. Glances aims to show as much information as possible on a minimum of space, and i think it’s goal is fully reached.

Glances monitors PerCPU, Load, Memory, Swap, Network, Disk i/O, Mount data and processes, with limited interaction possibilities and deep information, but is abosolutely perfect to get an big overview.

Install it and try it out:
$ sudo apt-get install glances

This will need your to add the repository to the apt package manager.

It is easiest to install Glances with pip:
$ sudo pip install glances

If you do not have pip (pip – install Python packages), install it with apt-get:
$ sudo apt-get install python-pip

glances

dstat

Dstat should be a one-pack replacmenet for vmstat, iostat and ifstat, and i would say that this has been achieved. Dstat is a very flexibile tools with amazing features which you did not get with the other tools, and it writes stdout directly in the prompt. $ man dstat is recommended to see all the awesome features.

You can eg. write $ dstat --disk if you only want to see disk monitor output, and if you need the whole disk/load/cpu/network package or more, you could do $ dstat --disk --load --cpu --net, and separate columns would appear. Try it out – it is a great and fun way to monitor.

dstat1

Source: Linux server monitoring tools by Anders Aarvik

http://aarvik.dk/linux-monitoring-tools-suggestions-from-hacker-news/