Supervision
Résolu
dolidole
Messages postés
13
Date d'inscription
Statut
Membre
Dernière intervention
-
jjjjjjjj -
jjjjjjjj -
Bonjour,
Je suis un stagiaire,mon sujet c'est la réalisation et la mise en place d'une solution de supervision " eyes of network".
Mon souci, c'est que je n'arrive pas à configurer mon postfix. Je suis perdu entre les lignes de commandes, afin d'avoir des notifications provenant de eyes of network à mon adresse Gmail.
S 'il y a une personne qui peut m'aider, je serais très reconnaissant.
Merci d'avance
Je suis un stagiaire,mon sujet c'est la réalisation et la mise en place d'une solution de supervision " eyes of network".
Mon souci, c'est que je n'arrive pas à configurer mon postfix. Je suis perdu entre les lignes de commandes, afin d'avoir des notifications provenant de eyes of network à mon adresse Gmail.
S 'il y a une personne qui peut m'aider, je serais très reconnaissant.
Merci d'avance
4 réponses
Donc la solution est :
1. Configure Postfix main configuration
a.vi /etc/postfix/main.cf
b. Add these lines:
smtp_sasl_security_options = noanonymous
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
c. Save and exit
2. Create /etc/postfix/sasl/passwd
a. Create a directory sasl under /etc/postfix and create a file passwd with contents below:
[smtp.gmail.com]:587 username@gmail.com:password
Save and exit
b. Change permission
#chmod 600 /etc/postfix/sasl/passwd
c. Create lookup table via postmap
#postmap /etc/postfix/sasl/passwd
Issuing that command will create passwd.db
3. Generate your own CA certificate
a. Change directory to /etc/pki/tls/certs
#cd /etc/pki/tls/certs
b.Create a key and test certificate in one file
#make hostname.pem
You will something like
[root@FLT certs]# make hostname.pem
umask 77 ; \
PEM1='/bin/mktemp /tmp/openssl.XXXXXX' ; \
PEM2='/bin/mktemp /tmp/openssl.XXXXXX' ; \
/usr/bin/openssl req -utf8 -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 -set_serial 0 ; \
cat $PEM1 > hostname.pem ; \
echo "" >> hostname.pem ; \
cat $PEM2 >> hostname.pem ; \
rm -f $PEM1 $PEM2
Generating a 1024 bit RSA private key
............................++++++
.....++++++
writing new private key to `/tmp/openssl.z12084?
---
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter `.', the field will be left blank.
---
Country Name (2 letter code) [GB]:
State or Province Name (full name) [Berkshire]:
Locality Name (eg, city) [Newbury]:
Organization Name (eg, company) [My Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:
Email Address []:
c. Fill-up the necessary information and copy the file on /etc/postfix as cacert.pem
#cp /etc/pki/tls/certs/hostname.pem /etc/postfix/cacert.pem
4. Restart the postfix service
#service postfix restart
NB : "POUR le test mettez :"
echo "Test mail from postfix" | mail -s "Test Postfix" you@example.com
1. Configure Postfix main configuration
a.vi /etc/postfix/main.cf
b. Add these lines:
smtp_sasl_security_options = noanonymous
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
c. Save and exit
2. Create /etc/postfix/sasl/passwd
a. Create a directory sasl under /etc/postfix and create a file passwd with contents below:
[smtp.gmail.com]:587 username@gmail.com:password
Save and exit
b. Change permission
#chmod 600 /etc/postfix/sasl/passwd
c. Create lookup table via postmap
#postmap /etc/postfix/sasl/passwd
Issuing that command will create passwd.db
3. Generate your own CA certificate
a. Change directory to /etc/pki/tls/certs
#cd /etc/pki/tls/certs
b.Create a key and test certificate in one file
#make hostname.pem
You will something like
[root@FLT certs]# make hostname.pem
umask 77 ; \
PEM1='/bin/mktemp /tmp/openssl.XXXXXX' ; \
PEM2='/bin/mktemp /tmp/openssl.XXXXXX' ; \
/usr/bin/openssl req -utf8 -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 -set_serial 0 ; \
cat $PEM1 > hostname.pem ; \
echo "" >> hostname.pem ; \
cat $PEM2 >> hostname.pem ; \
rm -f $PEM1 $PEM2
Generating a 1024 bit RSA private key
............................++++++
.....++++++
writing new private key to `/tmp/openssl.z12084?
---
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter `.', the field will be left blank.
---
Country Name (2 letter code) [GB]:
State or Province Name (full name) [Berkshire]:
Locality Name (eg, city) [Newbury]:
Organization Name (eg, company) [My Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:
Email Address []:
c. Fill-up the necessary information and copy the file on /etc/postfix as cacert.pem
#cp /etc/pki/tls/certs/hostname.pem /etc/postfix/cacert.pem
4. Restart the postfix service
#service postfix restart
NB : "POUR le test mettez :"
echo "Test mail from postfix" | mail -s "Test Postfix" you@example.com
mamiemando
Messages postés
33777
Date d'inscription
Statut
Modérateur
Dernière intervention
7 884
Merci :-)
Le mieux ce serait que tu suives un tutoriel et que tu nous dises où tu bloques :
https://rtcamp.com/tutorials/linux/ubuntu-postfix-gmail-smtp/
Note : si à la première instruction ton shell te dit "bash: aptitude: commant not found" lance au préalable :
Bonne chance
https://rtcamp.com/tutorials/linux/ubuntu-postfix-gmail-smtp/
Note : si à la première instruction ton shell te dit "bash: aptitude: commant not found" lance au préalable :
sudo apt-get update sudo apt-get upgrade sudo apt-get install aptitude
Bonne chance
Merci "mamiemando" ca marche bien j'arrive a recevoir des mails de mon postfix ! maintenant j'essayerais de programmer nagios pour avoir les notifs ! et si tu sais comment faire pour avoir des notifications par SMS ?
Pas la moindre idée, je n'ai jamais configuré ni utilisé postfix.
Je te propose de regarder un peu ce que tu trouves sur google. Si tu bloques, ouvre un nouveau fil de discussion puisque le problème initial semble résolu.
Bonne chance
EDIT : la suite ici : https://forums.commentcamarche.net/forum/affich-28107220-supervision-notification-sms#p28107220
Je te propose de regarder un peu ce que tu trouves sur google. Si tu bloques, ouvre un nouveau fil de discussion puisque le problème initial semble résolu.
Bonne chance
EDIT : la suite ici : https://forums.commentcamarche.net/forum/affich-28107220-supervision-notification-sms#p28107220