Page 2 of 2

Re: Email Delivery

Posted: Wed Nov 14, 2018 2:03 pm
by tgriep
Without knowing what OS and release the SMTP server is running an what mailer daemon it is running, I cannot specify the log files to check on it to see why the plugin cannot login to the server to send emails.
If the SMTP server is running Linux as the OS and either Postfix or Sendmail as the mailer daemon, the log file is typically here /var/log/maillog but the Server admin should know where it is.

You can try and just run the check_smtp_send part of the plugin with verbose enabled and maybe it will show something. Problem is that the plugin may not return debugging as you are using TLS and the TLS perl module does not have debugging capabilities.

Code: Select all

/usr/local/nagios/libexec/check_smtp_send --hostname xx.xxx.xxx.xxx --tls --username xxxxxxx --password xxxxxxx --port  --mailto xxxxxxx --mailfrom xxxxxxx -vvv

Re: Email Delivery

Posted: Thu Nov 15, 2018 10:42 am
by vignesha
Hi,
OS Version: Windows server 2008 R2 Enterprise SP1

I have tested the command which you have provided is giving same error, also i have tested the same thing with the required oppitions its working and i have received the email as well for the same. PFB info and attachement

But imap receive part is not working am getting below error message

Output:
[root@xxxxxxx libexec]# ./check_smtp_send --hostname xx.xxx.xxx.xxx --tls --username xxxxxxx --password xxxxxxx --port 25 --mailto xxxxxxx --mailfrom xxxxxxx -vvv
SMTP SEND CRITICAL - Server did not return AUTH in capabilities at ./check_smtp_send line 153

[root@xxxxxxx libexec]# ./check_smtp_send
Usage: ./check_smtp_send [-H host [-p port]] --mailto [email protected] [--mailto [email protected] ...] --mailfrom [email protected] --body 'some text' [-w <seconds>] [-c <seconds>]

[root@xxxxxxx libexec]# ./check_smtp_send -H xx.xxx.xxx.xxx -p 25 --mailto xxxxxxx --mailfrom xxxxxxx --body 'Test Mail'
SMTP SEND OK - 1 seconds | elapsed=1s;15;30
You have mail in /var/spool/mail/root

[root@xxxxxxx libexec]# ./check_imap
check_imap: No arguments found
Usage:
check_imap -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>]
[-e <expect string>] [-q <quit string>][-m <maximum bytes>] [-d <delay>]
[-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j]
[-D <warn days cert expire>[,<crit days cert expire>]] [-S <use SSL>] [-E]
[-N <server name indication>]

[root@xxxxxxx libexec]# ./check_imap_receive -H xx.xxx.xxx.xxx -U xxxxxxx -P xxxxxxx --download --download-max 50 -s SUBJECT -s 'test message'
Missing perl modules: Email::Simple

Re: Email Delivery

Posted: Thu Nov 15, 2018 2:43 pm
by tgriep
To be clear, you logged in to the server and saw the email that was sent, correct?

It looks like the SMTP server does not require TLS so you can drop the following option from the check_email_delivery command

Code: Select all

--smtptls
Try running the command like the following example. If it works, update the command on the Nagios server and you should be good to go.

Code: Select all

./check_email_delivery --mailto xxxxxxx --mailfrom xxxxxxx -H xx.xxx.xxx.xxx --smtp-server xx.xxx.xxx.xxx --smtp-username 'SYSVWUKDIS' --smtp-password 'xxxxxxx ' --smtp-port 25 --imap-server xx.xxx.xxx.xxx --imap-username 'SYSVWUKDIS' ---map-password 'xxxxxxx ' --imap-port 143
If not, we just have to figure out the what the IMAP server needs to login.

In your example, you added the --download option which requires the Email::Simple module to be installed on the server.

Code: Select all

cpan -i Email::Simple
Try this command for TLS

Code: Select all

./check_imap_receive -H xx.xxx.xxx.xxx -U xxxxxxx -P xxxxxxx --download --download-max 50 -s SUBJECT -s 'test message'
If the server requires SSL, run this

Code: Select all

./check_imap_receive -H xx.xxx.xxx.xxx -U xxxxxxx -P xxxxxxx --download --download-max 50 -s SUBJECT -s 'test message' --ssl
If the IMAP server required TLS, run the following example should work.

Code: Select all

./check_email_delivery --mailto xxxxxxx --mailfrom xxxxxxx -H xx.xxx.xxx.xxx --smtp-server xx.xxx.xxx.xxx --smtp-username 'SYSVWUKDIS' --smtp-password 'xxxxxxx ' --smtp-port 25 --imap-server xx.xxx.xxx.xxx --imap-username 'SYSVWUKDIS' --imap-password 'xxxxxxx ' --imap-port 143
If it needs SSL, run this

Code: Select all

./check_email_delivery --mailto xxxxxxx --mailfrom xxxxxxx -H xx.xxx.xxx.xxx --smtp-server xx.xxx.xxx.xxx --smtp-username 'SYSVWUKDIS' --smtp-password 'xxxxxxx ' --smtp-port 25 --imap-server xx.xxx.xxx.xxx --imap-username 'SYSVWUKDIS' --imap-password 'xxxxxxx ' --imap-port 993 --imapssl