Failed to Start Nagios service

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Ravikimt
Posts: 77
Joined: Tue Apr 03, 2018 12:02 pm

Re: Failed to Start Nagios service

Post by Ravikimt »

I am getting this output after running this command "which sendEmail" in both the machines.

Code: Select all

/usr/bin/sendEmail
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Failed to Start Nagios service

Post by tgriep »

What it could be is that the smtp.office365.com server is blocking the new nagios server from forwarding emails through it so you would have to go to them to see if there is some sort of filter they need to adjust.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Ravikimt
Posts: 77
Joined: Tue Apr 03, 2018 12:02 pm

Re: Failed to Start Nagios service

Post by Ravikimt »

Hi @tgriep , We have change the settings in smtp.office365.com and allowed all traffic which is coming from our Nagios Server.

But still we are facing the same issue, I want to add one more thing here we have deployed this Nagios application on Azure cloud and we are running Ubuntu 18.04 LTS OS top of that.

Please help me here ASAP.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Failed to Start Nagios service

Post by tgriep »

Are you seeing the same error as before?
NOTICE => Authentication not supported by the remote SMTP server!
ERROR => Received: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [BYAPR11CA0100.namprd11.prod.outlook.com]
Do you see any errors in this log file?

Code: Select all

/var/log/sendEmail
Can you run this test command as root on the Nagios server without it failing? Replace everything between the <> with valid data.

Code: Select all

/usr/bin/sendEmail -s <SMTP Server> -xu <username> -xp <password> -t <to email address> -f <From email address> -l /var/log/sendEmail -u "Test Subject" -m "Test Email"
Be sure to check out our Knowledgebase for helpful articles and solutions!
Ravikimt
Posts: 77
Joined: Tue Apr 03, 2018 12:02 pm

Re: Failed to Start Nagios service

Post by Ravikimt »

I have fixed the issue. The problem was TLS while triggering the alert we have to use this option in you command.cfg file -o "tls=yes" .

Code: Select all

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/bin/sendEmail -o "tls=yes" -s $USER7$ -xu $USER5$ -xp $USER6$ -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\nNote: This is an automated message that is system generated so please do not reply to this email. For any queries write to 'tech.support@tredence.com'"
        }
# 'notify-service-by-email' command definition

Code: Select all

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/bin/sendEmail -o "tls=yes" -s $USER7$ -xu $USER5$ -xp $USER6$ -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$\n\nNote: This is an automated message that is system generated so please do not reply to this email. For any queries write to 'tech.support@tredence.com'"
   }

After making the changes in command.cfg file I got below error.

Code: Select all

 ERROR => No TLS support!  SendEmail can't load required libraries. (try installing Net::SSLeay and IO::Socket::SSL)
I installed both the packages "Net::SSLeay" and "IO::Socket::SSL" by using below command.

Code: Select all

sudo cpan 

Code: Select all

install Net::SSLeay  

Code: Select all

install IO::Socket::SSL 
It fixed the problem for me.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Failed to Start Nagios service

Post by tgriep »

Glad you have fixed the email issue and reported back what you did. I'll lock the post as solved for you but feel free to post any new questions in the future.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked