wiki'd

by JoKeru

System Performance Monitoring with collectd

[cc lang='bash']
\$ #echo 'statistics-channels { inet 127.0.0.1 port 8053; };' >> /etc/bind/named.conf.options
\$ #rnds reload

\$ apt-get install collectd-core
\$ cat \< /etc/collectd/collectd.conf
# http://collectd.org/documentation/manpages/collectd.conf.5.shtml
Hostname "wiki.jokeru.ro"
BaseDir "/var/lib/collectd"
PIDFile "/var/run/collectd.pid"
PluginDir "/usr/lib/collectd"
TypesDB "/usr/share/collectd/types.db"
Interval 60
ReadThreads 5 # default
WriteThreads 5 # default
# basic
LoadPlugin cpu
LoadPlugin memory
LoadPlugin disk
LoadPlugin interface
# advanced
LoadPlugin load
LoadPlugin processes
LoadPlugin contextswitch
LoadPlugin swap
LoadPlugin tcpconns
# write data
LoadPlugin rrdtool

DataDir "/var/lib/collectd/rrd/"

EOF
\$ service collectd restart

# http://collectdweb.appspot.com/ - web front-end for collectd
\$ apt-get install libhtml-parser-perl librrds-perl libjson-perl
\$ wget https://github.com/downloads/httpdss/collectd-web/collectd-web_0.4.0.tar.gz
\$ gunzip collectd-web_0.4.0.tar.gz
\$ tar -xf collectd-web_0.4.0.tar
\$ cd collectd-web
\$ ./check_deps.sh
Carp looks ok
CGI looks ok
CGI::Carp looks ok
HTML::Entities looks ok
URI::Escape looks ok
RRDs looks ok
Data::Dumper looks ok
JSON looks ok
\$ ./runserver.py 10.20.30.40 8080
[/cc]

EDIT: ubuntu
[cc lang='bash']
192.168.1.10 - - [26/Oct/2014 19:25:07] "GET /cgi-bin/collection.modified.cgi?action=hostlist_json HTTP/1.1" 200 -
Traceback (most recent call last):
File "/usr/lib/python2.7/CGIHTTPServer.py", line 252, in run_cgi
os.execve(scriptfile, args, env)
OSError: [Errno 13] Permission denied
192.168.1.10 - - [26/Oct/2014 19:25:07] CGI script exit status 0x7f00
192.168.1.10 - - [26/Oct/2014 19:25:07] "GET /cgi-bin/time.cgi HTTP/1.1" 200 -
Traceback (most recent call last):
File "/usr/lib/python2.7/CGIHTTPServer.py", line 252, in run_cgi
os.execve(scriptfile, args, env)
OSError: [Errno 13] Permission denied
192.168.1.10 - - [26/Oct/2014 19:25:07] CGI script exit status 0x7f00

root@debian-7:\~# grep nobody /etc/passwd
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh

root@ubuntu-14.04:\~# grep nobody /etc/passwd
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin

wget https://gist.github.com/jokeru/1777105c9eea2227ee5d#file-collectd-web_0-4-0-ubuntu-14-04-diff
\$ patch /usr/lib/python2.7/CGIHTTPServer.py \< collectd-web_0.4.0-ubuntu-14.04.diff

[/cc]

Comments