จัดเก็บ Logs ของ ADSL Router ด้วย syslog บน CentOS


แค่ออกแรงปรับแต่ง ADSL Router (ZyXel P660HW-T1) กับ syslog บน CentOS เพิ่มเติมอีกนิดก็จะสามารถจัดเก็บ Logs ของ ADSL Router ได้แล้วครับ

ขั้นแรกทำการแก้ไข file “/etc/sysconfig/syslog” โดยเพิ่ม -r เข้าไปที่ SYSLOGD_OPTIONS ซึ่งเดิมๆ จะเป็นตามนี้ครับ

SYSLOGD_OPTIONS="-m 0"

หลังจากทำการแก้ไข

SYSLOGD_OPTIONS="-r -m 0"

เพิ่ม -r เข้าไปยัง SYSLOGD_OPTIONS เพื่อจะบอกให้ syslog daemon ยอมรับ logs จากเครื่องหรืออุปกรณ์อื่นๆ

จากนั้นเพิ่ม config เข้าไปใน file “/etc/syslog.conf” ตามนี้ครับ

local2.*                                                /var/log/zyxel-p660hw.log

คราวนี้ย้ายจาก CentOS มาจัดการกับ ZyXEL P660HW-T1 กันครับ

1. telnet ZyXel-IP-Address
2. Select Number 24 -> 3 -> 2 (24.System Maintenance, 3.Log ans Trace, 2.Unix Syslog)
UNIX Syslog:
Active= Yes
Syslog IP Address= ZyXel-IP-Address
Log Facility= Local 2

Log Facility ต้องมีค่าเท่ากันกับ config ที่ได้เพิ่มเข้าไปในfile “/etc/syslog.conf” ที่ผ่านไปเมื่อครู่นี้ครับ โดยปกติจะมีค่าอยู่ระหว่าง Local 1 - Local 7

เพียงเท่านี้ก็สามารถจัดเก็บ Logs ของ ADSL Router ด้วย syslog บน CentOS ได้แล้วครับ (อย่าลืม restart syslog ด้วยนะครับ)

Tags: , , , , , , ,


One Response to “จัดเก็บ Logs ของ ADSL Router ด้วย syslog บน CentOS”

  1. กวิน ชัยเลิศ Says:

    สำหรับ syslog บน Ubuntu และ Debian ให้ทำการแก้ไข file “/etc/default/syslogd” เพื่อรับ Logs จากเครื่องอื่นๆ โดยทำการเปลี่ยน option จาก SYSLOGD=”" เป็น SYSLOGD=”-r”

Leave a Reply