[DONE] m_wwwstats: allows Unreal to cooperate with a web statistics system

Need a module converted from 3.2.x to UnrealIRCd 4? Or looking for a certain module? Ask here.

Moderators: Gottem, Supporters

Post Reply
k4be
Posts: 27
Joined: Sun Jan 09, 2005 12:19 pm
Location: Poland

[DONE] m_wwwstats: allows Unreal to cooperate with a web statistics system

Post by k4be » Sat Dec 29, 2018 11:54 am

I have decided to share, after a few upgrades, a module that is now about 10 years old.

This one allows the Unreal to cooperate with a web statistics system. Two interfaces are used:

1. UNIX socket. The socket is created on a path specified in config block. When you connect to the socket, the module "spits out" all the current data in JSON format and closes. You can test it with the shell command

Code: Select all

socat - UNIX-CONNECT:/tmp/wwwstats.sock
. It can be used to generate channel lists, server lists, view user counts etc in realtime.
2. MySQL database. The module periodically inserts new data to the database, unless the data had not changed since the last insert. This can be used to generate graphs, view previous channel topics etc.
For obvious reasons you should not enable MySQL on more than one server on your network.

Compiling with mysql support needs mysql client libraries installed on your system. The module is compiled with the command EXLIBS="-lmysqlclient" make. If you happen to compile without the EXLIBS option, the module won't load. In such case you should rm src/modules/third/m_wwwstats.so and then retry.

Optionally, MySQL support can be completely removed (when you don't want to use it, and don't have the client libraries installed). Do this by changing the line #define USE_MYSQL to #undef USE_MYSQL in the module source.

+p / +s channels are always ignored.

The module looks for a config block:

Code: Select all

wwwstats {
	socket-path "/tmp/wwwstats.sock";	// do not specify if you don't want the socket
	use-mysql;	// remove this line if you don't want mysql
	mysql-host "localhost";
	mysql-db "database";
	mysql-user "username";
	mysql-pass "password";
};
Download link
More info on Github page.

Post Reply