What system monitoring tools are available?
I am looking for system monitoring tools which are GUI and CLI or web-based which include basic functions such as:
- CPU Usage
- Ram Usage
- Swap Usage
- Disk Usage ( Space / I/O )
- Heat Monitoring
I know there are many tools I can use, but I am looking for a single tool that has these basic functions.
Glances - An eye on your system
Glances is a free software (licensed under LGPL) to monitor your GNU/Linux or BSD operating system from a text interface. Glances uses the library libstatgrab to retrieve information from your system and it is developed in Python.
Open a terminal (Ctrl+Alt+T) and run following commands:
From Ubuntu 16.04 and above you can just type
sudo apt install glances, but version 2.3 have this bug. Else:
Easy Script Installation Glances
curl -L https://raw.githubusercontent.com/nicolargo/glancesautoinstall/master/install.sh | sudo /bin/bash
wget -O- https://raw.githubusercontent.com/nicolargo/glancesautoinstall/master/install.sh | sudo /bin/bash
sudo apt-get install python-pip build-essential python-dev lm-sensors sudo pip install psutil logutils bottle batinfo https://bitbucket.org/gleb_zhulik/py3sensors/get/tip.tar.gz zeroconf netifaces pymdstat influxdb elasticsearch potsdb statsd pystache docker-py pysnmp pika py-cpuinfo bernhard sudo pip install glances
In glances you’ll see a lot of information about the resources of your system: CPU, Load, Memory, Swap Network, Disk I/O and Processes all in one page, by default the color code means:
GREEN : the statistic is “OK” BLUE : the statistic is “CAREFUL” (to watch) VIOLET : the statistic is “WARNING” (alert) RED : the statistic is “CRITICAL” (critical)
When Glances is running, you can press some special keys to give commands to it:
c: Sort processes by CPU% m: Sort processes by MEM% p: Sort processes by name i: Sort processes by IO Rate d: Show/hide disk I/O stats f: Show/hide file system stats n: Show/hide network stats s: Show/hide sensors stats b: Bit/s or Byte/s for network IO w: Delete warning logs x: Delete warning and critical logs 1: Global CPU or Per Core stats h: Show/hide this help message q: Quit (Esc and Ctrl-C also work) l: Show/hide log messages
Cpu , Ram , Swap Monitoring
System Heat Monitoring
If you type
glances --helpyou will find (
-eEnable the sensors module (Linux-only) )
You can set your thresholds in Glances configuration file, on GNU/Linux, the default configuration file is located in
Another interesting feature of this monitoring tool is that you can start it in server mode just typing
glances -s, this will give an output like Glances server is running on 0.0.0.0:61209 and now you can connect to it from another computer using glances -c @server where @server is the IP address or hostname of the server.
Glances uses a XML/RPC server and can be used by another client software. In server mode, you can set the bind address (-B ADDRESS) and listening TCP port (-p PORT), the default binding address is 0.0.0.0 (Glances will listen on all the networks interfaces) and TCP port is 61209. In client mode, you can set the TCP port of the server (-p port). In client/server mode, limits are set by the server side. The version 1.6 introduces a optional password to access to the server (-P password) that if set on the server must be used also on the client.
Monitoring juju container just for example how things look like Large Image
In terminal no 1 Glances is running in server mode, In terminal no 2 juju container is running
apt-get update& In terminal 3
glances -c 192.168.1.103Glances is connected to container ip
Glances CPU Usage
Glances itself seems to require period spikes of cpu usage while being active, as evidenced by the built in system monitor usage graph. If the graph is accurate - then by using glances one gives up about 1/4 of a CPU on a system. This my have en effect for those who are monitoring CPU loads on servers.
Is it worth installing python just to have better statistics, especially on tiny servers? (e.g. amazon micro istances with <750MB ram)
Awesome tool. There's a package in Debian 8.0 Jessie (and probably in Ubuntu already).
I strongly recommend against the 'easy' installation method suggested here! Piping data from the Internet to a privileged BASH interpreter is a very insecure. If someone misconfigured the DNS, or hacked bit.ly, you could be installing anything to your system and you might never know.
I **don't recommend** the "Easy Script Installation", install only using packages.
Indicator-SysMonitor does a little, but does it well. Once installed and run, it displays CPU and RAM usage on your top panel. Simple.
Download from here
One of my personal favourites
Screenlet you’ll find a bunch of differently styled CPU and RAM monitors included in the screenlets-all package available in the Ubuntu Software Center.
sudo apt-get install python-pip build-essential python-dev sudo pip install Glances sudo pip install PySensors
Displays information about CPU, memory, processes, etc.
This command line tool will display statistics about your CPU, I/O information for your hard disk partitions, Network File System (NFS), etc. To install iostat, run this command:
sudo apt-get install sysstat
To start the report, run this command:
To check only CPU statistics, use this command:
For more parameters, use this command:
The mpstat command line utility will display average CPU usage per processor. To run it, use simply this command:
For CPU usage per processor, use this command:
mpstat -P ALL
Saidar also allows to monitor system device activities via the command line.
You can install is with this command:
sudo apt-get install saidar
To start monitoring, run this command:
saidar -c -d 1
Stats will be refreshed every second.
GKrellM is a customizable widget with various themes that displays on your desktop system device information (CPU, temperature, memory, network, etc.).
To install GKrellM, run this command:
sudo apt-get install gkrellm
Monitorix is another application with a web-based user interface for monitoring system devices.
Install it with these commands:
sudo add-apt-repository ppa:upubuntu-com/ppa sudo apt-get update sudo apt-get install monitorix
Start Monitorix via this URL:
Glances are good. What it shows me is sometimes some critical logs. WHere to find whats the problem? Where are thouse logs? WARNING|CRITICAL logs (lasts 9 entries) 2016-03-23 19:09:48 > 2016-03-23 19:09:54 CPU user (72.7/76.6/80.6) 2016-03-23 19:09:28 > 2016-03-23 19:09:32 CPU IOwait (62.5/62.5/62.5) 2016-03-23 19:08:45 > 2016-03-23 19:08:48 CPU user (86.3/86.3/86.3) ~ 2016-03-23 19:08:16 > ___________________ LOAD 5-min (1.0/1.1/1.2) - Top process: php5-cgi 2016-03-23 19:08:09 > 2016-03-23 19:08:19 CPU IOwait (74.3/74.6/75.0)
@Thuener It's better for you just to read and search before such nonsense comment and yes it's ppa::upubuntu-com/ppa... refer to this link https://launchpad.net/~upubuntu-com/+archive/ubuntu/ppa and i think better for you to remove the downvote :)
Following are the tools for monitoring a linux system
- System commands like
netstatetc. Nothing comes near these linux utility when you are debugging a problem. These command give you a clear picture that is going inside your server
- SeaLion: Agent executes all the commands mentioned in #1 (also user defined) and outputs of these commands can be accessed in a beautiful web interface. This tool comes handy when you are debugging across hundreds of servers as installation is clear simple. And its FREE
- Nagios: It is the mother of all monitoring/alerting tools. It is very much customization but very much difficult to setup for beginners. There are sets of tools called nagios plugins that covers pretty much all important Linux metrics
- Server density: A cloudbased paid service that collects important Linux metrics and gives users ability to write own plugins.
- New Relic: Another well know hosted monitoring service.
- System commands like
top is monitoring Software, listing all the processes with CPU/RAM usage, Overall CPU/RAM usage and more Also it's mostly installed by default
htop is like an extended version of top. It has all the features from above, but you can see child processes and customize the display of everything. It also has colors.
iotop is specifically for Monitoring Hard rive I/O It lists all processes and shows their Hard drive usage for read and write.
where is heat monitoring ? and in your answer you have already included 3 utilities ... check the question **i am looking for a single tool that has some basic function **
With the three tools I am just giving different options for the OP, but I am dissapointed to say that none of those have heat monitoring
You might want to try sysmon. Although not as fancy as Glances, it is very straightforward and easy to use.
If you want to get dirty and do a little scripting in python, here are some basics of system monitoring with Python to get you started.
You'll need an external module called
psutilto monitor most things. It's easiest to use an external module installer instead of building from source.
Note: These examples are written in Python 2.7
sudo apt-get install pip sudo pip install psutil
Now that we have the modules installed, we can start coding.
First, create a file called
Start by importing
Then, create a function to monitor the percentage your CPU cores are running at.
def cpu_perc(): cpu_perc = psutil.cpu_percent(interval=1, percpu=True) for i in range(len(cpu_perc)): print "CPU Core", str(i+1),":", str(cpu_perc[i]), "%"
Let's break that down a bit, shall we?
The first line,
cpu_num = psutil.cpu_percent(interval=1, percpu=True), finds the percentage that the cores in your CPU are running at and assigns it to a list called
This loop right here
for i in range(len(cpu_num)): print "CPU Core", str(i+1),":", str(cpu_perc[i]), "%"
is a for loop that prints out the current percentage of each of your CPU cores.
Let's add the RAM usage.
Create a function called
def ram_perc(): mem = psutil.virtual_memory() mem_perc = mem.percent print "RAM: ", mem_perc, "%"
psutil.virtual_memorygives a data set containing different facts about the RAM in your computer.
Next, you can add some facts about your network.
def net(): net = psutil.net_io_counters() mbytes_sent = float(net.bytes_sent) / 1048576 mbytes_recv = float(net.bytes_recv) / 1048576 print "MB sent: ", mbytes_sent print "MB received: ", mbytes_recv
psutil.net_io_counters()only gives us information about packets sent and received in bytes, some converting was necessary.
To get some information about swap space, add this function.
def swap_perc(): swap = psutil.swap_memory() swap_perc = swap.percent
This one is pretty straightforward.
Temperature is kind of hard to do, so you may need to do some research of your own to figure out what will work with your hardware. You will have to display the contents of a certain file.
Disk usage is a lot easier than temperature. All you need to do is to pass the disk you want to monitor (i.e:
/) through a certain function.
def disks(): if len(sys.argv) > 1: for disk in range(1, len(sys.argv)): tmp = psutil.disk_usage(sys.argv[disk]) print sys.argv[disk], "\n" print "Megabytes total: ", print str(float(tmp.total) / 1048576) print "Megabytes used: ", print str(float(tmp.used) / 1048576) print "Megabytes free: ", print str(float(tmp.free) / 1048576) print "Percentage used: ", print tmp.percent, "\n"
The original output of
>>>psutil.disk_usage('/') sdiskusage(total=21378641920, used=4809781248, free=15482871808, percent=22.5)
but you can also just receive
The completed program: (the aforementioned functions were combined)
import psutil, os, sys mem_perc = 0 #init var swap_perc = 0 #init var mbytes_sent = 0 #init var mbytes_recv = 0 #init var cpu_perc = 0 #init var swap = 0 #init var mem = 0 #init var net = 0 #init var def disp(degree): global cpu_perc global swap global swap_perc global mem global mem_perc global net global mbytes_sent global mbytes_recv cpu_perc = psutil.cpu_percent(interval=1, percpu=True) swap = psutil.swap_memory() swap_perc = swap.percent mem = psutil.virtual_memory() mem_perc = mem.percent net = psutil.net_io_counters() mbytes_sent = float(net.bytes_sent) / 1048576 mbytes_recv = float(net.bytes_recv) / 1048576 os.system('clear') #clear the screen print "-"*30 print "CPU" print "-"*30 print "CPU Temperature: " , degree, "'C" for i in range(len(cpu_perc)): print "CPU Core", str(i+1),":", str(cpu_perc[i]), "%" print "-"*30 print "MEMORY" print "-"*30 print "RAM: ", mem_perc, "%" print "Swap: ", swap_perc, "%" print "-"*30 print "NETWORK" print "-"*30 print "MB sent: ", mbytes_sent print "MB received: ", mbytes_recv print "-"*30 print "DISKS" print "-"*30 if len(sys.argv) > 1: for disk in range(1, len(sys.argv)): tmp = psutil.disk_usage(sys.argv[disk]) print sys.argv[disk], "\n" print "Megabytes total: ", print str(float(tmp.total) / 1048576) print "Megabytes used: ", print str(float(tmp.used) / 1048576) print "Megabytes free: ", print str(float(tmp.free) / 1048576) print "Percentage used: ", print tmp.percent, "\n" def main(): print("Press Ctrl+C to exit") while True: temp = open("/sys/class/thermal/thermal_zone0/temp").read().strip().lstrip('temperature :').rstrip(' C') temp = float(temp) / 1000 disp(temp) main()
temp = open("/sys/class/thermal/thermal_zone0/temp").read().strip().lstrip('temperature :').rstrip(' C')might not work with your hardware configuration.
Run this program from the command line. Pass the disks you want to monitor as arguments from the command line.
$ python usage.py / Press Ctrl+C to exit ------------------------------ CPU ------------------------------ CPU Temperature: 39.0 'C CPU Core 1 : 4.8 % CPU Core 2 : 1.0 % CPU Core 3 : 0.0 % CPU Core 4 : 4.9 % ------------------------------ MEMORY ------------------------------ RAM: 33.6 % Swap: 6.4 % ------------------------------ NETWORK ------------------------------ MB sent: 2.93382358551 MB received: 17.2131490707 ------------------------------ DISKS ------------------------------ / Megabytes total: 13952.484375 Megabytes used: 8542.6640625 Megabytes free: 4678.5703125 Percentage used: 61.2 /media/calvin/Data Megabytes total: 326810.996094 Megabytes used: 57536.953125 Megabytes free: 269274.042969 Percentage used: 17.6
Hope this helps! Comment if you have any questions.
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.
@Ron - Okay, I'll add an edit to my post and show the basic scripting parts of sysmon in a couple of days. Thanks for the advice!
Check out http://meta.askubuntu.com/questions/13900/how-do-i-format-some-code-specifically-for-the-language-used-or-how-do-i-preven. What did you try, exactly?
@muru - But, to answer your question, I started the code block with three backticks followed by the language I wanted the syntax to be highlighted in, and ended with three backticks.
@muru - Okay. Is GitHub the only place that supports it? It is in their Documentation section.
freecommand is the most simple and easy to use command to check memory usage on linux/ubuntu.
To check memory usage is to read the
vmstatcommand with the
topcommand is generally used to check memory and cpu usage per process.
The htop command also shows memory usage along with various other details.
To find out hardware information about the installed RAM.
sudo dmidecode -t 17
I like to use
conkywhich can be configured anyway you like:
You can google
conkyand find 787,000 hits. There is something for everyone.
At the top of the display notice "Lock screen: 4 Minutes Brightness: 2074". These are generated by "Indicator-Sysmonitor" which allows you to display on the systray / application indicator using a bash script.
For a tutorial on setting up "Indicator-Sysmonitor" see: Can BASH display in systray as application indicator?