Fork me on GitHub
Monitorix logo

Welcome to The Monitorix Project

Take control over your small server

Index

General

Troubleshooting

General

Where can I get Monitorix?

Monitorix can be freely obtained from its official website. You should verify first though if your system has a package built already.

Can I use it for comercial purposes?

Yes. Monitorix is an open source project and it is released under the GNU License. You don't have to tell us about your products, but if you have a success story about how Monitorix has helped you, I would love to hear about it.

Who is the author of Monitorix?

Jordi Sanfeliu is the author of Monitorix.

Is there a mailing list for Monitorix?

Yes. There is a mailing list for general discussion. See the Contacts section for the details.

Is there an IRC channel for Monitorix?

Yes. There is a channel at Freenode called #monitorix to discuss about help, bugs and enhancements. See more details here.

What are the right steps to upgrade Monitorix on a RHEL/CentOS/Fedora system?

When a new Monitorix version is released and once you had already downloaded it, you may just follow the same steps you'd do it to upgrade practically any other application:
# service monitorix stop
Stopping Monitorix:                                        [  OK  ]

# rpm -Uvh monitorix-n.n.n.noarch.rpm 
Preparing...                ########################################### [100%]
   1:monitorix              ########################################### [100%]

# service monitorix start
Starting Monitorix:                                        [  OK  ]
      
Only in those cases when the new version comes with some new changes in the monitorix.conf configuration file, you'll see the following output:
# rpm -Uvh monitorix-n.n.n.noarch.rpm 
Preparing...                ########################################### [100%]
   1:monitorix              warning: /etc/monitorix.conf created as /etc/monitorix.conf.rpmnew
   ########################################### [100%]
      
In such cases please take some time to compare your current configuration file and adapt the new changes on it.

Can be used in non GNU/Linux systems?

Monitorix was initially created to be fully GNU/Linux dependant, but the current code is prepared to be easier portable to different GNU/Linux distributions and even to other UNIX systems.

Today it also runs on FreeBSD, OpenBSD and NetBSD systems with almost full support.

Where can I find more documentation about the options in the configuration file?

For more information about how to configure the different options in monitorix.conf check the monitorix.conf(5) man page.

What about the .rrd files in /var/lib/monitorix, it's expected that they will grow every day?

Don't worry much about the RRD files in /var/lib/monitorix, they are sized during their creation and their sizes will remain the same during all the time. That's not a feature of Monitorix, but a feature of RRDtool.

I have a lot of servers, how can I use Monitorix to centralize the statistics?

If you plan to use Monitorix on several servers you will want to use the Multihost feature as you can see in this Monitorix screenshot.

These are the steps to setup the Multihost feature.

<multihost>
        enabled = y
	...
      
