I have been using nagios for notification for a few years.
I use the default /usr/bin/mail, but my IP to be blocked by Spamhaus
I would like to continue using /usr/bin/mail, I would like to try using my email provider for this.
I changed the resource.cgf file including the lines below
$USER3$=xxx@xxx.com.br
$USER4$=xxxxxx (password)
$USER5$=smtp.xxxx.com.br:587
still using default account nagios@localhost.localdomain
I don't have much knowledge of linux (use centos os) I wanted to change it as simple as possible.
could they help?
Help - how to use own email server?
Re: Help - how to use own email server?
Here's the manpage for mail:
https://linux.die.net/man/1/mail
Usually the hangup is with SMTP servers that have actual security features ...
There's a wide variety of CLI utilities you can use to interact in a secure fashion to send emails via a remote SMTP server:
* sendEmail (tutorial on integration with Nagios Core)
* sSMTP (Nagios Core tutorial)
* eMail
That list is far from exhaustive.
https://linux.die.net/man/1/mail
Usually the hangup is with SMTP servers that have actual security features ...
There's a wide variety of CLI utilities you can use to interact in a secure fashion to send emails via a remote SMTP server:
* sendEmail (tutorial on integration with Nagios Core)
* sSMTP (Nagios Core tutorial)
That list is far from exhaustive.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Help - how to use own email server?
sendmail configuration after installing sendmail package
$USER5$=email@gmail.com
$USER7$=smtp.gmail.com:587
$USER9$=email
$USER10$=password
---------------
is there any tutorial integrating mail and nagios? for a simple change like sendmail?
at this moment I changed the contact email @hotmail to @gmail
if you continue including on the blacklist I will test the integration with sendmail with nagios.
thank you so much!
$USER5$=email@gmail.com
$USER7$=smtp.gmail.com:587
$USER9$=email
$USER10$=password
---------------
is there any tutorial integrating mail and nagios? for a simple change like sendmail?
at this moment I changed the contact email @hotmail to @gmail
if you continue including on the blacklist I will test the integration with sendmail with nagios.
thank you so much!
Re: Help - how to use own email server?
What is the direct link from sendmail? the sendmail on the download site is customized.
I did the installations but shows SSL error using gmail.
the nagios code below is to be sent the email without ssl or tls authentication?
there is an error in the ssl.pm file on line 444
run run or lower test without problems
sendEmail -v -f $username -s $host -xu $username -xp $password -t $recipient -o tls=yes -u $subject -m $content
-------------------------------------------------------------------------
# 'notify-host-by-email' command definition
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$ \nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/local/bin/sendEmail -s $USER7$ -xu $USER9$ -xp $USER10$ -t $CONTACTEMAIL$ -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" -m "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n"
}
# 'notify-service-by-email' command definition
define command {
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $ HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/local/bin/sendEmail -s $USER7$ -xu $USER9$ -xp $USER10$ -t $CONTACTEMAIL$ -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" -m "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$"
I did the installations but shows SSL error using gmail.
the nagios code below is to be sent the email without ssl or tls authentication?
there is an error in the ssl.pm file on line 444
run run or lower test without problems
sendEmail -v -f $username -s $host -xu $username -xp $password -t $recipient -o tls=yes -u $subject -m $content
-------------------------------------------------------------------------
# 'notify-host-by-email' command definition
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$ \nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/local/bin/sendEmail -s $USER7$ -xu $USER9$ -xp $USER10$ -t $CONTACTEMAIL$ -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" -m "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n"
}
# 'notify-service-by-email' command definition
define command {
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $ HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/local/bin/sendEmail -s $USER7$ -xu $USER9$ -xp $USER10$ -t $CONTACTEMAIL$ -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" -m "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$"