Skip to content

Instantly share code, notes, and snippets.

@evandhoffman
Last active June 6, 2017 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evandhoffman/720c66b8b0a1c779f905b73b75ac4f6e to your computer and use it in GitHub Desktop.
Save evandhoffman/720c66b8b0a1c779f905b73b75ac4f6e to your computer and use it in GitHub Desktop.
Collectd collection3 nginx config for Ubuntu 14.04

Packages

apt-get install libconfig-general-perl libregexp-common-perl collectd collectd-utils lm-sensors \
libcgi-fast-perl librrds-perl libhtml-parser-perl libjson-perl fcgiwrap nginx

Changing collection3 chart size:

  • Edit /usr/share/doc/collectd-core/examples/collection3/etc/collection.conf - change GraphHeight and GraphWidth at the top.
TypesDB "/usr/share/collectd/types.db"
LoadPlugin syslog
<Plugin syslog>
LogLevel info
</Plugin>
LoadPlugin cpu
LoadPlugin cpufreq
LoadPlugin df
LoadPlugin disk
LoadPlugin dns
LoadPlugin entropy
LoadPlugin ethstat
LoadPlugin interface
LoadPlugin ipmi
LoadPlugin irq
LoadPlugin load
LoadPlugin memory
LoadPlugin md
LoadPlugin network
LoadPlugin ntpd
LoadPlugin numa
LoadPlugin processes
LoadPlugin rrdtool
LoadPlugin sensors
LoadPlugin swap
LoadPlugin thermal
LoadPlugin uptime
LoadPlugin users
LoadPlugin vmem
<Plugin df>
FSType rootfs
FSType sysfs
FSType proc
FSType devtmpfs
FSType devpts
FSType tmpfs
FSType fusectl
FSType cgroup
IgnoreSelected true
</Plugin>
<Plugin "rrdtool">
DataDir "/var/lib/collectd/rrd"
CacheFlush 120
WritesPerSecond 50
</Plugin>
Include "/etc/collectd/collectd.conf.d"
# This section of nginx config is designed to make collectd charts accessible via http://host/collection3/
# rather than the URL root (http://host/).
location ~ .cgi$ {
root /usr/share/doc/collectd-core/examples/;
if (!-e $request_filename) { rewrite / /collection3/bin/index.cgi last; }
expires off;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_index index.cgi;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location /collection3/share {
alias /usr/share/doc/collectd-core/examples/collection3/share;
}
location /collection3 {
root /usr/share/doc/collectd-core/examples/;
index bin/index.cgi;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment