Results 1 to 2 of 2

Thread: pas d'envoie de mail

  1. #1
    Junior Member
    Join Date
    Sep 2015
    Posts
    3

    pas d'envoie de mail

    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.

  2. #2
    Junior Member
    Join Date
    Sep 2015
    Posts
    3
    hello,

    Après avoir modifier le fichier reactionner :

    define reactionner {
    reactionner_name reactionner-master
    address localhost
    port 7769
    spare 0

    ## Optionnal
    manage_sub_realms 1 ; Does it take jobs from schedulers of sub-Realms?
    min_workers 1 ; Starts with N processes (0 = 1 per CPU)
    max_workers 15 ; No more than N processes (0 = 1 per CPU)
    polling_interval 1 ; Get jobs from schedulers each 1 second
    timeout 3 ; Ping timeout
    data_timeout 120 ; Data send timeout
    max_check_attempts 3 ; If ping fails N or more, then the node is dead
    check_interval 60 ; Ping node every N seconds

    ## Modules
    modules

    # Reactionner tags are the tag that the reactionner will manage. Use None as tag name to manage
    # untaggued notification/event handlers
    #reactionner_tags None

    # Enable https or not
    use_ssl 0
    # enable certificate/hostname check, will avoid man in the middle attacks
    hard_ssl_name_check 0

    ## Advanced
    realm All
    }
    il faut modifier la valeur de "manage_sub_realms" a 1 si l'on a plusieurs Realms. et la les envoies de mails fonctionnent parfaitement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •