[SOLVED] i don't receive mail 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.
aleks1
Posts: 43
Joined: Thu Nov 28, 2013 1:33 pm

Re: i don't receive mail notification...

Post by aleks1 »

@sreinhardt
Can you run the following command and send back the output
the command! :

Code: Select all

nslookup -querytype=any deaconsulenze.eu
Server:		10.10.2.102
Address:	10.10.2.102#53

Non-authoritative answer:
deaconsulenze.eu	nameserver = ns2003.dizinc.com.
deaconsulenze.eu	nameserver = ns2004.dizinc.com.

Authoritative answers can be found from:

Stuart Watts
Posts: 40
Joined: Wed Sep 25, 2013 7:01 am

Re: i don't receive mail notification...

Post by Stuart Watts »

That output looks truncated, but similar to a successful name resolution.

If you did successfully resolve the MX record, then I'd next check the network - can you "telnet intra.deaconsulenze.eu 25" from the Nagios server?
aleks1
Posts: 43
Joined: Thu Nov 28, 2013 1:33 pm

Re: i don't receive mail notification...

Post by aleks1 »

Authoritative answer is empty...is a good thing??

here is the command:

Code: Select all

root@backups:~# telnet intra.deaconsulenze.eu 25
Trying 144.76.118.183...
Connected to intra.deaconsulenze.eu.
Escape character is '^]'.
220 intra.deaconsulenze.eu ESMTP Postfix (Debian/GNU)
i don't know what can i do! :(
Stuart Watts
Posts: 40
Joined: Wed Sep 25, 2013 7:01 am

Re: i don't receive mail notification...

Post by Stuart Watts »

Does /var/log/maillog show any other information around the time of the failed Nagios notification?

Try sending a mail manually:

Code: Select all

telnet intra.deaconsulenze.eu 25
HELO <nagios server FQDN>  <---- (the output from "uname -n")
MAIL FROM:some.email@address.com
RCPT TO:your.email@address.com
DATA
SUBJECT:Test email
[Press Enter twice]

some data
some data
.
The last part is a single "." on a line on it's own, which tells the relay you're done sending data. Post any errors you get from doing this.
aleks1
Posts: 43
Joined: Thu Nov 28, 2013 1:33 pm

Re: i don't receive mail notification...

Post by aleks1 »

Does /var/log/maillog show any other information around the time of the failed Nagios notification?
only this:

Code: Select all

 unknown; sleeping for retry
Jun  6 10:41:01 backups sm-msp-queue[9722]: unable to qualify my own domain name (localhost) -- using short name
Jun  6 11:00:02 backups sm-msp-queue[10797]: My unqualified host name (localhost) unknown; sleeping for retry
Jun  6 11:01:02 backups sm-msp-queue[10797]: unable to qualify my own domain name (localhost) -- using short name
Jun  6 11:20:01 backups sm-msp-queue[11962]: My unqualified host name (localhost) unknown; sleeping for retry
Jun  6 11:21:01 backups sm-msp-queue[11962]: unable to qualify my own domain name (localhost) -- using short name
Jun  6 11:40:01 backups sm-msp-queue[13053]: My unqualified host name (localhost) unknown; sleeping for retry
Jun  6 11:41:01 backups sm-msp-queue[13053]: unable to qualify my own domain name (localhost) -- using short name
Jun  6 12:00:01 backups sm-msp-queue[14367]: My unqualified host name (localhost) unknown; sleeping for retry
Jun  6 12:01:01 backups sm-msp-queue[14367]: unable to qualify my own domain name (localhost) -- using short name
Jun  6 12:20:01 backups sm-msp-queue[15849]: My unqualified host name (localhost) unknown; sleeping for retry
and if i try to send emails with the command:

Code: Select all

echo "test" | mail -s "test mail" alessio.coli@deaconsulenze.eu"
i have this in mail.log:

Code: Select all

