Monitorix

From ArchWiki
Revision as of 01:32, 23 December 2011 by Graysky (Talk | contribs) (Using tmpfs to Store RRD Databases)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Summary help replacing me
Installation and configuration of Monitorix.
Related
Monitorix-sync-daemon
lm_sensors
hddtemp

Monitorix is an 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 production UNIX/Linux servers, but due to its simplicity and small size many use it on embedded devices as well. The current status is accessed via web browser [1].

Installation of Monitorix

Visit the AUR and grab the tarball for the monitorixAUR package and build/install it.

$ tar -zxvf monitorix.tar.gz
$ cd monitorix
$ makepkg -src
# 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 /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.

General

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 /etc/monitorix.conf

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, change the values for each variable based on your own hardware and based on what you want to capture in the rrd databases.

Filesystems

Set up to block devices and mount points (optional).

For example:

our @DISK_LIST = (
        "/dev/sda",
#       "/dev/sdb",
#       "/dev/sdc",
);
our @FS_LIST = (
        "/boot",
        "/",
        "/data",
);

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 (/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
Note: To have monitorix start at boot, add it to your daemons array in /etc/rc.conf.

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.

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!

Lighttpd

# 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 /etc/lighttpd/lighttpd.conf:

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

Start lighttpd like any other daemon:

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

Apache

# 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
Note: To have apache start at boot, add it to your daemons array in /etc/rc.conf.

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.

monitoring-sync-daemonAUR