Monitorix is a free, open source, lightweight system monitoring tool designed to monitor as many services as possible. At this time it monitors from the CPU load and temperatures to the users using the system. Network devices activity, network services demand and even the devices' interrupt activity are also monitored, and more. The current status of any corporate server with Monitorix installed can be accessed via a web browser.
Installation of Monitorix
Visit the AUR and grab the tarball for the AUR package and build/install it.
$ tar -zxvf monitorix.tar.gz $ cd monitorix $ makepkg -src # pacman -U monitorix-<TAB>.tar.gz
Configuration of Monitorix
Before starting the monitorix daemon, be sure to adjust the
/etc/monitorix.conf to your liking. For a complete list of options and features, see the [official website] or the included man page for monitor.conf.
$ man monitorix.conf
Most if not all of the user settings are self explanatory based on the commented text within the conf file itself.
our $TITLE = "Reborn's Monitorix"; our $HOSTNAME = "Reborn"; our $THEME_COLOR = "black"; our $REFRESH_RATE = "150"; our $IFACE_MODE = "graph"; our $ENABLE_ZOOM = "Y";
Common settings to tweak here include title, hostname, and theme color.
Select Which Data Gets Graphed
"system" => "Y", "kern" => "N", "proc" => "Y", "hptemp" => "N", "lmsens" => "Y", "nvidia" => "Y", "disk" => "Y", "fs" => "N", "net" => "Y", "serv" => "N", "mail" => "N", "port" => "N", "user" => "Y", "apache" => "N", "nginx" => "N", "int" => "N",
Toggle which of the data gets displayed.
Monitorix optionally reads the info from lm-sensors and from hddtemp and logs CPU, MB, and HDD temps as well as fan speeds. See the lm_sensors wiki article to setup sensors on your box. See the hddtemp wiki article to setup hddtemp on your box.
To setup monitorix to read your specific sensors data, simply run sensors on the box and make the appropriate substitutions in the
"MB0" => "Mobo Temp", "CPU0" => "CPU0 Temp", "FAN1" => "CPU0 Fan", "CORE0" => "CPU0 Temp", "CORE1" => "CPU1 Temp", "VOLT0" => "VCore 1", "VOLT1" => "VCore 2", "VOLT2" => "\\+3.3V", "VOLT3" => "\\+5V", "VOLT4" => "\\+12V", "VOLT5" => "\\-12V", "VOLT6" => "\\-5V", "VOLT7" => "cpu0_vid", "GPU0" => "nvidia",
Again, change the values for each variable based on your own hardware and based on what you want to capture in the rrd databases.
Set up to block devices and mount points (optional).
our @DISK_LIST = ( "/dev/sda", # "/dev/sdb", # "/dev/sdc", ); our @FS_LIST = ( "/boot", "/", "/data", );
The rest of the config file includes data that most users won't want or need to customize. Feel free to tweak the file to your liking.
Monitorix is started like any other daemon. Data collection will occur once per minute triggered via a cron job (
/etc/cron.d/monitorix). When running monitorix for the very first time, it is necessary to restart the crond. On any subsequent start or restart this step is not necessary.
# rc.d start monitorix
Viewing Monitorix Data
To view system stats, make sure a webserver is running (see the next section) and browse to [http://localhost/monitorix] to see the data.
Configure a Webserver
Monitorix has minimal requirements for webservering the data. Arch has several options in the main repos for web serving, two of which are listed below. Lighttpd is recommended since its system resource footprint is minimal compared to apache (0.94 MB vs. 6.52 MB). Alternatively, Apache will work, but it is overkill!
# pacman -S lighttpd
By default, cgi support is not enabled in lighttpd. To enable it and to assign perl to process .cgi files, add the following two lines to
server.modules = ( "mod_cgi" ) cgi.assign = ( ".cgi" => "/usr/bin/perl" )
Start lighttpd like any other daemon:
# rc.d start lighttpd
# pacman -S apache
Make sure the hostname appears in
/etc/hosts and in
/etc/rc.conf or apache will not operate.
Start apache like any other daemon:
# rc.d start httpd
Using tmpfs to Store RRD Databases
Have a look at the following package which provides a script that will make use of tmpfs to store your RRD Databases for Monitorix. Doing so will greatly reduce hdd reads/writes.