2017年2月17日金曜日

CenOS7 rsyslogdサーバ設定

# vi /etc/rsyslog.conf
下記のコメントを解除
# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514

# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514

※送信元を制限する場合は、下記を追記
$AllowedSender UDP, 127.0.0.1,192.168.25.0/24,*.xx.co.jp

$AllowedSender TCP, 127.0.0.1, 192.168.25.0/24 *.xx.co.jp

※ログを分ける場合。
:fromhost-ip, isequal, "192.168.25.1"  var/log/network/catalyst_192.168.25.1.log

# firewall-cmd --zone=public --add-port=514/udp --permanent

※CentOS7クライアントの設定
#$ActionQueueFileName fwdRule1 # unique name prefix for spool files
#$ActionQueueMaxDiskSpace 1g   # 1gb space limit (use as much as possible)
#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
#$ActionQueueType LinkedList   # run asynchronously
#$ActionResumeRetryCount -1    # infinite retries if host is down
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
#*.* @@remote-host:514
192.168.25.220:514

0 件のコメント:

コメントを投稿

シャットダウン時の後処理 (shutdown)

# vi /etc/systemd/system/drop.service [Unit] Description= stop httpgwd DefaultDependencies=no Before=shutdown.target RefuseManualStart=true ...