Performance Monitoring with Monitorix on Ubuntu 16.04

UbuntuOperating SystemUnix

Monitorix is a free, open source, lightweight system monitoring tool designed to monitor as many services and system resources as possible. It has been created to be used under the production of Linux/UNIX servers but due to its simplicity and small size it can be used on embedded devices as well. This article explains about “How to install Minitorix on Ubuntu”.

Adding the Monitorix Repository

To add the Monitorix Repository, open /etc/apt/sources.list file as shown below –

$ sudo nano /etc/apt/sources.list

The sample output should be like this –

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://in.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://in.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial universe

Place the cursor to the end of the file and add the following line –

deb http://apt.izzysoft.de/ubuntu generic universe

Save the file and exit from the file.

Adding the PGP Key

Once the repository is added, we have to download (or add) the PGP key and “install” it into the system as shown below-

$ wget http://apt.izzysoft.de/izzysoft.asc

The sample output should be like this –

--2016-05-24 11:35:47-- http://apt.izzysoft.de/izzysoft.asc
Resolving apt.izzysoft.de (apt.izzysoft.de)... 144.76.109.57
Connecting to apt.izzysoft.de (apt.izzysoft.de)|144.76.109.57|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1692 (1.7K) [text/plain]
Saving to: ‘izzysoft.asc’

izzysoft.asc 100%[=======================================================>] 1.65K --.-KB/s in 0s
2016-05-24 11:35:47 (212 MB/s) - ‘izzysoft.asc’ saved [1692/1692]

Now, we must go to the directory where we saved the .asc file and open a terminal window to run the following command-

$ sudo apt-key add izzysoft.asc

The sample output should be like this –

Ok

Now, update the package repositories as shown below –

$ sudo apt-get update

Installing Monitorix

To install Monitorix, use the following command-

$ sudo apt-get -y install monitorix apache2-utils

The sample output should be like this –

Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2-utils is already the newest version (2.4.18-2ubuntu3).
apache2-utils set to manually installed.
The following packages were automatically installed and are no longer required:
apport-hooks-elementary contractor libgda-5.0-4 libgda-5.0-common libgranite-common libgranite3 libgsignon-glib1 libindicate5
libnoise-core0 libtagc0 mysql-server-5.7 mysql-server-core-5.7
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libconfig-general-perl libdbi-perl libdbi1 libemail-date-format-perl libhttp-server-simple-perl libmime-lite-perl
libmime-types-perl librrd4 librrds-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-sax-base-perl
libxml-sax-expat-perl libxml-sax-perl libxml-simple-perl rrdtool
Suggested packages:
libmldbm-perl libnet-daemon-perl libsql-statement-perl default-mta | mail-transport-agent libmojolicious-perl
The following NEW packages will be installed:
libconfig-general-perl libdbi-perl libdbi1 libemail-date-format-perl libhttp-server-simple-perl libmime-lite-perl
.............................................................................................

Configuring Monitorix

To configure Monitorix, open /etc/monitorix/monitorix.conf file as shown below-

$ sudo nano /etc/monitorix/monitorix.conf

The sample output should be like this –

# Monitorix - configuration file
#
# See monitorix.conf(5) manpage for a detailed description of each option.
#
title = Place a title here
hostname =
theme_color = black
refresh_rate = 150
iface_mode = graph
enable_zoom = y
netstats_in_bps = n
disable_javascript_void = n
temperature_scale = c
show_gaps = n
global_zoom = 1
max_historic_years = 1
accept_selfsigned_certs = y
include_dir = /etc/monitorix/conf.d
.....................................................................................

Search for the following lines –

<auth>
   enabled = n
   msg = Monitorix: Restricted access
   htpasswd = /var/lib/monitorix/htpasswd
</auth>

Change the above lines as shown below –

<auth>
   enabled = y
   msg = Monitorix: Restricted access
   htpasswd = /var/lib/monitorix/htpasswd
</auth>

Save the file and exit. Once configured, we have to restart the monitorix service as shown below –

$ sudo service monitorix restart

Add a username and password for the Monitorix login. I will use the username “admin” with password “admin” in the example below –

$ sudo htpasswd -d -c /var/lib/monitorix/htpasswd admin

The sample output should be like this –

New password:
Re-type new password:
Adding password for user admin

Open your favorite browser and go http://localhost:8080/monitorix/. The output should be like this –

Click on Ok button. The sample output should be like this –

After this article, you will be able to understand – How to install Minitorix on Ubuntu. In our next articles, we will come up with more Linux based tricks and tips. Keep reading!

raja
Published on 17-Jan-2020 15:47:36
Advertisements