Monitorix

From Mark Furneaux's Wiki
Jump to: navigation, search

Monitorix is a web graphical utility for viewing server stats over time.

Installation

Add the repository to /etc/apt/sources.list:
deb http://apt.izzysoft.de/ubuntu generic universe

Add the key:
# wget -O - http://apt.izzysoft.de/izzysoft.asc | apt-key add -

Install the package:
# apt update
# apt install monitorix apache2-utils

Config

All configuration for Monitorix is in /etc/monitorix/monitorix.conf.

To get Monitorix to load on a server with Apache already installed, the built-in http server must be disabled by setting the line below and restarting Monitorix.

<httpd_builtin>
	enabled = n
	host =
	port = 8080
	user = nobody
	group = nogroup
	log_file = /var/log/monitorix-httpd
	hosts_deny =
	hosts_allow =
	<auth>
		enabled = n
		msg = Monitorix: Restricted access
		htpasswd = /var/lib/monitorix/htpasswd
	</auth>
</httpd_builtin>

To allow external clients to access Monitorix, edit /etc/apache2/conf-enabled/monitorix.conf to the desired permission levels and restart Apache.

Alias /monitorix /var/lib/monitorix/www
ScriptAlias /monitorix-cgi /var/lib/monitorix/www/cgi
<Directory /var/lib/monitorix/www/>
	<IfModule mod_authz_core.c>
		# Apache 2.4
		Require all granted
		#Require ip 127.0.0.1
	</IfModule>
	<IfModule !mod_authz_core.c>
		# Apache 2.2
		Order deny,allow
		Deny from all
		Allow from 127.0.0.1
	</IfModule>
</Directory>

<Directory /var/lib/monitorix/www/cgi/>
        DirectoryIndex monitorix.cgi
        Options ExecCGI
</Directory>

You may need to enable CGI processing with:
# a2enmod cgi

You may also need to run:
# chgrp -R www-data /var/lib/monitorix/www
# chmod -R g+rx /var/lib/monitorix/www
to make page display properly.

Fixes

On certain models of HDD/SSD controller, the frequent calls Monitorix makes to smartctl to fetch drive temperatures will cause the SATA link to lock up, forcing the controller to timeout and reset the link. This will greatly disturb operation of the machine. If this occurs, simply disable HDD temperature monitoring.