[syslog-ng]Missing pieces of information when destination = program

mrugan syslog-ng@lists.balabit.hu
Sat, 4 Sep 2004 15:16:35 +0300


Hy list,

My goal is to log to a linux host (slackware 9) running
syslog-ng 1.6.5, libol 0.3.14, libnet 1.1.2.1 information
broadcasted by multiple windows hosts running MBM (mother board
monitor) via syslog logging mechanism that MBM has build in.
MBM is set up to broadcast via udp 514 at 300 seconds interval
readings from 12 sensors. Syslog-ng message gathering setup via filters was required

options
  {
    chain_hostnames(no); create_dirs (yes); dir_perm(0755);
    dns_cache(yes); keep_hostname(yes); log_fifo_size(2048);
    log_msg_size(16348); long_hostnames(on); perm(0644);
    stats(3600); sync(0); time_reopen (10); use_dns(no); use_fqdn(no);
  };
#
filter       f_mbm          { facility(daemon) and match("MBM"); };
# test destination to pipe
destination mbm_pipe {
            pipe("/tmp/mbm-pipe"
            template("$WEEKDAY $DATE $YEAR $HOST $MESSAGE\n")); };

# wanted to be the real-time analyzer
destination mbm_pipe {
            program("/var/rrd/test.pl"
            template("$WEEKDAY $DATE $YEAR $HOST $MESSAGE\n")); };
#
# log setup
log { source(s_udp);
      source(s_internal);
      filter(f_mbm);
      destination(mbm_pipe); };
#

however i encountered these problems:
on the typical setup destination to a fifo pipe (mkfifo ...) every 300
seconds arrive 12 lines looking like:
Sat Sep  4 14:53:54 2004 TAQWA MBM[CaseTemp]: C=39 LA=5 HA=70 L=32 H=42 A=38
Sat Sep  4 14:53:54 2004 TAQWA MBM[CPUTemp]: C=35 LA=5 HA=70 L=31 H=45 A=35
Sat Sep  4 14:53:54 2004 TAQWA MBM[VCore]: C=1.60 LA=1.90 HA=2.10 L=1.57 H=1.60 A=1.59
Sat Sep  4 14:53:54 2004 TAQWA MBM[VAGP]: C=1.60 LA=1.90 HA=2.10 L=1.60 H=1.60 A=1.60
Sat Sep  4 14:53:54 2004 TAQWA MBM[VDimm]: C=2.50 LA=3.13 HA=3.46 L=2.50 H=2.50 A=2.50
Sat Sep  4 14:53:54 2004 TAQWA MBM[Vio]: C=3.26 LA=4.75 HA=5.25 L=3.23 H=3.28 A=3.26
Sat Sep  4 14:53:54 2004 TAQWA MBM[5V]: C=5.11 LA=11.40 HA=12.60 L=5.00 H=5.11 A=5.09
Sat Sep  4 14:53:54 2004 TAQWA MBM[12V]: C=12.22 LA=-11.40 HA=-12.60 L=12.10 H=12.59 A=12.27
Sat Sep  4 14:53:54 2004 TAQWA MBM[5VSB]: C=5.43 LA=4.95 HA=5.05 L=5.43 H=5.46 A=5.43
Sat Sep  4 14:53:54 2004 TAQWA MBM[VBat]: C=3.15 LA=4.75 HA=5.25 L=3.15 H=3.15 A=3.15
Sat Sep  4 14:53:54 2004 TAQWA MBM[CPUFan]: C=3013 LA=2600 HA=99999 L=2909 H=3068 A=2974
Sat Sep  4 14:53:54 2004 TAQWA MBM[CPUMHz]: C=1760 LA=0 HA=100 L=1760 H=1760 A=1760
nothing to worry, processing goes on with sucessfull results.

beeing greedy, a simple perl script was written to illustrate
capability of syslog-ng to log via program.

open(FILE, ">> /tmp/mbm-file") or die "Can't open FILE : $!\n";
while (<>) {
print FILE $_;
}
close (FILE);

this time i noticed pieces of info missing, random lines beeing
truncated, no special pattern could be distinguished, writing stops
randomly while MBM logs whole 12 lines. ex: Sat Sep  4 14:53:54 2004 TAQWA MBM[CPUFan]
or even Sat Sep 4 ... and so on...


please advise.

thanks a log. :)

mrugan  |_at_| softhome.net