Page 3 of 4

Re: Email Delivery Wizard - SMTP Uknown

Posted: Fri May 10, 2019 10:35 am
by scottwilkerson
You only have 1/2 the command

Code: Select all

./check_email_delivery --plugin "/usr/local/nagios/libexec/check_smtp_send -H smpthost --mailto [email protected] --mailfrom [email protected] --header 'Subject: Nagios XI Test.'" --plugin "/usr/local/nagios/libexec/check_imap_receive -H IMAPHOST -p 143 -U Ngs -P 'pmon' --nodelete -s SUBJECT -s 'Subject: Nagios XI Test.'"

Re: Email Delivery Wizard - SMTP Uknown

Posted: Fri May 10, 2019 10:51 am
by rferebee
Yes, sorry. I should have included that I tried with the full command, but am getting the same exact error.

I thought perhaps the second part of the command was only if you needed to check for receipt of the message, I don't really need to do that because we're creating a script on the Exchange server that does that for us. I thought using the first half of the command might work by itself, but it doesn't.

Re: Email Delivery Wizard - SMTP Uknown

Posted: Fri May 10, 2019 10:56 am
by scottwilkerson
Can you add the --verbose flag to your command to see what results you are getting?

Code: Select all

/usr/local/nagios/libexec/check_email_delivery --plugin "/usr/local/nagios/libexec/check_smtp_send -H smtpserver --mailto [email protected] --mailfrom [email protected] --header 'Subject: Nagios XI Test.' --verbose"

Re: Email Delivery Wizard - SMTP Uknown

Posted: Fri May 10, 2019 12:41 pm
by rferebee
I added the --verbose and ran the command from the CLI and from the GUI. Same result on both:

EMAIL DELIVERY CRITICAL - plugin 1 failed: SMTP SEND CRITICAL - Could not send to [email protected]

Re: Email Delivery Wizard - SMTP Uknown

Posted: Fri May 10, 2019 2:10 pm
by scottwilkerson
Are you sure your smtp server is allowing sending from this server? Can you view the logs from the SMTP server?

Re: Email Delivery Wizard - SMTP Uknown

Posted: Fri Jun 07, 2019 1:55 pm
by rferebee
Ok, I think I'm really close to getting this to work... I'm getting the following error now:

(Service check timed out after 61.01 seconds)

Here's the command I'm using:

--plugin "/usr/local/nagios/libexec/check_smtp_send -H exchange.state --mailto [email protected] --mailfrom [email protected] --header 'Subject: Nagios XI Test.'" --plugin "/usr/local/nagios/libexec/check_imap_receive -H exchange.state -p 993 -U [email protected] -P 'XXXXXXXXXX' --nodelete -s SUBJECT -s 'Nagios XI Test.'"

How can I keep the check from timing out?

Thank you!

Re: Email Delivery Wizard - SMTP Uknown

Posted: Fri Jun 07, 2019 2:04 pm
by scottwilkerson
I would add --verbose to each of the command to see if you can get some output at where it might be stopping

Code: Select all

/usr/local/nagios/libexec/check_email_delivery --plugin "/usr/local/nagios/libexec/check_smtp_send -H exchange.state --mailto [email protected] --mailfrom [email protected] --header 'Subject: Nagios XI Test.'  --verbose" --plugin "/usr/local/nagios/libexec/check_imap_receive -H exchange.state -p 993 -U [email protected] -P 'XXXXXXXXXX' --nodelete -s SUBJECT -s 'Nagios XI Test.'  --verbose" --verbose
I would run it from the command line to see what the output is

Re: Email Delivery Wizard - SMTP Uknown

Posted: Fri Jun 07, 2019 2:41 pm
by rferebee
Here's what I got running it from the CLI:

EMAIL DELIVERY CRITICAL - Could not run plugin 2: exceeded timeout 60 seconds

Re: Email Delivery Wizard - SMTP Uknown

Posted: Fri Jun 07, 2019 2:50 pm
by scottwilkerson
So plugin 2 would be this

Code: Select all

/usr/local/nagios/libexec/check_imap_receive -H exchange.state -p 993 -U [email protected] -P 'XXXXXXXXXX' --nodelete -s SUBJECT -s 'Nagios XI Test.'  --verbose
Are you sure you can get a response from this IMAP server with this port and credentials?

You may need to add the --ssl flag

Re: Email Delivery Wizard - SMTP Uknown

Posted: Fri Jun 07, 2019 2:55 pm
by rferebee
I think 993 is the correct port, because when I try with 143 I get this:

EMAIL DELIVERY CRITICAL - plugin 2 failed: IMAP RECEIVE CRITICAL - Could not connect to exchangem.state port 143: 1 BAD Command received in Invalid state. at /usr/local/nagios/libexec/check_imap_receive line 145.

And, I'm absolutely certain of the credentials. I'm logged into the mailbox right now.