qmlogd

Installation and configuration instructions
Login

Requirements

This software are required at runtime to use qmlogd:

Qmlogd read log lines from stdin. So it may be used to parse log 'offline' or 'online' running it by udpsvd and sending while produced by svlogd, see examples.

So, if you want to run it offline a '<' may works fine, but if you need it to work in 'real time' you need to pass log lines to it using something like svlogd (by udp) while keep it listening using udpsvd.

qmlogd store analized data in a sqlite db, so a sqlite db must be provided and initialized using db.sql file: simply running on command prompt:

sqlite3 /path/to/file.sqlite
sqlite3>.read db.sql

qmlogd as is, parse date and time in format YYYY-MM-DD_HH:MM:SS.sssss (the one used by default by svlogd). If you use a different date and time format, change the tcl proc 'parsetime' in qmlogd.

Configuration parameters

qmlogd takes configuration parameters from environments variables, some are mandatory while others are optional. Follow a description of each of them:

Configuration examples

Follow a runit run file for a 'standalone' qmail server, which may be used also by a log collector server:

#!/bin/sh

exec 2>&1

export PATH=/opt/tcl/bin:$PATH
export LOGDB=/var/lib/qmlogd/qmaillog.sqlite3
export HOST=192.168.0.10
export PORT=15025

exec chpst -uuser /command/udpsvd -v $HOST $PORT /usr/local/bin/qmlogd

To send data from qmail-send to daemon, simply add a line in svlogd config file:

u192.168.0.10:15025

Here is a simple run file for a qmlogd running on a balanced qmail server, which sends data to collector:

#!/bin/sh

exec 2>&1

export PATH=$PATH:/opt/tcl/bin
export LOGDB=/var/lib/qmlogd/qmaillog.sqlite3
export HOST=192.168.0.11
export PORT=15025
export QMLSRV=192.168.0.10:15025

exec chpst -uqmaild /command/udpsvd -vv $HOST $PORT /var/qmail/bin/qmlogd