meta data de esta página
  •  

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Próxima revisión
Revisión previa
seguridad:monitorizacion:zabbix2:correo [2015/03/06 12:18] – creado luiscaseguridad:monitorizacion:zabbix2:correo [2023/01/18 14:46] (actual) – editor externo 127.0.0.1
Línea 4: Línea 4:
 <code>yum install -y mailx</code> <code>yum install -y mailx</code>
  
-And that's it! We can now start sending e-mails using the "mail" (or mailx) command. +Creamos un enlace simbólico 
-What Are Symbolic Links and How To Create One+<code>ln -s /bin/mailx /bin/email</code>
  
-Symbolic links (symlink) are files which consist of a reference to another, existing file.+Editamos el fichero /etc/mail.rc 
  
-Some monitoring scripts and applications might use "email" instead "mail" or "mailx" to send e-mails. If you find yourself in this situation, you can create a symbolic link, pointing (referencing) to mailx.+<code>vi /etc/mail.rc</code>
  
-Below, we are creating a symbolic link for "mail" to execute "mailx".+Añadimos las siguientes líneas dependiendo de nuestra configuración al final del fichero. Para gmail sería : 
 +<file> 
 +set smtp-use-starttls 
 +set ssl-verify=ignore 
 +set smtp-auth=login 
 +set smtp=smtp://smtp.gmail.com:587 
 +set from="usuario@gmail.com" 
 +set smtp-auth-user=usuario@gmail.com 
 +set smtp-auth-password=micontraseña 
 +set ssl-verify=ignore 
 +set nss-config-dir=/etc/ssl/certs 
 +</file>
  
-In order to create symbolic link, run the following (replace /bin/email with the link name required):+<note>para enviar correos gmail necesitas descargar los certificados  
 +<code>certutil -N -d /etc/ssl/certs</code> 
 +<code>echo -n | openssl s_client -connect smtp.gmail.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/ssl/certs/gmail.crt</code> 
 +<code>certutil -A -n "Google Internet Authority" -t "C,," -d ~/.certs -i ~/.certs/gmail.crt</code></note>
  
-$ ln -s /bin/mailx /bin/email+Para comprobar que funciona  
 +<code>echo "Your message" | mailx -s "Message Subject" luisca@intrusos.info</code>
  
-How to Set an External SMTP Server to Relay E-Mails+=== Configurar Zabbix para enviar alertas === 
 +Para activar en zabbix la alertas por correo debemos de ir a Administration-> Media Types y modificamos el modelo que aparece como email con la configuración de nuestro servidor de correos 
 +{{:seguridad:monitorizacion:zabbix2:email1.png?600|}}
  
-Using this lean solutionas mentioned abovecan mean that some of your e-mails might hit the spam folder. As you are aiming for a simple application for alertsthis should not be an issue. However, if you want increased delivery rates (i.e. to your inbox) you can opt to relay your messages through external SMTP servers (i.eyour e-mail provider's or by commercial e-mail services).+Una vez habilitado el nuevo medio debemos ir al usuarioen nuestro caso el administradory en la configuración del mismo en la pestaña mediaañadir uno del tipo email que acabamos de crear 
 +{{:seguridad:monitorizacion:zabbix2:email2.png?600|}} 
 +{{:seguridad:monitorizacion:zabbix2:email3.png?600|}}
  
-In order to set up a SMTP server [configuration] for "mailx" to use, we need to edit the contents of /etc/mail.rc file where the application's [certain] settings are found. We are going to open up this file using the "nano" text editor and append our settings to the top. 
  
-Open up "mail.rc" using "nano": +En Configuration->Actions habilitar la acción de envío de problemas al administrador 
- +==== Enviar alertas un servidor de logs ==== 
-$ nano /etc/mail.rc +http://www.elmundoenbits.com/2013/02/zabbix-log-alerts.html
- +
-Below you can find an example SMTP settings, which you will need to modify to match your provider's before appending to the top of "mail.rc". Lines starting with # sign are commented out --meaning, they are not in effect-- and consist of the structure. The following line is the one you will need to replace accordingly to match your SMTP server details. +
- +
-Example: +
- +
-# set smtp=smtp://smtp.server.tld:port_number +
-set smtp=smtp://smtp.example.com:543 +
-# tell mailx that it needs to authorise +
-set smtp-auth=login +
-# set the user for SMTP +
-# set smtp-auth-user=user@domain.tld +
-set smtp-auth-user=user.name@example.com +
-# set the password for authorisation +
-set smtp-auth-password=enter-password-here-1234+
  
 +==== Enviar alertas por twitter ====
 +http://www.elmundoenbits.com/2012/01/alertas-zabbix-twitter.html
 +==== Referencias ====
 +  * https://coderwall.com/p/ez1x2w/send-mail-like-a-boss
 +  * http://www.programering.com/a/MTM4UDNwATM.html
 +  * http://adminsis.manuelgutierrezmolina.es/notificaciones-zabbix-en-vmware/