Email Delivery

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
vignesha
Posts: 115
Joined: Wed Oct 03, 2018 9:09 am

Email Delivery

Post by vignesha »

Hi,

We need to monitor emai deliver in nagios so for that we have tried the same in nagios using the wizard but its giving unkown error, kindly help us to resolve the issue


[root@xxxxxx libexec]# nmap xx.xxx.xxx.xxx

Starting Nmap 6.47 ( http://nmap.org ) at 2018-11-01 11:25 GMT
Nmap scan report for xxxxxxxxxxxxxxx (xx.xxx.xxx.xxx)
Host is up (0.0055s latency).
Not shown: 991 closed ports
PORT STATE SERVICE
25/tcp open smtp
80/tcp open http
110/tcp open pop3
135/tcp open msrpc
139/tcp open netbios-ssn
143/tcp open imap
443/tcp open https
445/tcp open microsoft-ds
5666/tcp open nrpe

Nmap done: 1 IP address (1 host up) scanned in 0.31 seconds
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Email Delivery

Post by tgriep »

Can you contact the Email admin of the SMTP server and have them verify that the server required authenication and that the settings you are using are the correct ones?
Does the SMTP server require TLS?

Have you logged in to the IMAP server using the username and password from the check to see if the test message from the Nagios check is in the inbox?

The check_email_delivery plugin has a verbose option to get more details displayed on what the problem is.
Add the following to the command to see that types of errors are generated to help troubleshoot the issue.

Code: Select all

--verbose
Be sure to check out our Knowledgebase for helpful articles and solutions!
vignesha
Posts: 115
Joined: Wed Oct 03, 2018 9:09 am

Re: Email Delivery

Post by vignesha »

hi,

We have login and tested the username and password are working fine, but email devlivery service is not working still its giving "EMAIL DELIVERY UNKNOWN - smtp unknown:". Even we have configured the same details to manage email settings and its seding hosts/services alerts to the destination mail id.
output:
[root@xxxxxxx libexec]# /usr/local/nagios/libexec/check_email_delivery --mailto xxxxxxxxxx --mailfrom xxxxxxxxx -H xx.xxx.xxx.xxx --smtp-server xx.xxx.xxx.xxx --smtp-username 'SYSVWUKDIS' --smtp-password 'ltZYOyS7PGPq_[]' --smtp-port 25 --imap-server xx.xxx.xxx.xxx --username 'SYSVWUKDIS' --password 'ltZYOyS7PGPq_[]' --imap-port 143 --smtptls --imapssl --verbose
EMAIL DELIVERY UNKNOWN - smtp unknown:
[root@xxxxxxxxxxx libexec]#


Also we have tested the same in different server but there only snmp port 25 has enabled and also we are getting the mail authentication to my mail id as well.PFA and its clearly saying IMAP port 143 is not open so its refusing, but there SNMP 25, IMAP 143 ports are in open state still its giving unkown error.

Please help me out to resolve this issue.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Email Delivery

Post by tgriep »

One thing to note, just because the port is open, doesn't mean it can be used.
If the SMTP server requires authenication, a specific TLS version, etc.. the sending of emails will not work.

Can you run the following commands on the Nagios server and post the output to the ticket?

Code: Select all

/usr/local/nagios/libexec/check_email_delivery -V
ls -l /usr/local/nagios/libexec

Can you install tcpdump in the server so we can capture the network data between the servers so we can analyse it?

Run this to install it.

Code: Select all

yum install tcpdump -y
Then run this as root to capture the data. Change xxx.xxx.xxx.xxx to the smtp server.

Code: Select all

tcpdump -i any -s 65535 -w email.cap host xxx.xxx.xxx.xxx
Open another shell and run the plugin and after it errors, stop the tcpdump and post or PM me the email.cap file.
Be sure to check out our Knowledgebase for helpful articles and solutions!
vignesha
Posts: 115
Joined: Wed Oct 03, 2018 9:09 am

Re: Email Delivery

Post by vignesha »

Hi Tgriep,
PFA output for the following commands.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Email Delivery

Post by tgriep »

The version of that plugin is OK and the permissions are good.
The check_email_devilvey plugin called this plugin to send the emails

Code: Select all

check_smtp_send
And your copy looks like it was changed on August 8th.
Do you know that was done to it?

Also, the tcpdump capture file you sent to me is corrupted so I cannot view it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Email Delivery

Post by tgriep »

Thanks for the tcpdump file I was finally able to open it.
I can see that the server is connecting to the SMTP server and setting up the encryption but since the data is encrypted, we cannot see the actual error message.
From what I can see if that the Nagios server sends some data to the SMTP server but the SMTP server is not acknowledging it and then it drops the connection.

Typically, when using TLS for sending the emails, port 587 is used and you are using port 25. Try using that.
Also, there is an updated version of the plugin. Version 0.7.1
https://exchange.nagios.org/directory/P ... ry/details

You may want to update to that version but it looks like there are compatibility issues with the Perl Modules so backup the existing plugin before upgrading.
Be sure to check out our Knowledgebase for helpful articles and solutions!
vignesha
Posts: 115
Joined: Wed Oct 03, 2018 9:09 am

Re: Email Delivery

Post by vignesha »

Hi Tgriep,

As per your suggestion we have taken backup of existing plugin and we have updated the new plugin version 0.7.1
Are you recommending Port 587, as it is closed from firewall end?
PFB following output for the same.

[root@xxxxxxxx ~]# /usr/local/nagios/libexec/check_email_delivery -V
0.7.1
[root@xxxxxxxx ~]# /usr/local/nagios/libexec/check_imap_receive -V
0.7.5
[root@xxxxxxxx ~]# /usr/local/nagios/libexec/check_smtp_send -V
0.7.2

[root@xxxxxxxx ~]# nmap -p587 xx.xxx.xxx.xxx

Starting Nmap 6.47 ( http://nmap.org ) at 2018-11-13 11:19 GMT
Nmap scan report for xxxxxxxxx (xx.xxx.xxx.xxx)
Host is up (0.0027s latency).
PORT STATE SERVICE
587/tcp closed submission

Nmap done: 1 IP address (1 host up) scanned in 0.09 seconds
[root@xxxxxxx ~]#

[root@xxxxxxx libexec]# ./check_email_delivery --mailto xxxxxxxx--mailfrom xxxxxxx -H xx.xxx.xxx.xxx --smtp-server xx.xxx.xxx.xxx--smtp-username 'SYSVWUKDIS' --smtp-password xxxxxxxx' --smtp-port 587 --imap-server xx.xxx.xxx.xxx--username 'SYSVWUKDIS' --password 'xxxxxxx' --imap-port 143 --smtptls --imapssl --verbose
EMAIL DELIVERY CRITICAL - smtp failed: SMTP SEND CRITICAL - Connect failed :IO::Socket::INET: connect: Connection refused at /usr/local/nagios/libexec/check_smtp_send line 153

[root@xxxxxxx libexec]# ./check_email_delivery --mailto xxxxxxxx --mailfrom xxxxxxxx -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 --username 'SYSVWUKDIS' --password 'xxxxxxxx' --imap-port 143 --smtptls --imapssl --verbose
EMAIL DELIVERY CRITICAL - smtp failed: SMTP SEND CRITICAL - Server did not return AUTH in capabilities at /usr/local/nagios/libexec/check_smtp_send line 153
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Email Delivery

Post by tgriep »

About port 587 was just a statement. Most systems that I have seen is when they use STARTTLS encryption, they change the port to 587 but that doesn't mean that is true across every server.

The updated plugin needs some extra packages installed to run so run the following as root to install them and retest the new plugin.

Code: Select all

yum install perl-Net-SMTP-TLS
yum install perl-Net-SMTPS
yum install perl-IO-Socket-SSL
yum install perl-Net-SMTP-TLS
yum install perl-Net-SMTPS

If it still fails, then someone will have to login to the SMTP server to see why it is rejecting the plugin from running.
Be sure to check out our Knowledgebase for helpful articles and solutions!
vignesha
Posts: 115
Joined: Wed Oct 03, 2018 9:09 am

Re: Email Delivery

Post by vignesha »

Hi Tgriep,

We have installed below mentioned packages but still issue remains same.

As you have replied in the previous conversation "we have to login to the SMTP server to see why it is rejecting the plugin", so for that we have to check the nsclient log (or) we have check any other log ? let me know, so that i can update the same to respective team.

Output:
[root@xxxxxxxx ~]# rpm -qa perl-Net-SMTP-TLS
perl-Net-SMTP-TLS-0.12-1.el6.rf.noarch
[root@xxxxxxxx ~]# rpm -qa perl-Net-SMTPS
perl-Net-SMTPS-0.04-1.el6.noarch
[root@xxxxxxxx ~]# rpm -qa perl-IO-Socket-SSL
perl-IO-Socket-SSL-1.31-3.el6_8.2.noarch
[root@xxxxxxxx ~]#

[root@xxxxxxxx libexec]# ./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 587 --imap-server xx.xxx.xxx.xxx --username 'SYSVWUKDIS' --password 'xxxxxxx ' --imap-port 143 --smtptls --imapssl --verbose
EMAIL DELIVERY CRITICAL - smtp failed: SMTP SEND CRITICAL - Connect failed :IO::Socket::INET: connect: Connection refused at /usr/local/nagios/libexec/check_smtp_send line 153
Locked