In this guide, you will learn to Install and Configure Monitorix on Ubuntu 22.04.
Monitorix is a free, lightweight, open-source system monitoring tool designed to monitor as many services as possible.
This application monitors the CPU load and temperatures of the users on the system. Network device activity, network services demand, and even the devices’ interrupt activity are also monitored. The current status of any corporate server with Monitorix installed can be accessed via a web browser.
It has been designed to be used under production Linux servers, but due to its simplicity and small size, you can use it to monitor embedded devices.
Steps To Install and Configure Monitorix on Ubuntu 22.04
To complete this guide, you must log in to your server as a non-root user with sudo privileges and set up a basic firewall. For this purpose, you can visit our guide on Initial Server Setup with Ubuntu 22.04.
Monitorix Installation Steps on Ubuntu 22.04
The installation of Monitorix is so easy. First, update your local package index with the command below:
sudo apt update
Then, use the following command to install Monitorix and the required packages:
sudo apt install monitorix rrdtool perl libwww-perl libmailtools-perl libmime-lite-perl librrds-perl libdbi-perl libxml-simple-perl libhttp-server-simple-perl libconfig-general-perl libio-socket-ssl-perl -y
When your installation is completed, verify it by checking its version:
Output Monitorix version 3.14.0 (18-Jan-2022)
Manage Monitorix Service
At this point, you can use the following command to start and enable your Monitorix service:
sudo systemctl enable --now monitorix
Verify your Monitorix service is active and running on Ubuntu 22.04:
sudo systemctl status monitorix
Output ● monitorix.service - Monitorix Loaded: loaded (/lib/systemd/system/monitorix.service; enabled; vendor pre> Active: active (running) since Sat 2023-05-13 12:27:25 UTC; 5min ago Docs: man:monitorix(8) Main PID: 2629 (/usr/bin/monito) Tasks: 2 (limit: 4575) Memory: 78.5M CPU: 2.251s CGroup: /system.slice/monitorix.service ├─2629 "/usr/bin/monitorix -c /etc/monitorix/monitorix.conf -p /ru> └─2793 "monitorix-httpd listening on 8080"
Monitorix Configuration on Ubuntu 22.04
Monitorix is configured with a single plain text configuration file /etc/monitorix/monitorix.conf. At this point, you need to make a few changes to the configuration file before using Monitorix.
Before you start, it is recommended to take a copy of the Monitorix config file:
sudo cp /etc/monitorix/monitorix.conf /etc/monitorix/monitorix.conf.backup
Now open the Monitorix config file with your favorite text editor, here we use the vi editor:
sudo vi /etc/monitorix/monitorix.conf
In the configuration file replace the settings according to your environment:
# line 6: change to any title you like title = Monitorix # line 7: change to your hostname hostname = your-hostname # line 8: background color of admin site theme_color = black # line 12: change network units to bps (default is Bytes per/sec) netstats_in_bps = y # 28-43: change if you need <httpd_builtin> enabled = y host = port = 8080 user = nobody group = nobody log_file = /var/log/monitorix-httpd # if enable permission for admin site, add settings hosts_deny = all hosts_allow = 10.0.0.0/24 autocheck_responsiveness = y <auth> # if enable Basic auth, turn to [y] enabled = n msg = Monitorix: Restricted access htpasswd = /var/lib/monitorix/htpasswd </auth> </httpd_builtin> # line 76: set kind of graphs you'd like to monitor # Graphs (de)activation # ----------------------------------------------------------------------------- <graph_enable> system = y kern = y proc = y hptemp = n lmsens = n gensens = n ipmi = n ambsens = n nvidia = n disk = n ..... .....
When you are done, save and close the file.
To apply the changes, restart the Monitorix service on Ubuntu 22.04:
sudo systemctl restart monitorix
Configure Firewall for Monitorix
If you have a running firewall, you must open port 8080 to enable access using the command below:
sudo ufw allow 8080/tcp
Reload the firewall to apply the new rules:
sudo ufw reload
Access Monitorix Dashboard
To access your Monitorix through the web interface, you need to type your server’s IP address in your web browser followed by 8080/monitorix:
At the first screen, choose the graph and the daily, weekly, monthly, or yearly options and click ok.
From there, you can see your graphs and monitor your server.
At this point, you have learned to Install land Configure Monitorix on Ubuntu 22.04.
Hope you enjoy it. Also, you may be interested in these articles:
Install and Configure GlassFish on Ubuntu 22.04
Install and Use Metasploit on Ubuntu 22.04