Strona 1 z 1

rsyslog nie zapisuje logów

: 17 grudnia 2012, 13:00
autor: Auro
Witam.
Jestem nowy na forum więc nie zaszkodzi się przywitać.

Używam komputera z Debianem 6 do zbierania logów z ruterów typu mikrotik. Próbowałem skonfigurować program rsyslogd tak, aby zapisywał logi z każdego rutera do osobnego pliku. Gdy w końcu mi się to udało, przestały mi się zapisywać logi do do katalogu /var/log/syslog i /var/log/messages.

Jakakolwiek zmiana w pliku /etc/rsyslog.conf powoduje, że logi z MikroTika pojawiają się potrójnie: w pliku /var/log/syslog, /var/log/messages i /var/log/syslog i /var/log/MikroTik/nazwa_rutera.log. Oto mój plik konfiguracyjny:

Kod: Zaznacz cały

#  /etc/rsyslog.conf    Configuration file for rsyslog.
#
#            For more information see
#            /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html


#################
#### MODULES ####
#################

$ModLoad imuxsock # provides support for local system logging
$ModLoad imklog   # provides kernel logging support (previously done by rklogd)
#$ModLoad immark  # provides --MARK-- message capability

# provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514

# provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514

###########################
#### Mikrotik          ####
###########################

### for Szczaniec remote logging
$AllowedSender UDP, 192.168.8.9, 192.168.9.110, 192.168.0.0/24
$AllowedSender TCP, 192.168.8.9, 192.168.9.110, 192.168.0.0/24
$UDPServerAddress 192.168.0.20
:fromhost-ip, isequal, "192.168.8.9" /var/log/MikroTik/Nowa_wies.log
:fromhost-ip, isequal, "192.168.9.110" /var/log/MikroTik/Polajewo.log
:fromhost-ip, isequal, "192.168.0.12" /var/log/MikroTik/serwer2.log
:fromhost-ip, isequal, "192.168.0.21" /var/log/MikroTik/lasek-staszica.log
:fromhost-ip, isequal, "192.168.0.22" /var/log/MikroTik/staszica_11-15.log
:fromhost-ip, isequal, "192.168.0.23" /var/log/MikroTik/staszica_16-20.log
:fromhost-ip, isequal, "192.168.0.24" /var/log/MikroTik/lasek5-do-lasek8.log
:fromhost-ip, isequal, "192.168.0.25" /var/log/MikroTik/lasek8e-most8.log
:fromhost-ip, isequal, "192.168.0.26" /var/log/MikroTik/lasek6.log
:fromhost-ip, isequal, "192.168.0.28" /var/log/MikroTik/lasek8e-omnitik.log
:fromhost-ip, isequal, "192.168.0.32" /var/log/MikroTik/lasek_8b.log
:fromhost-ip, isequal, "192.168.0.34" /var/log/MikroTik/lasek5_omnitik.log
:fromhost-ip, isequal, "192.168.0.35" /var/log/MikroTik/lasek7.log
:fromhost-ip, isequal, "192.168.0.36" /var/log/MikroTik/lasek1.log
:fromhost-ip, isequal, "192.168.0.37" /var/log/MikroTik/lasek2.log
:fromhost-ip, isequal, "192.168.0.38" /var/log/MikroTik/lasek3.log
:fromhost-ip, isequal, "192.168.0.39" /var/log/MikroTik/lasek4.log
:fromhost-ip, isequal, "192.168.0.42" /var/log/MikroTik/kopernika2.log
:fromhost-ip, isequal, "192.168.0.43" /var/log/MikroTik/m47.log
:fromhost-ip, isequal, "192.168.0.44" /var/log/MikroTik/kopernika4_omnitik1.log
:fromhost-ip, isequal, "192.168.0.47" /var/log/MikroTik/witkacego_b3.log
:fromhost-ip, isequal, "192.168.0.48" /var/log/MikroTik/stare_miasto.log
:fromhost-ip, isequal, "192.168.0.49" /var/log/MikroTik/witkacego_b.log
:fromhost-ip, isequal, "192.168.0.50" /var/log/MikroTik/biuro.log
:fromhost-ip, isequal, "192.168.0.54" /var/log/MikroTik/powstancow21.log
:fromhost-ip, isequal, "192.168.0.55" /var/log/MikroTik/powstancow15.log
:fromhost-ip, isequal, "192.168.0.56" /var/log/MikroTik/zamosc_omnitik.log
:fromhost-ip, isequal, "192.168.0.57" /var/log/MikroTik/witkacego_7.log
:fromhost-ip, isequal, "192.168.0.58" /var/log/MikroTik/mickiewicza_39.log
:fromhost-ip, isequal, "192.168.0.59" /var/log/MikroTik/kopernika1.log
:fromhost-ip, isequal, "192.168.0.60" /var/log/MikroTik/lasek5-13.log
:fromhost-ip, isequal, "192.168.0.65" /var/log/MikroTik/slowackiego9.log

