Розбіжності
Тут показані розбіжності між вибраною ревізією та поточною версією сторінки.
Порівняння попередніх версій Попередня ревізія Наступна ревізія | Попередня ревізія | ||
debian:syslog-ng [25/07/2024 20:28] – Method | debian:syslog-ng [25/07/2024 22:17] (поточний) – [Install Syslog-NG] Method | ||
---|---|---|---|
Рядок 1: | Рядок 1: | ||
====== Syslog-NG ====== | ====== Syslog-NG ====== | ||
+ | ===== Install Syslog-NG ===== | ||
<code bash> | <code bash> | ||
- | wget -qO - https:// | + | wget -qO - https:// |
- | echo "deb https:// | + | echo " |
apt update | apt update | ||
apt-get install syslog-ng-core syslog-ng-scl | apt-get install syslog-ng-core syslog-ng-scl | ||
</ | </ | ||
+ | |||
+ | test message from localhost | ||
+ | # logger --server 127.0.0.1 -p local0.info -t test "This is a test message" | ||
===== A10 Thunder NAT logging ===== | ===== A10 Thunder NAT logging ===== | ||
- | ==== on A10 Thunder ==== | + | ==== Syslog-NG server |
- | + | ||
- | <code bash> | + | |
- | nat-0> | + | |
- | !Section configuration: | + | |
- | ! | + | |
- | cgnv6 server syslog1 172.16.0.37 | + | |
- | health-check-disable | + | |
- | port 1515 tcp | + | |
- | ! | + | |
- | + | ||
- | cgnv6 service-group syslog tcp | + | |
- | member syslog1 1515 | + | |
- | ! | + | |
- | cgnv6 template logging lsn_logging | + | |
- | facility local7 | + | |
- | severity informational | + | |
- | batched-logging-disable | + | |
- | service-group syslog | + | |
- | source-address | + | |
- | ip 172.16.0.6 | + | |
- | disable-log-by-destination | + | |
- | icmp | + | |
- | ! | + | |
- | </ | + | |
- | + | ||
- | ==== On Syslog-NG server ==== | + | |
nano / | nano / | ||
Рядок 54: | Рядок 33: | ||
destination d_a10nat_json_main { | destination d_a10nat_json_main { | ||
file( | file( | ||
- | "/var/log/syslog-ng/ | + | "/nfs/ |
template(" | template(" | ||
create_dirs(yes) | create_dirs(yes) | ||
Рядок 63: | Рядок 42: | ||
destination d_a10nat_json_backup { | destination d_a10nat_json_backup { | ||
file( | file( | ||
- | "/ | + | "/ |
template(" | template(" | ||
create_dirs(yes) | create_dirs(yes) | ||
Рядок 81: | Рядок 60: | ||
filter(f_a10nat_cgnat); | filter(f_a10nat_cgnat); | ||
destination(d_a10nat_json_backup); | destination(d_a10nat_json_backup); | ||
- | when not exists("/ | + | when not exists("/ |
flags(flow-control); | flags(flow-control); | ||
}; | }; | ||
Рядок 87: | Рядок 66: | ||
systemctl restart syslog-ng | systemctl restart syslog-ng | ||
+ | | ||
+ | test message from remote linux host | ||
+ | # logger --server 172.16.0.37 --port 1515 --tcp --rfc3164 --tag NAT-TCP "This is a test message FROM nat" | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== A10 Thunder Configuration ==== | ||
+ | |||
+ | <code bash> | ||
+ | nat-0> | ||
+ | !Section configuration: | ||
+ | ! | ||
+ | cgnv6 server syslog1 172.16.0.37 | ||
+ | health-check-disable | ||
+ | port 1515 tcp | ||
+ | ! | ||
+ | |||
+ | cgnv6 service-group syslog tcp | ||
+ | member syslog1 1515 | ||
+ | ! | ||
+ | cgnv6 template logging lsn_logging | ||
+ | facility local7 | ||
+ | severity informational | ||
+ | batched-logging-disable | ||
+ | service-group syslog | ||
+ | source-address | ||
+ | ip 172.16.0.6 | ||
+ | disable-log-by-destination | ||
+ | icmp | ||
+ | ! | ||
+ | </ | ||
+ | |||
+ | ==== Скрипт міграції логів ==== | ||
+ | |||
+ | nano / | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | |||
+ | # Перевірка, | ||
+ | if mountpoint -q / | ||
+ | echo " | ||
+ | find / | ||
+ | find / | ||
+ | else | ||
+ | echo " | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | chmod +x / | ||
+ | crontab -e | ||
+ | |||
+ | <code bash> | ||
+ | */5 * * * * / | ||
+ | </ | ||
+ | |||