Jun  6 10:36:38 backups sendmail[9451]: s568acQu009451: from=nagios, size=96, class=0, nrcpts=1, msgid=<201406060836.s568acQu009451@localhost>, relay=nagios@localhost
Jun  6 10:36:38 backups sm-mta[9481]: s568acms009481: from=<nagios@localhost>, size=330, class=0, nrcpts=1, msgid=<201406060836.s568acQu009451@localhost>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jun  6 10:36:38 backups sendmail[9451]: s568acQu009451: to=<alessio.coli@deaconsulenze.eu>, ctladdr=nagios (1006/1006), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30096, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s568acms009481 Message accepted for delivery)
Jun  6 10:36:38 backups sm-mta[9483]: STARTTLS=client, relay=intra.deaconsulenze.eu., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES256-SHA, bits=256/256
Jun  6 10:36:39 backups sm-mta[9483]: s568acms009481: to=<alessio.coli@deaconsulenze.eu>, ctladdr=<nagios@localhost> (1006/1006), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120330, relay=intra.deaconsulenze.eu. [144.76.118.183], dsn=2.0.0, stat=Sent (Ok: queued as 6C24520BB4)

sending emails with telnet:

Code: Select all

root@backups:~# telnet intra.deaconsulenze.eu 25
Trying 144.76.118.183...
Connected to intra.deaconsulenze.eu.
Escape character is '^]'.
220 intra.deaconsulenze.eu ESMTP Postfix (Debian/GNU)
HELO backups
250 intra.deaconsulenze.eu
MAIL FROM:nagios@backups                           
250 2.1.0 Ok
RCPT TO:alessio.coli@deaconsulenze.eu
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
SUBJECT:test email


test

.
250 2.0.0 Ok: queued as 6B2EE208EB
and the mail arrives to my account...
Stuart Watts
Posts: 40
Joined: Wed Sep 25, 2013 7:01 am

Re: i don't receive mail notification...

Post by Stuart Watts »

Hrm, okay.

What happens if you try:

Code: Select all

su - nagios
/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: HTTP\nHost: IpCop Milano ESA\nAddress: 192.168.33.1\nState: CRITICAL\n\nDate/Time: Thu Jun 5 14:51:10 CEST 2014\n\nAdditional Info:\n\nHTTP CRITICAL: HTTP/1.0 504 Gateway Time-out - 1937 bytes in 0,183 second response time\n" | /usr/bin/mail -s "** PROBLEM Service Alert: IpCop Milano ESA/HTTP is CRITICAL **" supporto@deaconsulenze.eu
aleks1
Posts: 43
Joined: Thu Nov 28, 2013 1:33 pm

Re: i don't receive mail notification...

Post by aleks1 »

What happens if you try:

Code: Select all

root@backups:~# su nagios
$ /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: HTTP\nHost: IpCop Milano ESA\nAddress: 192.168.33.1\nState: CRITICAL\n\nDate/Time: Thu Jun 5 14:51:10 CEST 2014\n\nAdditional Info:\n\nHTTP CRITICAL: HTTP/1.0 504 Gateway Time-out - 1937 bytes in 0,183 second response time\n" | /usr/bin/mail -s "** PROBLEM Service Alert: IpCop Milano ESA/HTTP is CRITICAL **" supporto@deaconsulenze.eu
$ 
from account supporto@deaconsulenze.eu:

Code: Select all

***** Nagios *****

Notification Type: PROBLEM

Service: HTTP
Host: IpCop Milano ESA
Address: 192.168.33.1
State: CRITICAL

Date/Time: Thu Jun 5 14:51:10 CEST 2014

Additional Info:

HTTP CRITICAL: HTTP/1.0 504 Gateway Time-out - 1937 bytes in 0,183 second response time
the problem arrives to account supporto@deaconsulenze.eu!!!! :)
we are near the solution? :)
Stuart Watts
Posts: 40
Joined: Wed Sep 25, 2013 7:01 am

Re: i don't receive mail notification...

Post by Stuart Watts »

I'm not sure, to be honest! That command is what Nagios runs when the notification is triggered.

One very minor thing - can you "su - nagios", not "su nagios" and run the command again please?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: i don't receive mail notification...

Post by sreinhardt »

Just to make it a little more clear for you, Stuart would like to see:

Code: Select all

su nagios
/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: HTTP\nHost: IpCop Milano ESA\nAddress: 192.168.33.1\nState: CRITICAL\n\nDate/Time: Thu Jun 5 14:51:10 CEST 2014\n\nAdditional Info:\n\nHTTP CRITICAL: HTTP/1.0 504 Gateway Time-out - 1937 bytes in 0,183 second response time\n" | /usr/bin/mail -s "** PROBLEM Service Alert: IpCop Milano ESA/HTTP is CRITICAL **" supporto@deaconsulenze.eu
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: i don't receive mail notification...

Post by eloyd »

I think he wants to see
n you "su - nagios", not "su nagios"
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
Locked