Public | Automated Build

Last pushed: 2 years ago
Short Description
nixstats tools and script containerized to run on coreos.
Full Description

Adjusted sysstat for Docker use

This is a patched sysstat which can be used to lookup /proc for CoreOS use. Within CoreOS it is not possible to execute a volume mount on /proc. In order to achieve this, the sourcode has been patched to use /host/proc. By executing a volume mount on /host/proc, sysstat is able to collect metrics from the guest CoreOS system.

Applied patch

The modification is rather simple but effective. The code is executed through in the shell script which is modified to check if it is running inside a docker container. In case you run the script on a non dockerized system, it will behave as usual. This modification is done on sysstat and

cron have been added too as it is usually not present in the containers.

echo "Configuring sysstat..."
if [ -f /.dockerinit ]; then
    echo "I'm inside matrix ;(";
    grep -rl $oldstring ./ | xargs sed -i s@$oldstring@$newstring@g
    echo "I'm living in real world!";

Run the image

Last but not least we need to run the image of course. Please note that we run the container in read-only mode.

sudo docker run -d --name nixstats \
  --volume=/:/rootfs:ro \
  --volume=/var/run:/var/run:rw \
  --volume=/sys:/sys:ro \
  --volume=/proc:/host/proc \
  --privileged \
  --pid=host \
  --net=host \
-e SERVERID=$(cat /etc/machine-id) \

#HTTP proxy case

In order to make the data go through your http proxy you have to add the following parameter:

-e https_proxy=http://<your proxy>:<proxy_port>/

Docker Pull Command
Source Repository