Second Batch Update

| Comments

Ah, hello.
I was trying to move wordpress comments to disqus before and turn out failed. Seems disqus doesn’t support post link edit, and the comments still refer to wordpress.com. As for now I try to pull out some kind of site monitoring system. Been searching on various projects and bumped to collectd.

Since collectd main function is to collect various data, I still have to tinker some more to represents the stats. Fortunately collectd packed with some scripts for graphing. At first I think I’ll just put some cronjob to generate static html and the graph files hourly, But then I found visage. The project itself looks like in hiatus. I made a fork and patch things out to make it work with latest gems (some dependencies), plus bash script as a wrapper for supervisord.

This is the script, though it’s poorly done ^_^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /usr/bin/env bash

PREFIX="/opt/collectd"
export TYPES="$PREFIX/share/collectd/types.db"
export RRDDIR="$PREFIX/var/lib/collectd/rrd"
export CONFIG_PATH="$HOME/.collectd"
SERVER="puma"

if [ ! -d $CONFIG_PATH ]; then
    mkdir -p "$CONFIG_PATH"
fi


hash visage-app 2>&- || { \
    echo >&2 "visage not installed"; \
    exit 1; \
}

visage-app start $SERVER

And here be my fork. You can use it like this:

1
2
3
$ git clone https://bitbucket.org/fudanchii/visage.git
$ cd visage
$ bundle install

Make sure your environment variables has this:
TYPES=<your types.db path here, from collectd>
RRDDIR=<your rrd files path>
CONFIG_PATH=<path to visage config file>
before executing:

1
2
3
$ bin/visage-app start
//or alternatively use thin as webserver
$ bin/visage-app start thin

rake install will build the gem and install it to your system.

Comments