collectd-web icon indicating copy to clipboard operation
collectd-web copied to clipboard

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

Open litebito opened this issue 12 years ago • 2 comments

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?

litebito avatar Apr 29 '13 09:04 litebito

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!

marbru avatar Nov 10 '13 00:11 marbru

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.

sillekyatha avatar Feb 02 '18 05:02 sillekyatha