This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
computing:linux:syslog [2015/03/16 14:56] gcooper created |
computing:linux:syslog [2021/07/28 14:05] (current) gcooper old revision restored (2015/03/16 14:25) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Linux Syslog ====== | ====== Linux Syslog ====== | ||
- | ===== Centos 5 Server ===== | + | FIXME Unfinished - Need modify for newer CentOS (rsyslog), test and verify |
- | :!: This example assumes that your local network is 192.168.1.0/ | + | Assumptions: |
- | Open the firewall | + | * Your local network is 192.168.1.0/ |
+ | * The host you'd like to log for is also on that network | ||
+ | * You are only using IPv4 | ||
+ | ===== CentOS 5 Server ===== | ||
+ | |||
+ | ==== Firewall ==== | ||
+ | |||
+ | Open the server' | ||
+ | |||
+ | < | ||
vim / | vim / | ||
+ | </ | ||
- | add before CONFIRM: | + | Insert: |
+ | < | ||
-A INPUT –s 192.168.1.0/ | -A INPUT –s 192.168.1.0/ | ||
+ | </ | ||
- | Save and Exit. | + | Save, exit and restart |
- | + | ||
- | restart iptables: | + | |
+ | < | ||
service iptables restart | service iptables restart | ||
+ | </ | ||
- | | + | ==== Configure Syslog |
- | cd / | + | < |
+ | vim / | ||
+ | </ | ||
- | nano syslog | + | Modify |
- | + | ||
- | modify | + | |
- | + | ||
- | SYSLOGD_OPTIONS=" | + | |
- | + | ||
- | by adding -r inside the quotes, i.e. | + | |
+ | < | ||
SYSLOGD_OPTIONS=" | SYSLOGD_OPTIONS=" | ||
+ | </ | ||
- | Then restart syslog: | + | Then restart |
+ | < | ||
service syslog restart | service syslog restart | ||
+ | </ | ||
- | | + | Verify that syslog is monitoring port 514: |
+ | < | ||
netstat –anp | grep 514 | netstat –anp | grep 514 | ||
+ | </ | ||
If you get no result, then something' | If you get no result, then something' | ||
- | | + | Configure syslog to create a logfile for your device: |
- | cd /etc | + | < |
- | + | vim /etc/syslog.conf | |
- | nano syslog.conf | + | </ |
Add these lines: | Add these lines: | ||
- | # Put a description of what you're logging here - this is for your benefit and | + | < |
- | # you can put anything you want | + | # Describe host you're logging here |
- | *.* /etc/log/logfilename.log | + | *.* /etc/log/yourlogfilename.log |
+ | </ | ||
Note: the spaces between . and / | Note: the spaces between . and / | ||
- | | + | Set-up whatever device allows for syslog and give it the IP address of your PBX system. If you want another |
- | + | ||
- | cd /etc | + | |
- | nano syslog.conf | + | < |
+ | vim /etc/syslog.conf | ||
+ | </ | ||
Add a line like this: | Add a line like this: | ||
+ | < | ||
*.* | *.* | ||
+ | </ | ||
Note: the spaces between . and @IPADDRESS must be inserted using the TAB key! | Note: the spaces between . and @IPADDRESS must be inserted using the TAB key! | ||
- | | + | To view the logfile: |
- | cd /etc | + | < |
- | nano logfilename.log | + | tail -f / |
+ | </ |