From ArchWiki
Revision as of 01:53, 17 October 2011 by Minimalm (talk | contribs) (Installation of Monitorix: added tar flags)
Jump to navigation Jump to search

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[1].

Installation of Monitorix

Visit the AUR and grab the tarball for the [monitorix package] and build/install it.

$ tar -zxvf monitorix.tar.gz
$ cd monitorix
$ makepkg -s
# pacman -U monitorix-<TAB>.tar.gz
Note: Depending on which font packages are installed on your system, it might been necessary to install the terminus-font package. For now, proceed without it, once monitorix is configured and running, users will know very quickly if they are missing the correct font as the graphs will not contain any text at which point, go ahead and install the terminus-font package via pacman.

Configuration of Monitorix

Before starting the monitorix daemon, be sure to adjust the Template:Filename 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.

Temperature monitor

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.

Note: both packages are in the [extra] repo. Install them via: pacman -S lm_sensors hddtemp

To setup monitorix to read your specific sensors data, simply run sensors on the box and make the appropriate substitutions in the Template:Filename

For example:

        "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, you'll need to 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).

For example:

our @DISK_LIST = (
#       "/dev/sdb",
#       "/dev/sdc",
our @FS_LIST = (

Additional sections

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.

Start Monitorix

Monitorix is started like any other daemon. Data collection will occur once per minute triggered via a cron job (Template:Filename). 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.

# /etc/rc.d/monitorix start
Note: To have monitorix start at boot, add it to your daemons array in Template:Filename.

Viewing Monitorix Data

To view your system stats, make sure your webserver is running (see the next section if you do not have a webserver) and browse to [http://localhost/monitorix] to see the data.

Note: It will take several minutes before data are displayed graphically so be patient.

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 Template:Filename:

server.modules		= ( "mod_cgi" )
cgi.assign		= ( ".cgi" => "/usr/bin/perl" )

Start lighttpd like any other daemon:

# /etc/rc.d/lighttpd start
Note: To have lighttpd start at boot, add it to your daemons array in Template:Filename.


# pacman -S apache

Make sure the hostname appears in Template:Filename and in Template:Filename or apache will not operate.

Start apache like any other daemon:

# /etc/rc.d/httpd start
Note: To have apache start at boot, add it to your daemons array in Template:Filename.

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.

Template:Package AUR