Syslog-ng package for VDT
From CEDPS
This page describes how to install and configure the syslog-ng package that the CEDPS project developed for the Virtual Data Toolkit (VDT). This package can be used alone (ie: no other VDT services running), but it does depend on many other components in VDT.
Contents |
Install
To install pacman for the first time:
cd /opt wget http://physics.bu.edu/pacman/sample_cache/tarballs/pacman-latest.tar.gz tar xzf pacman-latest.tar.gz cd pacman-<version> source setup.sh source setup.sh # yes, twice mkdir /opt/OSG cd /opt/OSG
Otherwise if installing syslog-ng into an existing VDT location:
cd /opt/OSG source setup.sh
Then install the OSG:Syslog-ng package:
pacman -get OSG:Syslog-ng
If this is a first install and on Ubuntu, then use:
pacman -pretend-platform Debian-4 -get OSG:Syslog-ng
Note that pacman (think 'tar' not 'rpm') is sensitive to it's current working dir, so take care to be in the VDT dir when installing new packages into and existing VDT Location. Otherwise it will try installing a whole new VDT location where it runs.
Configuration
The syslog-ng-sender and syslog-ng-receiver services come with configuration scripts for editing their respective .conf files (which live in $VDT_LOCATION/syslog-ng/etc/). This is preferable to editing the .conf files directly. More details on these scripts can be found by running with the --help option or running it through the perldoc command. It can also help to look at the .conf files before and after running the commands to see how they are changed and if that makes sence, depending on your level of understanding on how syslog-ng works.
(To enable/disable & start/stop each of these, see the sections below "Enable/Disable" and/or "Start/Stop".)
Configure syslog-ng-sender
To configure a syslog-ng sender, i.e. changing the local collector, adding a new source, etc., use the VDT configure script as follows.
To identify the machine running the receiver use the --local-collector option:
$VDT_LOCATION/vdt/setup/configure_syslog_ng_sender --local-collector myloghost.foo.gov
To add files for the sender to forward to the receiver use the --add-source options identifying the full path the to log file:
$VDT_LOCATION/vdt/setup/configure_syslog_ng_sender --add-source "/tmp/testfile"
To set-up the syslog-ng sender to be run as a VDT controlled server run:
$VDT_LOCATION/vdt/setup/configure_syslog_ng_sender --server y
Configure syslog-ng-receiver
To configure a syslog-ng receiver, i.e. defining where logs are collected to, use the VDT configure script as follows.
To identify the top-level directory to place the collected logs use the --dir option:
$VDT_LOCATION/vdt/setup/configure_syslog_ng_receiver --dir /opt/osg-logs
To set-up the syslog-ng receiver to be run as a VDT controlled server run:
$VDT_LOCATION/vdt/setup/configure_syslog_ng_receiver --server y
Enable / Disable Services
All the following commands assume you have already setup your env for running VDT commands:
cd /opt/OSG source setup.sh
To see what VDT services will be run at start-up (you will need to have already run the above configure script with the --server y option for your sender a/o receiver to show up):
vdt-control --list
To enable a services to run at system start-up:
vdt-control --enable syslog-ng-sender
Change enable with disable and/or syslog-ng-sender with syslog-ng-receiver as needed.
Start/Stop
To start or stop the service use the --on/--off option of the vdt-control command:
vdt-control --on syslog-ng-sender vdt-control --on syslog-ng-receiver
This is preferable to using the /etc/init.d (or equivalent) system-level scripts.
Debugging
To see if it is actually running:
pgrep -fl syslog-ng
This might report more than one syslog-ng process as there may be a system one in addition to the VDT one (which will be named as above). Note the arg to the -f option identifying the config file, which is usually $VDT_LOCATION/syslog-ng/etc/syslog-ng-{sender,receiver}.conf
The default log file for the syslog-ng process itself can be found at: /tmp/syslog-ng.log
