NAME

  arlogd - a remote logger


SYNOPSIS

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


DESCRIPTION

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

start

Start the (loghost or client) daemon with :

  arlogd-server start
  arlogd-client start

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

stop

Stop a daemon with :

  arlogd-server stop
  arlogd-client stop

The exit status is 0 if a daemon was stopped (or wasn't running) ; 1 otherwise.

state

To query the running daemon's state, use argument state :

  arlogd-server state
  arlogd-client state

The daemon reports :

The exit status is 0.

status

Without an argument, arlogd-server and arlogd-client just shows 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 :

You can send commands to a running daemon ; see ARLOGD-SERVER and 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.

--version

Just print the version and exit.

-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).

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

  file-path log-line

The log-line is appended to file $log_dir/file-path, or $log_dir/prefix/file-path, if the a prefix is set for the allowed host.

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

A client-daemon watches named pipes in directory $fifos.

arlogd-client command-list


INSTALL

requirements

Installation of arlogd requires very little :

installation

Installation is simple :

fetch the software

subversion check-out :

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

rsync :

  rsync rsync.cs.uu.nl::arlogd

package :

  http://www.staff.science.uu.nl/~penni101/arlogd/arlogd.tar.gz
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_host (default localhost).

  allow_host localhost
  allow_host webfarm.my.org
  allow_host 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
  /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-2015 Henk P. Penning, Faculty of Science, Utrecht University
42415515133 version arlogd-0.1.8 - Wed Mar 4 08:25:17 2015 UTC - dev revision 186


Valid XHTML 1.0 Strict   Valid CSS!