Syslog-ng-phoebus

From CEDPS

Jump to: navigation, search

The following are instructions for building/installing syslog-ng for use in the Phoebus SC bandwidth challendge for SC2007. These instructions for an installation which does not override or replace the systems native syslog program.

Contents

Installation

Do the following:

# if /usr/lib/libglib-2.0.so is missing, do this first
apt-get install libglib2.0-dev 
# download
wget http://www.balabit.com/downloads/files/syslog-ng/sources/stable/src/eventlog-0.2.5.tar.gz
wget http://www.balabit.com/downloads/files/syslog-ng/sources/stable/src/syslog-ng-2.0.5.tar.gz
tar xvzf eventlog-0.2.5.tar.gz
tar xvzf syslog-ng-2.0.5.tar.gz
cd eventlog-0.2.5
./configure --prefix=/path_to_install
make
make install
#
cd ../syslog-ng-2.0.5
setenv EVTLOG_CFLAGS "-I/path_to_install/include/eventlog"
setenv EVTLOG_LIBS "-L/path_to_install/lib/ -levtlog"
./configure --prefix=/path_to_install
make
make install

Note: You can do 'apt-get install syslog-ng' instead, but this will override the default syslog.

Create syslog-ng configuration file

options {
  use_fqdn(yes);  # use fully qualified domain names
  ts_format(iso);  # use ISO8601 timestamps
  #
  # for normal load
  flush_lines (10); # number of lines to buffer before writing to disk
  log_fifo_size(100); 
  #
  # for heavy load
  #flush_lines (1000); # number of line to buffer before writing to disk
  #log_fifo_size(1000); 
  #
  stats_freq(3600);  # number of seconds between syslog-ng internal stats events; these are useful
                              # for ensuring syslog-ng is not getting overloaded
};
#
source phoebus_log { file ("/mypath/phoebus.log" follow-freq(1) flags(no-parse) log_prefix('phoebus_log ') ); };
source syslog_ng { internal(); };
#
# define the Forwarding Destination
destination lbl_dst {  tcp("netlogger.lbl.gov" port(5141)); };
destination syslog_ng_dst {  file ("/tmp/syslog-ng.log" perm(0644) ); };
#
# forward sources to destination
log { source(phoebus_log); destination(lbl_dst); flags(flow-control); };
# for syslog-ng debugging
log { source(syslog_ng); destination(syslog_ng_dst); };

Start syslog-ng

Run the following

/path_to_install/sbin/syslog-ng -F -f config-file.cfg

Validation

To test all is working, try this:

cat "this is a test message" >> /path/phoebus.log

Check to see that the message arrived at netlogger.lbl.gov:

tail /var/log/grid/2007.11/phoebus.log
Personal tools