SMTP connect() failed on new setup
Re: SMTP connect() failed on new setup
ok thank you for the feedback, I will follow the guide and advise how it went.
Thank you
Thank you
Re: SMTP connect() failed on new setup
Ok I can confirm that my test emails are now being sent and received, thank you very much for the help!
I have detected that no notifications are being sent to my contacts, I have tested with sending custom notifications, and nothing is being received, so the email address is correct in the contact section and email settings are correct.
Please advise what I can do to check why the notifications are not being sent to my contacts when there are any issues on any hosts/services?
I will attach the profile, please advise what else you need from me
I have detected that no notifications are being sent to my contacts, I have tested with sending custom notifications, and nothing is being received, so the email address is correct in the contact section and email settings are correct.
Please advise what I can do to check why the notifications are not being sent to my contacts when there are any issues on any hosts/services?
I will attach the profile, please advise what else you need from me
You do not have the required permissions to view the files attached to this post.
Re: SMTP connect() failed on new setup
Ok I managed to get the notifications working, now the only problem I have is the "from" address is not correct,
currently it is showing [email protected] as the from address, I have attached it also.
It needs to be changed to [email protected].
I have tried numerous suggestions on the forum and none of them work:
I will post our current Host and Services email commands:
Host:
/usr/bin/printf "%b" "***** Nagios Host Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nPerformance Host Data: $HOSTPERFDATA$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ -r [email protected]
Services:
/usr/bin/printf "%b" "***** Nagios Service Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info: $SERVICEOUTPUT$\n\nPerformance Service Data: $SERVICEPERFDATA$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ -r [email protected]
if you can please advise what I need to change to have it send from the [email protected] and not the above email as we have stated in the email smtp setting the correct email address and it is still not working.
currently it is showing [email protected] as the from address, I have attached it also.
It needs to be changed to [email protected].
I have tried numerous suggestions on the forum and none of them work:
I will post our current Host and Services email commands:
Host:
/usr/bin/printf "%b" "***** Nagios Host Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nPerformance Host Data: $HOSTPERFDATA$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ -r [email protected]
Services:
/usr/bin/printf "%b" "***** Nagios Service Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info: $SERVICEOUTPUT$\n\nPerformance Service Data: $SERVICEPERFDATA$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ -r [email protected]
if you can please advise what I need to change to have it send from the [email protected] and not the above email as we have stated in the email smtp setting the correct email address and it is still not working.
You do not have the required permissions to view the files attached to this post.
Re: SMTP connect() failed on new setup
You can change the commands to:
Hosts:
Services:
Then apply configuration and let me know if that resolves it.
If it doesn't, we may need to adjust your /etc/postfix/main.cnf to add your mail server as a relay.
Hosts:
Code: Select all
/usr/bin/printf "%b" "***** Nagios Host Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nPerformance Host Data: $HOSTPERFDATA$" | /bin/mail -r 'Nagios XI <[email protected]>' -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$Code: Select all
/usr/bin/printf "%b" "***** Nagios Service Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info: $SERVICEOUTPUT$\n\nPerformance Service Data: $SERVICEPERFDATA$" | /bin/mail -r 'Nagios XI <[email protected]>' -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$If it doesn't, we may need to adjust your /etc/postfix/main.cnf to add your mail server as a relay.
Re: SMTP connect() failed on new setup
Thank you for your steps provided, we have made the changes provided and now no notifications are being received, it does not look like it is sending anything at the moment.
Host
/usr/bin/printf "%b" "***** Nagios Host Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nPerformance Host Data: $HOSTPERFDATA$" | /bin/mail -r 'Nagios XI <[email protected]>' -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
Services
/usr/bin/printf "%b" "***** Nagios Service Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info: $SERVICEOUTPUT$\n\nPerformance Service Data: $SERVICEPERFDATA$" | /bin/mail -r 'Nagios XI <[email protected]>' -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
Host
/usr/bin/printf "%b" "***** Nagios Host Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nPerformance Host Data: $HOSTPERFDATA$" | /bin/mail -r 'Nagios XI <[email protected]>' -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
Services
/usr/bin/printf "%b" "***** Nagios Service Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info: $SERVICEOUTPUT$\n\nPerformance Service Data: $SERVICEPERFDATA$" | /bin/mail -r 'Nagios XI <[email protected]>' -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
Re: SMTP connect() failed on new setup
Try this:
Host:
Services:
If those don't work just remove the -r '[email protected]' from both commands, Apply Configuration, and let me know if they start working.
I know some systems that use sendmail mail command links to a different binary that uses -f or the from:
Host:
Code: Select all
/usr/bin/printf "%b" "***** Nagios Host Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nPerformance Host Data: $HOSTPERFDATA$" | /bin/mail -r '[email protected]' -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
Code: Select all
/usr/bin/printf "%b" "***** Nagios Service Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info: $SERVICEOUTPUT$\n\nPerformance Service Data: $SERVICEPERFDATA$" | /bin/mail -r '[email protected]' -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$I know some systems that use sendmail mail command links to a different binary that uses -f or the from:
Code: Select all
-f "[email protected]"Re: SMTP connect() failed on new setup
I have tried these and also when that line is in it does not send any notifications.
The moment I remove it and do a custom notification it sends it but is coming from the wrong email.
Can this be the admin email? if so how can we change it, or do you have any other methods we can try and force it to use the correct "from" email
The moment I remove it and do a custom notification it sends it but is coming from the wrong email.
Can this be the admin email? if so how can we change it, or do you have any other methods we can try and force it to use the correct "from" email
Re: SMTP connect() failed on new setup
I think we are getting closer to getting this resolved, as please see attached the email received from Nagios, so it is sending to the wrong recipients and also it is coming from the wrong address.
point 1: should send only to [email protected] (there is these two -- after the email that should be removed, don't know where to edit that), if you can please help
point 2: it is sending to nagios@kironinteractive(this is what the from address should be, and should not be sending to it)
point 3: it is sending to it to the from address which it also should not do.
point 4: I changed the admin_email in the config file to nagios@kironinteractive, and added the admin commands to hosts and services and no luck still(as below)
I will past below all the command lines that we have it at the moment.
Host by email:
/usr/bin/printf "%b" "***** Nagios Host Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nPerformance Host Data: $HOSTPERFDATA$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$-- -r $ADMINEMAIL$
Service by email:
/usr/bin/printf "%b" "***** Nagios Host Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nPerformance Host Data: $HOSTPERFDATA$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$-- -r $ADMINEMAIL$
so currently with the top configs it is sending to Email address that should be the "from" address, it is sending to the local email(the one that is the from address that we want changed) and sending to the correct email that is assigned to the contact(but has two -- at the end of the email causing it to not send to the recipient, we only want it to send to the contact, and use the "from" address [email protected]
point 1: should send only to [email protected] (there is these two -- after the email that should be removed, don't know where to edit that), if you can please help
point 2: it is sending to nagios@kironinteractive(this is what the from address should be, and should not be sending to it)
point 3: it is sending to it to the from address which it also should not do.
point 4: I changed the admin_email in the config file to nagios@kironinteractive, and added the admin commands to hosts and services and no luck still(as below)
I will past below all the command lines that we have it at the moment.
Host by email:
/usr/bin/printf "%b" "***** Nagios Host Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nPerformance Host Data: $HOSTPERFDATA$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$-- -r $ADMINEMAIL$
Service by email:
/usr/bin/printf "%b" "***** Nagios Host Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nPerformance Host Data: $HOSTPERFDATA$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$-- -r $ADMINEMAIL$
so currently with the top configs it is sending to Email address that should be the "from" address, it is sending to the local email(the one that is the from address that we want changed) and sending to the correct email that is assigned to the contact(but has two -- at the end of the email causing it to not send to the recipient, we only want it to send to the contact, and use the "from" address [email protected]
You do not have the required permissions to view the files attached to this post.
Re: SMTP connect() failed on new setup
please see attached screenshots of all contacts and their settings:
You do not have the required permissions to view the files attached to this post.
Re: SMTP connect() failed on new setup
You do not have the required permissions to view the files attached to this post.