###########################
#### GLOBAL DIRECTIVES ####
###########################

#
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

#
# Set the default permissions for all log files.
#
$FileOwner root
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022

#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf


###############
#### RULES ####
###############

#
# First some standard log files.  Log by facility.
#
auth,authpriv.*            /var/log/auth.log
*.*;auth,authpriv.none,local0         -/var/log/syslog
#cron.*                /var/log/cron.log
daemon.*            -/var/log/daemon.log
kern.*                -/var/log/kern.log
lpr.*                -/var/log/lpr.log
mail.*                -/var/log/mail.log
user.*                -/var/log/user.log

#
# Logging for the mail system.  Split it up so that
# it is easy to write scripts to parse these files.
#
mail.info            -/var/log/mail.info
mail.warn            -/var/log/mail.warn
mail.err            /var/log/mail.err

#
# Logging for INN news system.
#
news.crit            /var/log/news/news.crit
news.err            /var/log/news/news.err
news.notice            -/var/log/news/news.notice

#
# Some "catch-all" log files.
#
*.=debug;\
    auth,authpriv.none;\
    news.none;mail.none    -/var/log/debug
*.=info;*.=notice;*.=warn;\
    auth,authpriv.none;\
    cron,daemon.none;\
    mail        -/var/log/messages

#
# Emergencies are sent to everybody logged in.
#
*.emerg                *

#
# I like to have messages displayed on the console, but only on a virtual
# console I usually leave idle.
#
#daemon,mail.*;\
#    news.=crit;news.=err;news.=notice;\
#    *.=debug;*.=info;\
#    *.=notice;*.=warn    /dev/tty8

# The named pipe /dev/xconsole is for the `xconsole' utility.  To use it,
# you must invoke `xconsole' with the `-file' option:
# 
#    $ xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
#      busy site..
#
daemon.*;mail.*;\
    news.err;\
    *.=debug;*.=info;\
    *.=notice;*.=warn    |/dev/xconsole

Z góry dziękuję za pomoc i pozdrawiam.

: 22 grudnia 2012, 01:06
autor: fnmirk
&quot pisze:Jakakolwiek zmiana w pliku /etc/rsyslog.conf powoduje, że logi z MikroTika pojawiają się potrójnie:

Sprawdź, czy nie masz zainstalowanego jakiegoś programu do np. analizy logów itp., z którego nie korzystasz.

Trochę ręcznej roboty:

Kod: Zaznacz cały

dpkg -l > spis.txt
aby przejrzeć co jest niepotrzebnie zainstalowane.

: 23 grudnia 2012, 17:28
autor: Auro
To domyślna instalacja Debiana 6, nie instalowałem żadnych nowych pakietów poza serwerem WWW. Jedyne co robiłem to zmiany w /etc/rsyslog.conf

: 23 grudnia 2012, 19:04
autor: fnmirk

Kod: Zaznacz cały

apt-get install rsyslog-doc
&quot pisze:

Kod: Zaznacz cały

#            For more information see
#            /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html