Re: Logwatch ne me retourne pas toutes les infos ?

Salut,

J’utilise logwatch sur 2 serveurs CentOs :
L’un me renvoie les infos par mail
Le second ne me renvoie rien

Sur mon serveur Debian squeeze pas de retour par mail non plus

Je mets mon fichier /usr/share/default/logwatch.conf
(seulement les lignes non commentées)

LogDir = /var/log TmpDir = /var/cache/logwatch Output = mail Format = text Encode = none MailTo = <mon_mail>@free.fr MailFrom = logwatch Range = yesterday Detail = Low Service = All Service = "-zz-network" Service = "-zz-sys" Service = "-eximstats" mailer = "/usr/sbin/sendmail -t"

La version de logwach est la suivante : 7.3.6.cvs20090906-1squeeze1

Je ne trouve pas d’explication sur ce point en faisant une recherche.
Je ne comprends pas ce qui coince.

Merci

@sloteur : question toute bête, mais, est-ce que tu peux envoyer des mails (avec mail ou autre) ?

Un problème = un sujet; ca sera plus clair.

Tu as raison, j’ai divisé le sujet.

Il faut faire un test manuel par logwatch dans un terminal et voir ce que ça raconte dans /var/log/mail.log .

Bonsoir,

@ Archimedio

Oui tout fonctionne normalement.
@ sorodje

[quote]Il faut faire un test manuel par
Code:
logwatch
dans un terminal et voir ce que ça raconte dans /var/log/mail.log .[/quote]
Si je paramètre logwatch pour qu’il m’affiche les données dans la console il m’affiche le rapport comme ceci

[code]################### Logwatch 7.3.6 (05/19/07) ####################
Processing Initiated: Sat Sep 8 23:43:14 2012
Date Range Processed: yesterday
( 2012-Sep-07 )
Period is day.
Detail Level of Output: 0
Type of Output/Format: stdout / text
Logfiles for Host: cerbere
##################################################################

--------------------- iptables firewall Begin ------------------------

Listed by source hosts:
Rejected 34142 packets on interface eth0
From 0.0.0.0 - 7 packets to udp(67)
From 31.13.64.20 - 193 packets to tcp(33120,33147,33622,33707,33727,33899,33975,34046,34111,34759,35151,35604,35787,35939,36184,36232,36457,36464,36471,36506,36519,36596,36819,37009,37085,37259,37272,37507,37576,37905,37925,38092,38488,38551,38576,38960,39229,39585,39764,39775,39814,39845,39903,40095,40371,40573,40587,40607,40746,40931,41028,41070,41088,41220,41341,41499,41500,41614,41657,41712,41862,41904,42306,42364,42743,42745,42773,42808,42883,43197,43729,43769,43836,43965,44105,44396,44493,44557,44558,44811,44858,45166,45267,45297,45547,45790,46078,46230,46289,46811,46826,46983,47094,47100,47154,47167,47489,47835,47987,48099,48161,48168,48210,48455,48865,48966,49085,49198,49546,49734,49773,49850,49870,49995,50199,50239,50296,50377,50399,50416,50613,50807,50928,51154,51283,51330,51482,51586,51589,51700,51868,51883,51935,52053,52191,52291,52850,53042,53085,53109,53158,53207,53309,53326,53537,53847,53871,53906,54226,54285,54321,54349,54394,54418,54529,54638,54696,54763,54792,54862,55508,55512,55659,55928,56014,56108,56307,56654,56806,56829,57340,57466,57556,58357,58646,59141,59293,59358,59399,59510,59525,59689,59723,59847,59980,60227,60341,60354,60541,60729,60746)
From 74.125.230.64 - 6 packets to tcp(33425,38761)
From 74.125.230.65 - 10 packets to tcp(34178,34376,35073,39982)
From 74.125.230.66 - 2 packets to tcp(56549)
From 74.125.230.67 - 4 packets to tcp(40559,40650)
From 74.125.230.69 - 6 packets to tcp(55264,55317)
From 74.125.230.70 - 6 packets to tcp(38254,51352)
From 74.125.230.71 - 2 packets to tcp(40328)
From 74.125.230.72 - 1 packet to tcp(38836)
From 74.125.230.73 - 1 packet to tcp(52999)
From 74.125.230.74 - 3 packets to tcp(46152)
From 74.125.230.76 - 3 packets to tcp(53991)
From 74.125.230.79 - 10 packets to tcp(32963,60571,60603,60644)
From 74.125.230.193 - 3 packets to tcp(50974)
From 74.125.230.197 - 2 packets to tcp(46608)
From 74.125.230.198 - 3 packets to tcp(34312,56988)
From 74.125.230.200 - 3 packets to tcp(35823)
From 74.125.230.201 - 3 packets to tcp(57273)
From 74.125.230.204 - 2 packets to tcp(58715)
From 74.125.230.206 - 2 packets to tcp(45062)
From 74.125.230.207 - 4 packets to tcp(33515,42150)
From 74.125.230.224 - 1 packet to tcp(34453)
From 74.125.230.225 - 5 packets to tcp(57090,57193)
From 74.125.230.226 - 1 packet to tcp(54179)
From 74.125.230.229 - 1 packet to tcp(60850)
From 74.125.230.230 - 2 packets to tcp(55392)
From 74.125.230.231 - 3 packets to tcp(35555)
From 74.125.230.238 - 3 packets to tcp(52131)
From 74.125.230.239 - 1 packet to tcp(36413)
From 74.125.230.254 - 3 packets to tcp(41361,41440)
From 173.194.34.1 - 3 packets to tcp(53872)
From 173.194.34.2 - 3 packets to tcp(57642)
From 173.194.34.3 - 6 packets to tcp(36888,40883)
From 173.194.34.4 - 3 packets to tcp(38211)
From 173.194.34.5 - 9 packets to tcp(46419,46491,52921)
From 173.194.34.6 - 6 packets to tcp(48499,49281)
From 173.194.34.7 - 1 packet to tcp(41147)
From 173.194.34.8 - 10 packets to tcp(50418,50865,56757,57325,57667)
From 173.194.34.30 - 12 packets to tcp(52864,53004,53115,53120)
From 173.194.34.32 - 3 packets to tcp(52029)
From 173.194.34.33 - 1 packet to tcp(54250)
From 173.194.34.34 - 4 packets to tcp(34014,34172)
From 173.194.34.35 - 6 packets to tcp(53586,53934)
From 173.194.34.37 - 3 packets to tcp(43597)
From 173.194.34.38 - 2 packets to tcp(33669)
From 173.194.34.41 - 2 packets to tcp(51945)
From 173.194.34.46 - 6 packets to tcp(43155,43158)
From 173.194.34.47 - 3 packets to tcp(44648)
From 173.194.34.62 - 3 packets to tcp(47224)
From 173.194.67.94 - 2 packets to tcp(49587)
From 173.194.78.95 - 3 packets to tcp(34056)
From 173.194.78.103 - 3 packets to tcp(37722)
From 192.168.0.6 - 27 packets to udp(67,161,1124,3289,8612)
From 192.168.0.253 - 273 packets to udp(138)
From 192.168.0.254 - 3 packets to udp(68)
From 212.27.38.253 - 33449 packets to udp(32400)

