User Tools

Site Tools


computing:linux:syslog

This is an old revision of the document!


Linux Syslog

Centos 5 Server

:!: This example assumes that your local network is 192.168.1.0/24.

Open the firewall to listen on UDP port 514:

vim /etc/sysconfig/iptables

add before CONFIRM:

-A INPUT –s 192.168.1.0/255.255.255.0 -m udp -p udp –dport 514 -j ACCEPT

Save and Exit.

restart iptables:

service iptables restart

  Configure Syslog to monitor Port 514:

cd /etc/sysconfig

nano syslog

modify the line that reads:

SYSLOGD_OPTIONS=“-m 0”

by adding -r inside the quotes, i.e.

SYSLOGD_OPTIONS=“-m 0 -r”

Then restart syslog:

service syslog restart

  Verify that syslog is monitoring port 514:

netstat –anp | grep 514

If you get no result, then something's wrong. If you get a result, then syslog is working and monitoring port 514.

  Configure syslog to create a logfile for your device:

cd /etc

nano syslog.conf

Add these lines:

# Put a description of what you're logging here - this is for your benefit and # you can put anything you want *.* /etc/log/logfilename.log

Note: the spaces between . and /etc/log/… must be inserted using the TAB key! logfilename.log can be whatever name you want for your logfile.

  Set-up whatever device allows for syslog and give it the IP address of your PBX system. If you want another Centos Machine to send logs to yours, then 

cd /etc

nano syslog.conf

Add a line like this:

*.* @IPADDRESSOFRECEIVING MACHINE

Note: the spaces between . and @IPADDRESS must be inserted using the TAB key!

  To view the logfile:

cd /etc nano logfilename.log

computing/linux/syslog.1426539379.txt.gz · Last modified: 2015/03/16 14:56 by gcooper