Good morning! I'm playing with Graylog today and everything is working well on Ubuntu, but the two CentOS 7.1 servers I've attempted to attach to it are acting strange. I've been keeping notes as I've gone along and have pasted them below. Thank you for taking the time to read through this!
When forwarding to rsyslog the logs are written to the remotes /var/log files
При пересылке в Graylog служба не будет отправлять журналы, но если rsyslog запускается sudo rsyslogd
вместо службы syslog, он будет работать
Вот результат ps aux | grep sysl
для каждого процесса:
Из службы:
[пользователь] $ ps aux | grep sysl
корень 12362 0,0 0,1 311228 2804? Ssl 10:19 0:00 / usr / sbin / rsyslogd -n
user + 12369 0,0 0,0 112640 928 точек / 0 S + 10:19 0:00 grep --color = auto sysl
From sudo rsyslogd
:
[пользователь] $ ps aux | grep sysl
корень 12320 0,0 0,1 313300 2336? Ssl 10:18 0:00 rsyslogd
user + 12354 0.0 0.0 112640 932 pts / 0 S + 10:18 0:00 grep --color = auto sysl
Приложение должно быть таким, как указано здесь:
[user] $ which rsyslogd
/ usr / sbin / rsyslogd
Единственная разница заключается в использовании флага -n
.
Содержимое служебного файла rsyslog systemd :
[Модуль]
Описание = Служба ведения системного журнала
; Требуется = syslog.socket
[Служба]
Тип = уведомление
EnvironmentFile = - / etc / sysconfig / rsyslog
ExecStart = / usr / sbin / rsyslogd -n $ SYSLOGD_OPTIONS
StandardOutput = null
[Install]
WantedBy=multi-user.target
;Alias=syslog.service
$SYSLOGD_OPTIONS is "" according to /etc/sysconfig/rsyslog
Running sudo /usr/sbin/rsyslogd -n
sends messages, but locks the terminal session (CTRL-C will not get out, have to close the tmux pane and reconnect, but rsyslogd will stay running)
Removing -n $SYSLOGD_OPTIONS
from the service will cause the service to not startup (it crashes, I did run sudo systemctl daemon-reload
)
Я разобрался. Я был глуп. SELinux не позволяет syslog отправлять журналы через нестандартный порт, что я и пытался сделать. Установка policycoreutils-python
и запуск sudo semanage port -a -t syslogd_port_t -p tcp 5514
исправил:)