httpdss / collectd-web

Collectd-web is a web-based front-end for RRD data collected by collectd
http://collectdweb.appspot.com
GNU General Public License v2.0
247 stars 72 forks source link

Issue no hosts listed when using with apache (standalone works ok) #58

Open litebito opened 11 years ago

litebito commented 11 years ago

Hi,

I installed collectd-web following instructions : tar xvjf collectd-web-X.X.X.tar.bz mv collectd-web-X.X.X collectd-web cp -a ./collectd-web /var/www/

then added the following to /etc/collectd/collections.conf datadir: "/opt/collectd_data/rrd/" libdir: "/usr/lib/collectd/"

collectd writes the rrdfiles to that directory : /opt/collectd_data/rrd/host1 /opt/collectd_data/rrd/host2 etc..

extracts from /etc/collectd/collectd.conf: (begin extracts)

BaseDir "/var/lib/collectd" PluginDir "/usr/lib/collectd"

DataDir "/opt/collectd_data/rrd"

Include "/etc/collectd/filters.conf" Include "/etc/collectd/thresholds.conf" Include "/etc/collectd/collection.conf"

(end extracts)

when I run: host1:/var/www/collectd-web# python runserver.py localhost 80

I can goto http://localhost (without "/collectd-web") and I see the UI, with the list of hosts

when I kill the server, and start apache I can goto http://localhost/collectd-web and I can see the UI, but there are no hosts listed

so it seems, when running in apache under /collectd-web ... it does not find the rrd files?

marbru commented 10 years ago

I had this issue as well. It was happening because apache was not processing the cgi scripts. You have to modify the configuration in sites-enabled with the AllowOverride all directive so that it will pick up the cgi configuration present in the .htaccess file on the cgi-bin folder.

The docs (http://collectdweb.appspot.com/documentation/) have some info on this. If you just do this:

<Directory /var/www/collectd-web>
  AllowOverride all
</Directory>

it should work (after you restart apache). Make sure you also have mod_cgi installed, or it won't work either. You can check it's working if you load one of the cgi scripts, and see if it resolves to an xml response instead of showing the raw script contents:

http://localhost/collectd-web/cgi-bin/collection.modified.cgi

Hope this helps!

sillekyatha commented 6 years ago

To people who has failed to list the 'hosts' on collectd-web GUI, this might also be one of the problem where the 'our $Config' under 'collectd-web/cgi-bin/collection.modified.cgi collection.modified.cgi' file should be changed to appropriate path where the collectd.conf file exists.