---------------------- iptables firewall End -------------------------

--------------------- pam_unix Begin ------------------------

su:
Sessions Opened:
root -> nobody: 3 Time(s)
root -> root: 2 Time(s)

---------------------- pam_unix End -------------------------

--------------------- SSHD Begin ------------------------

Users logging in through sshd:
toto:
192.168.x.x: 2 times

Received disconnect:
11: disconnected by user : 2 Time(s)

---------------------- SSHD End -------------------------

--------------------- Disk Space Begin ------------------------

Filesystem Size Used Avail Use% Mounted on
/dev/md2 72G 7.2G 61G 11% /
/dev/md0 89M 11M 73M 13% /boot

---------------------- Disk Space End -------------------------

###################### Logwatch End #########################
[/code]

Contenu de /var/log/mail.log

Sep 3 06:27:36 cerbere exim4: ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken Sep 4 06:28:22 cerbere exim4: ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken Sep 5 06:27:39 cerbere exim4: ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken Sep 6 06:28:14 cerbere exim4: ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken Sep 7 06:28:21 cerbere exim4: ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken Sep 8 06:28:29 cerbere exim4: ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken

Du coup j’ai ouvert paniclog.
Voici les dernières lignes :

2012-08-07 19:16:16 socket bind() to port 25 for address ::1 failed: Cannot assign requested address: daemon abandoned 2012-08-07 19:21:41 socket bind() to port 25 for address ::1 failed: Cannot assign requested address: daemon abandoned 2012-08-07 19:59:31 socket bind() to port 25 for address ::1 failed: Cannot assign requested address: daemon abandoned 2012-08-07 20:43:24 socket bind() to port 25 for address ::1 failed: Cannot assign requested address: daemon abandoned 2012-08-10 01:06:39 socket bind() to port 25 for address ::1 failed: Cannot assign requested address: daemon abandoned 2012-09-01 11:36:16 socket bind() to port 25 for address ::1 failed: Cannot assign requested address: daemon abandoned

Une idée ?

Donc à priori ton problème est plutôt du côté d’Exim4 que de Logwatch … je ne connais pas du tout Exim :slightly_smiling:

Bon, moi non plus je ne connais pas exim.
J’ai tout de même tenté cette astuce :
Avec Debian Squeeza l’ipv6 est intégré au noyau. Vous ne pouvez plus désactiver le service ipv6 avec les anciennes commandes. Nouvelle procédure ci-dessous :
Editer avec vim

