Syslog
LTSP uses the syslog logging mechanism to send client logging messages to the server's syslog daemon.
If you have information about configuring syslog on the server, please add it to this page.
--
JimMcQuillan - 16 May 2006
Centralized Logging Using syslog-ng
I got this working under Ubuntu Dapper, but the process should be pretty similar for almost any version of Linux. I should note that you can setup a centralized logging server for your thin clients on any Linux host on the network. It doesn't need to be your LTSP server. It could be an old Pentium machine running a very minimal version of Debian as long as the thin clients can access the logging server via UDP. I actually have my thin clients logging through a
FreeBSD? router to a Linux server on another subnet. Feel free to be creative with this one.
Installing syslog-ng
Under Ubuntu and Debian based systems, we use apt-get (or Synaptic) to install syslog-ng. If you're using Fedora, Suse, or another distribution then you'll need to the appropriate package manager to install syslog-ng.
apt-get install syslog-ng
This will remove the existing syslog daemon and replace it with syslog-ng.
Configure syslog-ng to Accept Remote Logging
Edit /etc/syslog-ng/syslog-ng.conf and add the following lines to the end of the file:
#
# If you wish to get logs from remote machine you will need this server
# to listen upon port 514.
#
source remote { udp(); };
#
# Automatic host sorting
# Store all files beneath '/var/log/NAME OF MACHINE/facility
# Create these directories if required, with the given permissions.
#
destination hosts { file("/var/log/HOSTS/$HOST/$FACILITY.log" owner(root)
group(root) perm(0600) dir_perm(0700) create_dirs(yes)); };
#
# log by host (as defined above) anything that's coming from the
# remote socket.
#
log { source(remote); destination(hosts); };
Configure the LTSP Clients
Add the following line to your lts.conf file and substitute the IP address of the syslog server:
SYSLOG_HOST = 192.168.0.10
Essentially, this tells syslog-ng to listen on UDP (port 514) for remote syslog requests. When it receives syslog entries it creates a directory under /var/log/HOSTS/ using the IP address of the thin client machine. It then creates log files in that directory.
Making it Work
- Type the following to restart syslog-ng: /etc/init.d/syslog-ng restart
- Reboot a thin client
Checking the Logs
Go to /var/log/HOSTS/ and you should see a list of directories that are named after the IP address of each client.
For example:
root@dhcp:/var/log/HOSTS# ls -al
total 16
drwx------ 4 root root 4096 2006-05-16 12:47 .
drwxr-xr-x 5 root root 4096 2006-05-16 12:41 ..
drwx------ 2 root root 4096 2006-05-16 12:47 192.168.20.224
drwx------ 2 root root 4096 2006-05-16 14:24 192.168.30.156
If you go into one of the directories you should see the following:
root@dhcp:/var/log/HOSTS/192.168.20.224# ls -al
total 44
drwx------ 2 root root 4096 2006-05-16 12:47 .
drwx------ 4 root root 4096 2006-05-16 12:47 ..
-rw------- 1 root root 116 2006-05-16 14:29 daemon.log
-rw------- 1 root root 176 2006-05-16 14:29 syslog.log
-rw------- 1 root root 25061 2006-05-16 14:29 user.log
--
CaseyWoods - 16 May 2006