logpipe FFS
Date | Version | Author |
Apr. 25, 2006 | 1.1 | Oliver Kurth |
Apr. 13, 2006 | 1.0 | Oliver Kurth |
Introduction
The purpose of logpipe is to reliably transfer logging data over
the network using an encrypting method.
The main requirements are:
- no loss of data, or at least as possible
- using an encrypted channel over the network
- speed, has to work on an ACS with data coming from up to 48 serial ports.
- no permanent network connection required.
- alert when data cannot be forwarded.
Description
logpipe reads from unidirectional pipes. Whenever data are
available, these will be written to other pipes, files or tcp
connections. All data coming from all inputs will be written to
all outputs.
Writing data may require a tunnel, this will be realized over
ssh. The command to establish the tunnel will be started from
within logpipe, and killed when there are no data after some time.
Configuration
logpipe reads from a configuration file. The format is:
global{
interval: 15
}
pipe{
event{
spec: pipe:/tmp/event
type: read
create: yes
urgent: yes
}
cybuf{
count: 48
spec: pipe:/tmp/ttyS%d.pipe
type: read
create: no
}
savefile{
spec: file:/tmp/logfile
type: write
save: yes
max_size: 1000000
}
tunnel{
spec: tcp:127.0.0.1:1514
type: write
tunnel_cmd: ssh -N -L 1514:127.0.0.1:514 oku@192.168.48.155
tunnel_timeout: 15
alert_cmd: echo alert
max_buf: 10000
}
}
Global options are configured under 'global'. So far, there is
only 'interval' which determines the interval the status of the
connection is checked (in seconds).
The sub sections below 'pipe' can have arbitrary names. Each
defines a connection, which can be for reading or writing.
Each 'pipe' has the following options:
- spec: determines the file name, pipe name or ip address and
port. It is prefixed with either file:, pipe: or
tcp: and followed, depending on the prefix, by the file
or pipe name, or an ip address and a port number separated by a
colon.
- type: can be either read or write.
- count: for creating multiple pipes that share all parameters
except their names. The spec will be expanded using sprintf(),
with %d replaced by a number between 1 and count.
- tunnel_cmd: the command, including all command line
parameters to set up the tunnel.
- tunnel_timeout: the time in seconds since the last write,
after which the tunnel command is killed.
- max_size: (only for files) the maximum file size. When the
size grows larger, the file will be moved to the name of the
file with '.0' appended.
- max_buf: (only for output) the maximum buffer size. When the
size grows larger, data will be discarded.
- alert_cmd: (only for output) the command, including all command line
parameters which will be executed when data will be
discarded. This is for sending an alarm, for example an snmp
trap.
- urgent: (only for input) if set to 'yes', the tunnel will be started
immediately on the output channel(s) whenever data becomes
available from this input.
- save: (only for files, once only) indicates that this is the
file from which data will be read from in the case that logpost
has been restarted, but was not yet able to send these data.
Oliver Kurth
Last modified: Tue Apr 25 17:02:47 PDT 2006