Page 1 of 1

Nagios Reply Email Acknowledgement Not Working

Posted: Tue Nov 26, 2019 3:13 pm
by hul1
Hi I'm trying to set up my emails to receive the nagios XI ability to handle inbound email commands.
I tried to reply back to a Nagios problem email notification with a simple
"ack"
but it doesn't work but doesn't return a reply back error. I do see the following from /data/nagiosxi/var/cleaner.log
when I reply back to the mail server. This is a pop3 mail server using port 110 that I tested works for sending emails out.

Code: Select all

DIR: /usr/local/nagiosxi/nom/checkpoints/nagioscore
NUMFOUND: 10
KEEPING ALL GOOD CHECKPOINTS
DIR: /usr/local/nagiosxi/nom/checkpoints/nagioscore/errors
NUMFOUND: 10
KEEPING ALL ERROR CHECKPOINTS
DIR: /usr/local/nagiosxi/nom/checkpoints/nagiosxi
NUMFOUND: 10
KEEPING ALL SNAPSHOTS
----------------------------------
Running callbacks:
Error - Could not find a host object in the hash provided
Processed 1 incoming emails
----------------------------------
PHP Notice:  Unknown: SECURITY PROBLEM: insecure server advertised AUTH=PLAIN (errflg=1) in Unknown on line 0

Re: Nagios Reply Email Acknowledgement Not Working

Posted: Tue Nov 26, 2019 4:15 pm
by cdienger
Is the email an html email? Test by sending a plain 'ack' if possible. Usually the 'could not find a host object..." message is due to the message not parsing correctly. Try modifying /usr/local/nagiosxi/html/includes/components/xicore/xicore.inc.php so that the error check looks like below:

Code: Select all

// Verify that at least a hostname is present
                if (empty($obj->host)) {
                echo $email['body'];
                echo "Error - Could not find a host object in the hash provided\n";
                $error = true;
              }
This section starts on line 562. The echo $email['body']; is the new addition. Testing the function again should include the body of the email in the output.

Re: Nagios Reply Email Acknowledgement Not Working

Posted: Wed Nov 27, 2019 8:49 am
by hul1
Okay I reran it and looked for the message in the cleaner.log and got the following:

Code: Select all

KEEPING ALL SNAPSHOTS
----------------------------------
Running callbacks:
ack
________________________________
From: Nagios XI <[email protected]>
Sent: Sunday, November 24, 2019 11:08 AM
To: <[email protected]>
Subject: PROBLEM Service Alert - reslnlhtest03.research.chop.edu/Load is CR=
ITICAL

---- Respond above this line ----

***** Nagios XI Alert *****

Nagios has detected a problem with this service.

Notification Type: PROBLEM

Service: Load
Host: reslnlhtest03.research.chop.edu
Address: reslnlhtest03.research.chop.edu
State: CRITICAL
Info:
CRITICAL - load average per CPU: 2.20, 2.04, 1.88
Date/Time: 2019-11-24 11:08:37

Respond: nagios.research.chop.edu/rr.php?oid=3D3164&token=3Dd68a94979659e50=
8e2975c4a227bba4dac4b62b4
Nagios URL: nagios.research.chop.edu/

-----

To reply, keep the following data in your response email.

##NGRkMGYxM2M0YjExNjgyYjh2eE9WWHdMeVJxQysrMnpRT05xVkJFWWg5QzJBaWxjaTBxd1FmK=
1BKU0c1VTJpcXFYakFldHV0YU91SlZPSkpYZ0ovM3c5cnkzUEtRcjBIZW9BUFpRPT0=3D##
Error - Could not find a host object in the hash provided
Processed 1 incoming emails
----------------------------------
PHP Notice:  Unknown: SECURITY PROBLEM: insecure server advertised AUTH=PLAIN (errflg=1) in Unknown on line 0
DIR: /usr/local/nagiosxi/nom/checkpoints/nagioscore
Also I get an email back with the following:

Code: Select all

Could not submit command due to missing hash data. Did you reply with the full email?

- Nagios XI System

Re: Nagios Reply Email Acknowledgement Not Working

Posted: Wed Nov 27, 2019 9:13 am
by scottwilkerson
It looks like the hash is wrapping, this should have been resolved in 5.6.6 of XI

Code: Select all

Fixed problem with reading multiple line hashes sent when an inbound email response is wrapped [TPS#14396] -JO
What version are you running?

Re: Nagios Reply Email Acknowledgement Not Working

Posted: Wed Nov 27, 2019 10:36 am
by hul1

Code: Select all

Nagios XI 5.6.5
Oh okay, I think we just need to upgrade Nagios and I can test it again. Thanks!

Re: Nagios Reply Email Acknowledgement Not Working

Posted: Wed Nov 27, 2019 10:37 am
by scottwilkerson
hul1 wrote:Oh okay, I think we just need to upgrade Nagios and I can test it again. Thanks!
Sounds good!