This will enable the Multihost feature on that machine and it will prepare a suitable web main-page to select your defined servers. Alternatively you can adjust the other Multihost feature related options (that's optional):
	footer_url = y
        graphs_per_row = 2
      
The first one will show in the bottom line of each graph the URL of the server. If you think this can be dangerous or not recommendable in your LAN, just switch it to n.

The second one is the number of graphs that will appear on each line while monitoring the remote servers. The default is 2 and is a good choice for resolutions up to 1280x1024 to avoid horizontal scrolling. For bigger resolutions you can try other values. The more resolution you have the more images per line you'll like to have.

Finally you need to specify the list of servers you plan to monitor, and you can create such list below in the same configuration file. Like this:

	remotehost_list = server 1, server 2, server 3
        <remotehost_desc>
		0 = http://www.example.com,/montorix,/monitorix-cgi
		1 = http://10.0.0.1,/montorix,/monitorix-cgi
		2 = http://192.168.0.100:8080,/,/
	</remotehost_desc>
      
After applying those configurations just restart the Monitorix service and point your browser to your main machine from where you planed to monitor the rest of servers, that is, the same machine where you had configured the /etc/monitorix/monitorix.conf file.

In the Monitorix main page you'll see you'll be able to select your defined servers individually or collectively using All hosts option.

In Multihost feature, why do I get only the CPU graph of the selected machine even when I've actually choosen the "All Graphs" option?

That's a very common question.

As you already know, in the main page of Monitorix there are two list-boxes. The one in the left side is to choose the hostname(s), and the one in the right is to choose the graph.

When Multihost feature is disabled the only option in the left side is Localhost. That's because there isn't any other hostname defined. So, in this case one can choose All graphs option (in the right list-box) and see the results of all graphs of his hostname in the same page in a well structured layout.

But when the Multihost feature is enabled, you can see that it appears more options in the left list-box. That's too because it appears the hostnames you've defined in the monitorix.conf file. I mean, all the hostnames that you are about to monitor.

Now imagine that with the Multihost feature enabled, someone chosen All hosts (in the left) and All graphs (in the right). That would be a big mess!. I don't think that someone would want to see all this information in the same page.

Because I don't use use Javascript in the main page, it is difficult to implement an automatic logic with HTML to avoid the use of the All graphs option in such circumstance. So I decided that when that happens, the All graphs option takes the same functionality as if the CPU load option was chosen.

That's the reason why you get the same results choosing either All graphs or CPU load in the right, when you chose All hosts in the left.

How should I interpret the Memory Allocation graph?

In GNU/Linux systems the term Memory Used includes the used by the user applications, the I/O buffers, and other types of cache. The importance here is that the user applications have enough memory all the time, otherwise people tends to complain as soon as they see their applications running slower. To accomplish this, the Linux kernel balances its memory between buffers, cache and user applications, having the later the higher priority when they need more memory.

So, you should expect to see all the time the memory Used as higher as possible, which will means that your system is correctly using all its memory for all the purposes, including disk buffers and reducing the number of disk reads and at the same time, extending the life of your disk.

We can conclude that all the memory that is not being used by the user applications, is free. So, in order to know how much of free memory the system has, you must add the amount of memory in green and white colors, because they are used by the buffers and cache. Or said in the other way around, the less red color you see in the graph the more free memory your system has.

For more information click here.

Is it possible to use Monitorix to just produce static HTML reports or is webserver with CGI absolutely required?

Ideally the best way is to use the built-in HTTP server or to have installed an Apache (or any other web server) with CGI enabled on each server you plan to use Monitorix in a normal way.

Anyway and due its Perl script nature, you could execute monitorix.cgi directly from the command line (with the correct parameters), and you'll get the same HTML file as if it was executed by the web server. Don't forget to change to the <base_dir>/cgi directory first.

For example, if you want to see all daily graphs of your localhost, you'd execute the following from the command line:

./monitorix.cgi mode=localhost graph=all when=day color=black
      
This will output the same HTML file that your broswer would get if there was a web server in the other side.

Remember that the script will generate (among of the HTML code) the rendered graphs and it will try to use the directories defined in the /etc/monitorix.conf file, so make sure that it has enough permissions to write there.

What can I do to make possible that Monitorix coexist with Plesk on the same server?

This is only in case you aren't using the built-in HTTP server.

If you contracted a cheap dedicated server and it comes with Plesk already installed, you should know that this admin tool likes to take over all your server. This is the reason why you are able to see only the Monitorix main page, and just after click in the "Ok" button, you get a webserver error preventing you seeying the Monitorix graphs page.

This annoying behaviour can be solved either adding a new listening port just inserting a single line in the /etc/httpd/conf.d/monitorix.conf file:

Listen 81
      
or whatever the port number you like.

In fact, the default configuration of Plesk takes control over the ports 80 and 443 of your webserver, so it won't conflict with any other port that your webserver is listening on.

The second alternative is inserting a new Virtualhost section using the real name of your server:

<Virtualhost your.hostname.com:80>
	DocumentRoot /var/www/html
	<Directory "/var/www/html">
         	# Put this if you really need all options?
		Options Indexes ExecCGI FollowSymLinks MultiViews
		AddHandler cgi-script .cgi
		# are you using .htaccess files? if not, set it from all to none
		AllowOverride all
		Order allow,deny
		Allow from all
	<Directory>

	ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
	<Directory "/var/www/cgi-bin/">
		AllowOverride None
		Options None
		Order allow,deny
		Allow from all
	<Directory>
<Virtualhost>
      
The advantage of this second alternative is that you que continue using the standard HTTP port.

NOTE: Adjust the above paths and options according your system security.

I have a RAID controller, it is possible to get temperatures using allowed extra parameters in smartctl command?

Yes, if you have a RAID controller such as Smart Array, 3ware, Areca, HighPoint, MegaRAID, etc. and it's supported by your smartmontools version, you may use the same extra parameter you'd put in your smartcl command.

E.g.: if your RAID controller is an Smart Array (using the CCISS driver), you may able to define the following option in monitorix.conf file:

	<list>
		0 = "/dev/cciss/c0d0 -d cciss,0", /dev/sda
	</list>
      

It's possible to allow the built-in HTTP server to listen to a port below than 1024?

Yes it is, but due to security reasons only the root user is able to bind ports below 1024 on GNU/Linux. Anyway, you can always workaround this limitation by just redirecting the low port to a high port and listen on the high port:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 8080
      

How can I setup Nginx as a reverse proxy for the built-in HTTP server?

If you have enabled the built-in HTTP server but you want to use Nginx to access the Monitorix graphs, then you need to append the following lines in the server {...} section:
location /monitorix {
#    auth_basic "Restricted";
#    auth_basic_user_file /etc/monitorix/monitorix-users;

    include proxy_params;
    proxy_pass		http://127.0.0.1:8080/monitorix;
    allow		127.0.0.0/8;

    # for old versions up to 3.4.0
#    location ~* \.png$ {
#	root /usr/share;
#    }

    # since 3.5.0 version
    location ~ ^/monitorix/(.+\.png)$ {
        alias /var/lib/monitorix/www/$1;
    }
}
      

I plan to use other web server than the built-in. What should I take in consideration?

If you prefer to use a different web server than the built-in one, you should take the following steps: Similar actions apply to any other web server used.

Why are there so big discrepancies in the values of the graphs sometimes?

Different sizes of graphs have different resolutions. This is best explained using a fictive example: where the small graph would cover 2 minutes for an estimation value, the larger scaled graph would have a finer resolution, let's say 1 minute. So 7 hits in the first, and 3 hits in the second minute would show a peak of 7 in the large graph (from the first minute), while the smaller graph would show an average of 5, (7+3)/2.

How can I use a manager password with Squid 3.1?

Squid 3.1 and 3.2 have different syntax if you want to use a manager password to get the statistics. Monitorix already supports the syntax for Squid 3.2, this is accomplished by using the cmd option of the Squid graph in the Monitorix configuration file. The syntax would be:
squidclient -h 127.0.0.1 -u manager -w secret_password
      
But if you have a Squid 3.1 version and you still need to pass a password to manager, the syntax is different and is not currently supported by Monitorix. In that case, the cmd option will have a half of the complete command and the rest must be patched directly in the code:
squidclient -h 127.0.0.1 -u manager
      
Then, you need to locate and patch the following lines in the /usr/lib/monitorix/squid.pm module to complete the command syntax:
open(IN, "$squid->{cmd} mgr:counters\@secret_password |");
open(IN, "$squid->{cmd} mgr:info\@secret_password |");
open(IN, "$squid->{cmd} mgr:ipcache\@secret_password |");
open(IN, "$squid->{cmd} mgr:io\@secret_password |");
open(IN, "$squid->{cmd} mgr:storedir\@secret_password |");
      

Troubleshooting

I just installed Monitorix but I don't see any activity.

The Monitorix graphs takes a few minutes to start showing activity. Please be patient.

I just installed Monitorix but the graphs are not visible. What's going on?

If you only see the skeleton page without the graphs that probably means that your web server don't have enough permissions to write into the <base_dir>/imgs directory. Check that.

Forbidden: You don't have permission to access /monitorix-cgi/monitorix.cgi on this server.

If you are using Apache as your web server, then it's possible that the configuration file for Apache that comes with Monitorix is too much restrictive.

Please edit the Apache configuration file that comes with Monitorix which is located in:

For security reasons Monitorix restricts by default to 127.0.0.1 as the only allowed IP to access the CGI:
<Directory /var/lib/monitorix/www/cgi/>
         DirectoryIndex monitorix.cgi
         Options ExecCGI
         order deny,allow
         deny from all
         allow from 127.0.0.1
</Directory>
      
Just change the last option by something wider like this:
         allow from all
      
And restart Apache for the changes to take effect:
# service httpd restart
      

I've just upgraded my NVIDIA driver and now the GPU usage graph no longer shows any data, What's the problem?

If you upgraded to a newer NVIDIA driver 270.+ the nvidia-smi tool no longer displays a complete information as it did with the older drivers. So this is the reason why Monitorix is unable to gather the GPU usage information.

You may want to read a pair of posts in some forums here and here.

I'm getting the error message: 500 Internal Server Error (also Malformed header).

This is probably because you are using an external web server (Apache, Lighttpd, Nginx, etc.) while at the same time you have enabled the Monitorix built-in HTTP server.

Edit the /etc/monitorix/monitorix.conf file, and switch to n the enabled option:

<httpd_builtin>
	enabled = n
	...
      
And don't forget to restart Monitorix.

Using the built-in HTTP server I get the following message: The requested URL / was not found on this server.

You are getting this error because the URL you use to connect with Monitorix doesn't match with the values setup in the options base_url and base_cgi in the configuration file.

You must setup these options according to the URL that you are using to connect with Monitorix. That is, if you want to use the default URL:

http://localhost:8080/monitorix/
      
then you need to setup the following values:
base_url = /monitorix
base_cgi = /monitorix-cgi
      
In the other hand, if you want to use the following URL:
http://localhost:8080/
      
then the values must be setup as:
base_url = /
base_cgi = /