Bonjour,
Shinken lance le script de notification Mail a la suite de la perte d'un host. mais rien n'arrive dans le postfix local donc rien n'est envoyé.
Merci de votre aide !
vi commands/notify-host-by-email.cfg
Code:
## Notify Host by Email
define command {
command_name notify-host-by-email
command_line $PLUGINSDIR$/notify_by_email.py -n host -S localhost -r $CONTACTEMAIL$ -f html -c "$NOTIFICATIONTYPE$,,$HOSTNAME$,,$HOSTADDRESS$,,$LONGDATETIME$" -o "$HOSTALIAS$,,$HOSTSTATE$,,$HOSTDURATION$"
}
vi contacts/admin.cfg
Code:
# This is a default admin
# CHANGE ITS PASSWORD!
define contact{
use generic-contact
contact_name admin
# email shinken@localhost
email toto@x.com
pager 0600000000 ; contact phone number
password skyW4lker!
is_admin 1
RealmLAN 1
}
vi hosts/coin.cfg
Code:
define host {
use default,linux-ssh
host_name coin
address 192.168.0.10
contact_groups admins
realm RealmLAN
}
L'alerte dans les logs :
Code:
==> /var/log/shinken/schedulerd.log <==
[1450883217] HOST ALERT: coin;DOWN;HARD;1;(Host Check Timed Out)
[1450883217] HOST NOTIFICATION: admin;coin;DOWN;notify-host-by-email;(Host Check Timed Out)
rien dans /var/log/maillog
quand je test le script en direct ca fonctionne :
Code:
[shinken@toto libexec]$ ./notify_by_email.py -n host -S localhost -r toto@x.com -f html -c "$NOTIFICATIONTYPE$,,$HOSTNAME$,,$HOSTADDRESS$,,$LONGDATETIME$" -o "$SERVICEDESC$,,$SERVICESTATE$,,$SERVICEOUTPUT$,,$SERVICEDURATION$"
Le log de postfix :
Code:
Dec 23 16:12:55 toto postfix/smtpd[3676]: connect from localhost[::1]
Dec 23 16:12:55 toto postfix/smtpd[3676]: 9485BC13FB: client=localhost[::1]
Dec 23 16:12:55 toto postfix/cleanup[3679]: 9485BC13FB: message-id=<20151223151255.9485BC13FB@x.com>
Dec 23 16:12:55 toto postfix/qmgr[1617]: 9485BC13FB: from=<shinken@x.com>, size=1955, nrcpt=1 (queue active)
Dec 23 16:12:55 toto postfix/smtpd[3676]: disconnect from localhost[::1]
Dec 23 16:12:55 toto postfix/smtp[3684]: 9485BC13FB: to=<toto@x.com>, relay=1.1.1.1[1.1.1.1]:25, delay=0.05, delays=0.02/0/0/0.03, dsn=2.0.0, status=sent (250 Message accepted for delivery)
Dec 23 16:12:55 toto postfix/qmgr[1617]: 9485BC13FB: removed
reception du mail correctement.