Настройка Logwatch помогите.

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС.

Модераторы: SLEDopit, Модераторы разделов

Arthes
Сообщения: 282
ОС: OS X Yosemite and CentOS

Настройка Logwatch помогите.

Сообщение Arthes »

Надо настроить Logwatch. Установил из реп Fedora 9.
В итоге в каталоге /etc/logwatch пустая конфигурация...
Зато есть все в /usr/share/logwatch

Скопировал содержимое каталога default.conf и отредактировал некоторые параметры.
Сначала чтобы на экран слалось, потом на почту.... В итоге запускаю скрипт ./etc/crond.daily/10logrorarte
Он выполняется без всякого вывода на экран!
Ну и в случае с отправкой на внешнюю тоже результат НУЛЬ :angry:

вот конфиг

Код: Выделить всё

########################################################
# This was written and is maintained by:
#    Kirk Bauer <kirk@kaybee.org>
#
# Please send all comments, suggestions, bug reports,
#    etc, to kirk@kaybee.org.
#
########################################################

# NOTE:
#   All these options are the defaults if you run logwatch with no
#   command-line arguments.  You can override all of these on the
#   command-line.

# You can put comments anywhere you want to.  They are effective for the
# rest of the line.

# this is in the format of <name> = <value>.  Whitespace at the beginning
# and end of the lines is removed.  Whitespace before and after the = sign
# is removed.  Everything is case *insensitive*.

# Yes = True  = On  = 1
# No  = False = Off = 0

# Default Log Directory
# All log-files are assumed to be given relative to this directory.
LogDir = /var/log

# You can override the default temp directory (/tmp) here
TmpDir = /var/cache/logwatch

# Default person to mail reports to.  Can be a local account or a
# complete email address.  Variable Print should be set to No to
# enable mail feature.
MailTo = xxx@yyy.ru
# WHen using option --multiemail, it is possible to specify a different
# email recipient per host processed.  For example, to send the report
# for hostname host1 to user@example.com, use:
#Mailto_host1 = user@example.com
# Multiple recipients can be specified by separating them with a space.

# Default person to mail reports from.  Can be a local account or a
# complete email address.
MailFrom = root

# If set to 'Yes', the report will be sent to stdout instead of being
# mailed to above person.
Print = No

# if set, the results will be saved in <filename> instead of mailed
# or displayed.
#Save = /tmp/logwatch

# Use archives?  If set to 'Yes', the archives of logfiles
# (i.e. /var/log/messages.1 or /var/log/messages.1.gz) will
# be searched in addition to the /var/log/messages file.
# This usually will not do much if your range is set to just
# 'Yesterday' or 'Today'... it is probably best used with
# By default this is now set to Yes. To turn off Archives uncomment this.
#Archives = No
# Range = All

# The default time range for the report...
# The current choices are All, Today, Yesterday
Range = yesterday

# The default detail level for the report.
# This can either be Low, Med, High or a number.
# Low = 0
# Med = 5
# High = 10
Detail = High


# The 'Service' option expects either the name of a filter
# (in /usr/share/logwatch/scripts/services/*) or 'All'.
# The default service(s) to report on.  This should be left as All for
# most people.
Service = All
# You can also disable certain services (when specifying all)
Service = "-zz-network"     # Prevents execution of zz-network service, which
                            # prints useful network configuration info.
Service = "-zz-sys"         # Prevents execution of zz-sys service, which
                            # prints useful system configuration info.
Service = "-eximstats"      # Prevents execution of eximstats service, which
                            # is a wrapper for the eximstats program.
# If you only cared about FTP messages, you could use these 2 lines
# instead of the above:
#Service = ftpd-messages   # Processes ftpd messages in /var/log/messages
#Service = ftpd-xferlog    # Processes ftpd messages in /var/log/xferlog
# Maybe you only wanted reports on PAM messages, then you would use:
#Service = pam_pwdb        # PAM_pwdb messages - usually quite a bit
#Service = pam             # General PAM messages... usually not many

# You can also choose to use the 'LogFile' option.  This will cause
# logwatch to only analyze that one logfile.. for example:
#LogFile = messages
# will process /var/log/messages.  This will run all the filters that
# process that logfile.  This option is probably not too useful to
# most people.  Setting 'Service' to 'All' above analyizes all LogFiles
# anyways...

#
# By default we assume that all Unix systems have sendmail or a sendmail-like system.
# The mailer code Prints a header with To: From: and Subject:.
# At this point you can change the mailer to any thing else that can handle that output
# stream. TODO test variables in the mailer string to see if the To/From/Subject can be set
# From here with out breaking anything. This would allow mail/mailx/nail etc..... -mgt
mailer = /bin/mail

#
# With this option set to 'Yes', only log entries for this particular host
# (as returned by 'hostname' command) will be processed.  The hostname
# can also be overridden on the commandline (with --hostname option).  This
# can allow a log host to process only its own logs, or Logwatch can be
# run once per host included in the logfiles.
#
# The default is to report on all log entries, regardless of its source host.
# Note that some logfiles do not include host information and will not be
# influenced by this setting.
#
#HostLimit = Yes

