How to use gmail/external mail id to send notification

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.
vimalparikh
Posts: 10
Joined: Fri Jan 13, 2017 10:50 am

How to use gmail/external mail id to send notification

Post by vimalparikh »

Team,

We have Zimbra mail server in our organiztion, I want to use one of the Zimbra Email id to send the notification email form Nagios,

Please provide the step as i dont know how to do it.

Regads,
Vimal Parikh
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: How to use gmail/external mail id to send notification

Post by mcapra »

Zimbra uses Postfix on the back-end, so you should be able to configure it like you would any old Postfix server.

Here's some slightly older documentation for how to connect to remote SMTP servers and send emails using the sendEmail script:
https://www.unixmen.com/send-alerts-nag ... ail-yahoo/

sendEmail has some quirks when connecting to GMail accounts, but I've never had much trouble using it with self-hosted Postfix servers.
Former Nagios employee
https://www.mcapra.com/
kyang

Re: How to use gmail/external mail id to send notification

Post by kyang »

Thanks @mcapra!
vimalparikh
Posts: 10
Joined: Fri Jan 13, 2017 10:50 am

Re: How to use gmail/external mail id to send notification

Post by vimalparikh »

Hi,

I am getting below error while sending test mail from coomandline

[root@localhost ~]# sendEmail -o tls=yes -f vmal.parikh@gmail.com -t vimalparikh@zydushospitals.com -s smtp.gmail.com:587 -xu vmal.parikh@gmail.com -xp Z***@*** -u "Hello from sendEmail" -m "how are you? "
*******************************************************************
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
together with SSL_ca_file|SSL_ca_path for verification.
If you really don't want to verify the certificate and keep the
connection open to Man-In-The-Middle attacks please set
SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
*******************************************************************
at /usr/local/bin/sendEmail line 1906.
invalid SSL_version specified at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 424.



Please Help me out.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: How to use gmail/external mail id to send notification

Post by tgriep »

Did you install the Net::SSLeay and IO::Socket::SSL perl modules on the server like the web site suggested?
If TLS is giving strange errors, try upgrading the Net::SSLeay and IO::Socket::SSL perl modules to the latest version.
Be sure to check out our Knowledgebase for helpful articles and solutions!
vimalparikh
Posts: 10
Joined: Fri Jan 13, 2017 10:50 am

Re: How to use gmail/external mail id to send notification

Post by vimalparikh »

Hi Team,
Already have latest version installed , Please see the below Output
...


[root@localhost ~]# yum install 'perl(Net::SSLeay)' 'perl(IO::Socket::SSL)'
Loaded plugins: fastestmirror, langpacks
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
(1/2): extras/7/x86_64/primary_db | 130 kB 00:00
(2/2): updates/7/x86_64/primary_db | 4.5 MB 00:47
Loading mirror speeds from cached hostfile
* base: mirror.vbctv.in
* extras: mirrors.nhanhoa.com
* updates: centos-hcm.viettelidc.com.vn
Package perl-Net-SSLeay-1.55-6.el7.x86_64 already installed and latest version
Package perl-IO-Socket-SSL-1.94-6.el7.noarch already installed and latest version
Nothing to do
vimalparikh
Posts: 10
Joined: Fri Jan 13, 2017 10:50 am

Re: How to use gmail/external mail id to send notification

Post by vimalparikh »

Team,

Please find the attached sheet having output of both file.

Regards,
Vimal
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: How to use gmail/external mail id to send notification

Post by tgriep »

There are newer versions available from CPAN so run the following to install the packages from there.

Code: Select all

cpan -i Net::SSLeay
cpan -i IO::Socket::SSL
Try that and see if those versions fix the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
vimalparikh
Posts: 10
Joined: Fri Jan 13, 2017 10:50 am

Re: How to use gmail/external mail id to send notification

Post by vimalparikh »

Hi Tgriep and Team,

I tried both the command as you said,

yum insatll cpan -i Net::SSLeay
yum install cpan -i IO::Socket::SSL


with -i option it gives error like Command line error: no such option: -i.

and without -i , it gives Error downloading packages:
1:perl-ExtUtils-ParseXS-3.18-3.el7.noarch: [Errno 256] No more mirrors to try.



Please suggest,

Regards,
Vimal
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: How to use gmail/external mail id to send notification

Post by tgriep »

No, you do not add the "yum install" to the commands. Run them exactly like shown, do not add the yum install to them.

Code: Select all

cpan -i Net::SSLeay
cpan -i IO::Socket::SSL
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked