NAME

  arlogd - a remote logger


SYNOPSIS

  arlogd-server [-h] [-s] [-t] [-c config] [stop|start]
  arlogd-client [-h] [-s] [-t] [-c config] [stop|start]


DESCRIPTION

Arlogd provides remote logging ; a daemon on the client host transfers data to a daemon on the server host (loghost).

Start the (loghost or client) daemon with :

The exit status is 0 if a daemon is started (or was already running) ; 1 otherwise ; likewise for stop.

Without an argument, arlogd-server and arlogd-client show the daemon's status.

  arlogd-server
  arlogd-client

The exit status is 0 if the daemon is running ; 1 otherwise.

The default location for a config-file is arlogd.conf or /etc/arlogd/conf.

If/when $loghost is unavailable, the client will :

On the server, you can send commands to the daemon ; see ARLOGD-SERVER below.

On the client, the daemon periodicly writes a state-file $run_dir/client.state containing a list of watched fifo's ; see ARLOGD-CLIENT below.

See below :

how to use arlogd

To use remote logging for some logfile, just replace the logfile by a symlink to a fifo :

  # remote logging for /var/log/httpd/vhost/access.log
  % mkdir -p /var/log/fifos/httpd/vhost/
  % mkfifo   /var/log/fifos/httpd/vhost/access.log
  % cd /var/log/apache
  % mv access.log TEMP
  % ln -s /var/log/fifos/httpd/vhost/access.log .
  % cat TEMP > access.log

Things to check or do :


OPTIONS

-h

Show help and default config ; then exit.

-s

Be silent ; use logs instead of stdout ; used in init.d/ scripts.

-t

Just check the config.

-c file

Use config file.


CONFIGURATION

A configuration file must be specified with -c config-file or be present as

  ./arlogd.conf
  /etc/arlogd/conf

In the config-file, lines starting with # are skipped ; as are empty lines ; lines with leading and/or trailing white space are stripped. Each line contains a name/value pair, separated by white space.

The list below shows the default value for each name. $name indicates the configured value of entry name.

Config entries you should configure

Config entries you may want to set

Config entries that are probably sane


arlogd-server

Program arlogd-server opens two service ports (default 2207 and 2208), and forks a splitter, which does the actual work.

On port 2207 the daemon accepts data connections from hosts in $allow_hosts. The daemon expects lines like

  file-path log-line

The log-line is appended to file $log_dir/file-path.

If the log-line starts with / or contains .. as a path-component, the log-line is appended to file $log_dir/BAD.log.

On port 2208 the daemon accepts command connections from localhost.

To issue a command, on $loghost (for now) use netcat :

  echo command | nc -v localhost 2208

arlogd-server command-list


arlogd-client

arlogd-client - client.state

Every $upd_fifos seconds (default 60) the daemon writes file $run_dir/client.state.

It shows where the daemon is writing ($loghost or $save_file) and a list of watched fifo's in directory $fifos (default /var/log/fifos).


INSTALL

requirements

Installation of arlogd requires very little :

installation

Installation is simple :

fetch the software :

Checkout the repo :

  svn co https://svn.science.uu.nl/repos/project.arlogd/pub/trunk arlogd
install

On a server (loghost) :

  make -f install-server.mk

On a client :

  make -f install-client.mk

Arlogd is added as a service, but the service is not turned on or started. To turn on the service use

  chkconfig arlogd-server on
  chkconfig arlogd-client on
configure

To configure, edit /etc/arlogd/conf.

On the server (loghost), configure entry allow_hosts (default localhost).

  allow_hosts localhost webfarm.my.org monitor.my.org

On a client, configure entry loghost (default localhost).

  loghost loghost.my.org
run

On a server (loghost) :

  /etc/init.d/arlogd-server start

On a client :

  /etc/init.d/arlogd-client start

try it

watch the logs

On the loghost and the client watch the log :

  tail -F /var/log/arlogd.log
make a fifo

On the client, make a fifo :

  mkfifo /var/log/fifos/test

Within a minute, arlogd-client will start watching this fifo ; see the log.

write something

Write something to the fifo :

  echo something > /var/log/fifos/test

On the loghost, something should immediately appear in file

  /var/log/arlog/test
a fifo in a subdirectory

You can also try to create a fifo in a subdirectory ; and write to it immediately :

  mkdir -p /var/log/fifos/foo/bar
  mkfifo /var/log/fifos/foo/bar/test
  echo something else > /var/log/fifos/foo/bar/test

Expect echo to block ; be patient ; echo is waiting for a reader.

As soon as arlogd-client finds fifo foo/bar :

loghost : talk to the daemon

On the loghost, you can talk to the daemon if you have netcat nc(1).

  echo PING | nc localhost 2208

This should reply PONG.

production


How it all works


LOGGING

Commands arlogd-server and arlogd-client set an exit-code. They may write to stdout. Using -s (for silent) makes them silent.

The exit-code is 0 if

A running daemon may write to $logfile and syslog.


FILES

The default install does this :

  /etc/arlogd/conf
  /etc/arlogd/renames
  /etc/init.d/arlogd-client
  /etc/init.d/arlogd-server
  /var/lock/subsys/arlogd
  /var/log/arlog/
  /var/log/arlogd-save.log
  /var/log/arlogd.log
  /var/log/fifos/
  /var/run/arlogd/client.lck
  /var/run/arlogd/client.pid
  /var/run/arlogd/client.state
  /var/run/arlogd/server.lck
  /var/run/arlogd/server.pid


AUTHOR

© 2014 Henk P. Penning, Faculty of Science, Utrecht University
arlogd version arlogd-0.1.4 - Thu Sep 18 12:49:01 2014 UTC - dev revision 102


Valid XHTML 1.0 Strict   Valid CSS!