We currently migrate to MediaWiki from our old installation, but not all content has been migrated yet. Take a look at the Wiki Team page for instructions how to help or browse through our new wiki at wiki.linux-vserver.org to find the information already migrated.
[Cacti] is a tool to graph values, based on [RRDTool]. It's a bit like [MRTG] or [cricket].
This document is a HOWTO describing a way to graph vservers activity through the output of the vserver-stat command. This command shows the number of processes, the memory (RSS et VSZ) usage and CPU (system and user) consumption of the vservers hosted on a physical system.
We assume cacti is already installed, on a host called cacti.dom.tld. This document is based on cacti version 0.8.6g. The machine hosting the vservers is vs-host.dom.tld.
To graph values, cacti needs to be able to fetch theses values. The "classical" way to do that is by SNMP. In our case, this is not possible. So we must find a way to get on cacti.dom.tld the output of the vserver-stat command, executed on vs-host.dom.tld.
Many solutions are possible. Here is one possible solution, that is as secure as possible.
useradd -u 0 -o -s /usr/local/sbin/vserver-stat -m vs-stat
ssh-keygen -t dsa -f ~/.ssh/vs-stat
mkdir ~vs-stat/.ssh scp root@cacti.dom.tld:.ssh/vs-stat.pub ~vs-stat/.ssh/authorized_keys
ssh -i vs-stat vs-stat@vs-host.dom.tld
mkdir ~apache/.ssh cp ~root/.ssh/{vs-stat*,known_keys} ~apache/.ssh/ chown -R apache ~apache/.ssh/
Now we can begin the real hard part :-)
On