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 [monitorix package] and build/install it.
$ tar monitorix.tar.gz $ cd monitorix $ makepkg -s # pacman -U monitorix-<TAB>.tar.gz
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.
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 Template:Filename
"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).
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 (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 # /etc/rc.d/crond restart
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.
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
# pacman -S apache
Start apache like any other daemon:
# /etc/rc.d/httpd start
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.