You are not logged in.

#1 2011-03-29 14:44:36

belbo
Member
From: Sydney, Australia
Registered: 2011-02-25
Posts: 51

Monitorix - getting it to work

Hi

I have installed monitorix using yaourt from the AUR. I have Apache web server using port 3389. When I  go to http://localhost:3389/monitorix/ in Firefox I get the Monitorix main page. (Displays Monitorix heading, logo, version no 2.1.0, drop down box for hostname and graph and radio buttons for daily, weekly, monthly, yearly) and an OK button.

When I select OK instead of getting the graphs I get this url and a perl script on the screen -

url - http://localhost:3389/monitorix/cgi-bin/monitorix.cgi?mode=localhost&graph=all&when=day&color=black

script text (is very long, but starts like this) -

_______________________________________________________________________________________

#!/usr/bin/perl
#
# Monitorix - A lightweight system monitoring tool.
# Copyright (C) 2005-2011 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

no strict "vars";
no warnings "once";
use CGI qw/:standard/;
use POSIX;
use RRDs;

# load the path of the configuration file
open(IN, "< monitorix.conf.path");
my $opt_config = <IN>;
chomp($opt_config);
close(IN);
if(-f $opt_config) {
    require $opt_config;
} elsif(-f "/etc/monitorix.conf") {
    require "/etc/monitorix.conf";
} elsif(-f "/usr/local/etc/monitorix.conf") {
    require "/usr/local/etc/monitorix.conf";
} else {
    print("Content-Type: text/html\n");
    print("\n");
    print("Monitorix configuration file '$opt_config' not found!\n");
    print("Other possible locations also failed.\n");
    exit(1);
}

our $URL = $ENV{HTTPS} ? "https://" . $ENV{HTTP_HOST} : "http://" . $ENV{HTTP_HOST};
if(!($HOSTNAME)) {
    $HOSTNAME = $ENV{SERVER_NAME};
    if(!($HOSTNAME)) {    # called from the command line
        $HOSTNAME = "127.0.0.1";
        $URL = "http://127.0.0.1";
    }
}
$URL .= $BASE_URL . "/";

______________________________________________________________________________________

The beginning of my /etc/monitorix.conf file looks like this -
_____________________________________________________________________________________

#!/usr/bin/perl
#
# Monitorix - configuration file
# Copyright (C) 2005-2011 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# Please be careful when touching this file taking special attention to
# not break some Perl basic syntax.
#
# See monitorix.conf(5) manpage for a detailed information of each option.
#

use strict;

our $TITLE = "Monitorix";
our $HOSTNAME = "HTPC";
our $THEME_COLOR = "black";
our $REFRESH_RATE = "150";
our $IFACE_MODE = "graph";
our $ENABLE_ZOOM = "Y";

our $BASE_DIR = "/srv/http/monitorix/";
our $BASE_LIB = "/var/lib/monitorix/";
our $BASE_URL= "/monitorix";
our $BASE_CGI = "/monitorix/cgi-bin";

_____________________________________________________________________________________

I have added monitorix to my daemon line and have also restarted it using
/etc/rc.d/monitorix restart.

I didn't have a  /etc/cron.d/monitorix file so created it (using sudo) with the text as per this post -
https://bbs.archlinux.org/viewtopic.php?id=102228

Presumably I've got something pretty basic wrong. Any help appreciated.

My temps are very high (I have lm-sensors and gnome panel applet installed) and I have shutdowns (infrequently) presumably from overheating. (All fans working and thermal paste reapplied not too long ago). I don't get any logging of temps so would like to use monitorix esp to find what temps were at the time of any future shutdowns.

Thanks

belbo

Last edited by belbo (2011-03-29 14:45:13)

Offline

#2 2011-03-29 15:44:19

marxav
Member
From: Gatineau, PQ, Canada
Registered: 2006-09-24
Posts: 386

Re: Monitorix - getting it to work

The problem is with Apache which you unlikely configure to handle perl (mod_perl is probably what is required).  So instead of processing the perl script, it displays it.  The first page works because it is probably just static html.

Offline

#3 2011-03-29 16:49:50

belbo
Member
From: Sydney, Australia
Registered: 2011-02-25
Posts: 51

Re: Monitorix - getting it to work

Thanks for the help - appreciated. Unfortunately that doesn't seem to have helped. Installed mod_perl, restarted apache and monitorix, but the problem persists.

Any further help appreciated.

Thanks

Offline

#4 2011-03-29 18:43:23

marxav
Member
From: Gatineau, PQ, Canada
Registered: 2006-09-24
Posts: 386

Re: Monitorix - getting it to work

Did you try a basic "Hello World" perl script to see if the module works?  Any output in the httpd log?

Offline

#5 2011-04-10 01:45:04

belbo
Member
From: Sydney, Australia
Registered: 2011-02-25
Posts: 51

Re: Monitorix - getting it to work

Eventually got around to trying to sort this out. I now have the graphs displaying - but it is not displaying the temperature data. (I have lm-sensors installed and cpu and gpu temperatures display in the gnome panel applet). Will investigate this, but any help appreciated in the meantime.

Re getting the graphs to work. I simply edited /etc/httpd/conf/httpd.conf  and -

added ExecCGI to the Options directive -
Options Indexes FollowSymLinks ExecCGI

and uncommented -
    AddHandler cgi-script .cgi

I didn't specify the monitorix.cgi script's directory in /etc/httpd/conf/httpd.conf which seems to be required according to this post -

http://httpd.apache.org/docs/2.0/howto/cgi.html

"Explicitly using Options to permit CGI execution

You could explicitly use the Options directive, inside your main server configuration file, to specify that CGI execution was permitted in a particular directory:

<Directory /usr/local/apache2/htdocs/somedir>
Options +ExecCGI
</Directory> "

Its all pretty puzzling. I did create a basic hello world script and this did work before making the changes mentioned above. That script was in /srv/http/cgi-bin which is the path in my scriptalias directive. Before making the changes above, changing the scriptalias path to /srv/http/monitorix/cgi-bin (which is where the monitorix cgi script resides) had no effect - ie the monitorix script still displayed (after restarting apache).

Note that I have run mythweb, phpmyadmin, cups admin,  and other web server applications without running into the problem I had with monitorix.

Again - if anybody has any insights into the above - your comments would be appreciated.

Thanks

belbo

Offline

#6 2011-04-11 22:41:52

belbo
Member
From: Sydney, Australia
Registered: 2011-02-25
Posts: 51

Re: Monitorix - getting it to work

I got the CPU / Core / MB temps to display which is what I really wanted this for. Now need to figure out which voltages (inX, inY etc) relate to which devices and get those to display sensibly, and also get gpu temp to display, which it isn't for some reason - but that's all pretty low priority.

If anyone has any insights into the 'puzzling' stuff above please let me know.

Thanks for the help.

belbo

Offline

#7 2011-05-05 11:47:31

cybertorture
Member
Registered: 2010-05-05
Posts: 339

Re: Monitorix - getting it to work

well i get to work 1 of voltages, but others do not apply same rules somehow Oo

Vcore Voltage:       +1.13 V  (min =  +0.85 V, max =  +1.60 V)

as

"VOLT0"  => "Vcore Voltage",

but thise does not work for instance

 +3.3 Voltage:       +3.23 V  (min =  +2.97 V, max =  +3.63 V)

as

"VOLT2"  => "\\+3.3 Voltage",

O' rly ? Ya rly Oo

Offline

Board footer

Powered by FluxBB