# vi: shiftwidth=3 tabstop=3 et
Спасибо сказали:
Аватара пользователя
danger08
Сообщения: 715
ОС: Linux (CentOS, Ubuntu)

Re: Настройка Logwatch помогите.

Сообщение danger08 »

Arthes писал(а):
14.05.2009 12:09
Надо настроить Logwatch. Установил из реп Fedora 9.

Честно говоря, не верится, что он не поставился еще при установке ОС.
Блогосайт - http://www.fateyev.com
Спасибо сказали:
Arthes
Сообщения: 282
ОС: OS X Yosemite and CentOS

Re: Настройка Logwatch помогите.

Сообщение Arthes »

danger08 писал(а):
14.05.2009 13:08
Arthes писал(а):
14.05.2009 12:09
Надо настроить Logwatch. Установил из реп Fedora 9.

Честно говоря, не верится, что он не поставился еще при установке ОС.


Верится/ не вериться, но что не так сконфигурировано что письма не идут ни на почту ни на терминал?!
Спасибо сказали:
Аватара пользователя
danger08
Сообщения: 715
ОС: Linux (CentOS, Ubuntu)

Re: Настройка Logwatch помогите.

Сообщение danger08 »

Надо настроить Logwatch. Установил из реп Fedora 9.

У вас F9? Ну так там ничего не надо конфигурировать (если сами не сломали, при экспериментах - то в чистой свежеустановленной системе все logwatch складируется в ящик к root-у). Навскидку, проверьте запущен ли sendmail.

Насчет logrotate - он выдает сообщения только в том случае, если произошла ошибка ("exited abnormally" etc.)
Блогосайт - http://www.fateyev.com
Спасибо сказали:
Arthes
Сообщения: 282
ОС: OS X Yosemite and CentOS

Re: Настройка Logwatch помогите.

Сообщение Arthes »

danger08 писал(а):
14.05.2009 14:12
Надо настроить Logwatch. Установил из реп Fedora 9.

У вас F9? Ну так там ничего не надо конфигурировать (если сами не сломали, при экспериментах - то в чистой свежеустановленной системе все logwatch складируется в ящик к root-у). Навскидку, проверьте запущен ли sendmail.

Насчет logrotate - он выдает сообщения только в том случае, если произошла ошибка ("exited abnormally" etc.)

Пасибо действительно надо было включить sendmail.

Хмм root приходят письма... на /var/spool/mail а вот во внешку никак, хотя адрес написан!
Спасибо сказали:
Аватара пользователя
danger08
Сообщения: 715
ОС: Linux (CentOS, Ubuntu)

Re: Настройка Logwatch помогите.

Сообщение danger08 »

Arthes писал(а):
14.05.2009 14:41
Хмм root приходят письма... на /var/spool/mail а вот во внешку никак, хотя адрес написан!

В вашем случае, можно просто пересылать root-овскую почту на внешний адрес (не трогая конфиги logrotate / syslogd .. etc)
Просто добавьте в /etc/aliases строчку

Код: Выделить всё

# Person who should get root mail
root: somebody@external.ru

И перезапустите sendmail.
Убедитесь также, что DNS у вас нормально работает (с машины виден external.ru и можно получить mx-записи для этого домена).
Блогосайт - http://www.fateyev.com
Спасибо сказали:
Arthes
Сообщения: 282
ОС: OS X Yosemite and CentOS

Re: Настройка Logwatch помогите.

Сообщение Arthes »

Спасибо логи стали отправляться на почту....

Но есть проблемы.

1) У меня Cron синхронизирует время каждую минуту ( на вирт машине где живут Linux постоянно время отстает )
так вот он мою почту начинает закидывать сотнями, тысячами отчетов по cron!

Пробовал отключить с пом настройки файла logwatch.conf как

Service = "-crond"
Service = "-cron"
собственно не помогло ни то ни другое.

Из каталога Service переименовать отчетсность cron --- не помогло.

2) Сам отчет почему то за конкретное минимальное время приходит... И все....

3) Как настроить чтобы по умному выводились логи апача на почту?
Спасибо сказали:
Аватара пользователя
danger08
Сообщения: 715
ОС: Linux (CentOS, Ubuntu)

Re: Настройка Logwatch помогите.

Сообщение danger08 »

Arthes писал(а):
15.05.2009 11:12
1) У меня Cron синхронизирует время каждую минуту ( на вирт машине где живут Linux постоянно время отстает )
так вот он мою почту начинает закидывать сотнями, тысячами отчетов по cron!

ну, пускать команду синхронизации вот так (наподобие):

Код: Выделить всё

/path/to/your/command param1 param2 > /dev/null 2>&1


Arthes писал(а):
15.05.2009 11:12
2) Сам отчет почему то за конкретное минимальное время приходит... И все....
Не понял сути вопроса..

Arthes писал(а):
15.05.2009 11:12
3) Как настроить чтобы по умному выводились логи апача на почту?
Смотря, что это означает для вас: по умному. Некоторых вообще не устраивает logwatch апача, и ее отключают (взамен используют awstats, webalizer, левые скрипты etc.)
Блогосайт - http://www.fateyev.com
Спасибо сказали: