Vetinari's $HOME

rrdstats.tcl

rrdstats.tcl is an eggdrop script, which displays the channel stats for join/part/kick, lines spoken, users on channel as images. It uses the rrdtool for this task.

An example can be found on http://lost.channelno5.de/~phoenix/daily.html

Download

rrdstats 0.5

Config

The config file rrdstats.conf is shared by the eggdrop script rrdstats.tcl and the graph creation script mkrrdgraphs.tcl. It should be placed inside your eggdrop installation dir, usually as ~/eggdrop/rrdstats.conf.

rrd_time

This is how long the one round of data is kept (in 2001 when this was written, some people cared about these sizes...). Possible values are:

0

one day - uses ~350 kB user stats, ~150 kB line stats, ~100 kB join stats, per channel

1

one week - uses ~2.4 MB user stats, ~1 MB line stats and ~650 kB join stats per channel

2

one month - this needs ~7.5 MB for user data, ~3 MB for line and ~2 MB for joins PER CHAN, only activate this if you have enough disk space...

Warning: do not change the value once the bot has read the script... OR delete the .rrd files and .rehash (all data is lost)

rrd_stats(users)

records how many voice/ops/users are on the chan

rrd_stats(joins)

joining and leaving the channel

rrd_stats(lines)

counts the lines/actions per minute on the chan

rrd_stats(length)

length of the spoken lines/actions

rrd_stats(words)

words per line / words per action

rrd_stats(domain)

stats which domains are present

Set rrd_stats(NAME) to 0 if you do not want one type of stats

rrd_domains

A list of domains which should be matched together. If you want to filter a subdomain and also show the domain, add the subdomain before the domain. Example:

 set rrd_domains {
    *.t-dialin.net *.pppool.de *.de
 }

rrd_file

This is the file(s), where RRD keeps it's database, any %chan will be replaced by the channel name without #!&+, i.e. the channel #a_chan will have the users rrd file './rrd/a_chan-users.rrd'. Note: ALWAYS include a %type and %chan...

rrd_color(users-cur)

rrd_color(ops-cur)

rrd_color(voice-cur)

rrd_color(lines-cur)

rrd_color(actions-cur)

rrd_color(joins-cur)

rrd_color(parts-cur)

rrd_color(quits-cur)

rrd_color(kicks-cur)

rrd_color(domain-ip)

rrd_color(domain-other)

rrd_color(domain-1)

rrd_color(domain-2)

rrd_color(domain-3)

Colors of the graphs for current users/ops/voice/lines/actions...

Use colors like in HTML (NOT names!)... leave them defined, even if you do not show the stats for them...

rrd_chans

Channels for which stats should be made

rrd_title(users)

rrd_title(lines)

rrd_title(words)

rrd_title(length)

rrd_title(joins)

This is the title of the graph, %chan will be replaced by the channel name.

rrd_imgtype

Type of image... supported values are: PNG GIF. The default PNG is recommended.

rrd_graph_update

Draw the graph every $rrd_graph_update minutes. Set to 0 to use the external command scripts/mkrrdgraphs.tcl to create the graphs from a cron job (highly recommended). Use a line like this in your crontab to start it every 15 minutes:

 5,20,35,50 * * * * cd $HOME/eggdrop && tclsh ./scripts/mkrrdgraphs.tcl > /dev/null 2>&1 

rrd_graph

Where should we write the graphs...

ALWAYS have %type, %time, %img and %chan in the name :o)

%img

is the lowercased $rrd_imgtype

%chan

is the same as in $rrd_file

%type

is what kind of stats (users, lines)

%time

is daily, weekly or monthly

rrd_lib

If your eggdrop can not load the rrd lib (tclrrd.so from the tcl/ subdir of the rrdtool source) automatically from the TCL search path, use this (the rrdstats.tcl and mkrrdgraphs.tcl will load it for you)... else set to ""

rrd_bot_dir

This is the directory, where your bot is installed.