# vim /etc/sysctl.conf

Descendez au bas du fichier et insérer les lignes suivantes :

Disable IPv6

net.ipv6.conf.all.disable_ipv6=1
Pour que exim4 ne renvoie plus d’erreur :

# vim /etc/exim4/update-exim4.conf.conf

Editer la ligne dc_local_interfaces de cette manière :
dc_local_interfaces=‘127.0.0.1’
Si vous redémarez le serveur sans changer la config d’Exim, le fichier paniclog se remplira et vous aurez l’erreur suivante à chaque démarrage ou en redémarrant exim

ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken failed!

Pour régler ceci simplement, effacez le fichier paniclog avec la commande suivante :

# rm /var/log/exim4/paniclog

Relancez en utilisan ifdown et ifup ou en rebootant le serveur.

Sauf que je n’ai plus d’erreur avec exim mais je ne reçoit toujour rien de logwatch :041

J’ai tenté aussi ceci dans le fichier /etc/cron.daily/00logwatch

[code]#!/bin/bash

#Check if removed-but-not-purged
test -x /usr/share/logwatch/scripts/logwatch.pl || exit 0

#execute
#/usr/sbin/logwatch --output mail
#/usr/sbin/logwatch --output <mon_id@free.fr
/usr/sbin/logwatch --mailto <mon_id@free.fr

#Note: It’s possible to force the recipient in above command
#Just pass --mailto address@a.com instead of --output mail[/code]
J’ai essayé les trois lignes qui sont sous #execute chacune à leur tour sans résultat… :017

Tu peux essayer de reconfigurer Exim

Dans /usr/share/logwatch/default.conf/logwatch.conf :
MailTo =

On peux mettre aussi bien root que cuillère@café.com si root est redirigé vers une adresse dans /etc/aliases

Autrement pour tester les mails :

[code]

mail -s ‘Sujet, mail adresse’

texte du mail.
.

mail -s ‘Sujet, mail root’ root

texte du mail.
.
#[/code]

Je crois que j’ai trouvé, grace à vos pistes :038 :038

[quote]Autrement pour tester les mails :
Code:

mail -s ‘Sujet, mail adresse’

texte du mail.
.

mail -s ‘Sujet, mail root’ root

texte du mail.
.
#[/quote]
J’ai testé et en effet cela ne marchait pas.
Je suis allé voir dans /var/spool/mail/mail et j’y ai retrouvé tous les rapports de logwach ainsi qui l’indication que le courrier n’avait pu être délivré à mon adresse.

Esuite j’ai fait :

[quote]Tu peux essayer de reconfigurer Exim
Code:
dpkg-reconfigure exim4-config[/quote]

J’ai un peu pinaillé avec les paramètres mais il semble que ce soit le premier qui empêchait la sortie du courrier :
Il fallait remplacer :

  • Envoir via relais (“Smarthost”) - pas de courrier local
    par
  • Distribution directe par SMTP (Site internet)

En tapant

# logwatch

j’ai mon rapport qui arrive dans ma boite mail

Quand on fait dpkg-reconfigure exim4-config le fichier qui contient toute la config est : /etc/exim4/update-exim4.conf.conf
Voici le contenu du mien après mes modifications :

[code]# /etc/exim4/update-exim4.conf.conf

Edit this file and /etc/mailname by hand and execute update-exim4.conf

yourself or use ‘dpkg-reconfigure exim4-config’

Please note that this is not a dpkg-conffile and that automatic changes

to this file might happen. The code handling this will honor your local

changes, so this is usually fine, but will break local schemes that mess

around with multiple versions of the file.

update-exim4.conf uses this file to determine variable values to generate

exim configuration macros for the configuration file.

Most settings found in here do have corresponding questions in the

Debconf configuration, but not all of them.

This is a Debian specific file

dc_eximconfig_configtype=‘internet’
dc_other_hostnames=’’
dc_local_interfaces=‘127.0.0.1’
dc_readhost=‘myname@monserveur’
dc_relay_domains=‘monserveur.chezmoi’
dc_minimaldns=‘false’
dc_relay_nets=’’
dc_smarthost=‘smtp.xxxxx.fr:25
CFILEMODE=‘644’
dc_use_split_config=‘false’
dc_hide_mailname=‘true’
dc_mailname_in_oh=‘true’
dc_localdelivery=‘mail_spool’
[/code]

Voilà. Je ne mets pas encore en résolu, car j’attends de voir si cron.daily va faire son travail.
Si c’est le cas je repasse demain pour faire ma petite coche verte. :laughing:

Merci à tous pour m’avoir aidé à régler ce problème que je trainait depuis un bon moment.

Tout marche impeccable !! :030
Merci encore de vos conseils.
Cette communauté est vraiment efficace.