How can enable notify via send email

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.
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: How can enable notify via send email

Post by baber »

rkennedy wrote:Please attach the file /usr/local/nagios/var/objects.cache for us to look at, and let us know which host / service AND contact you're not receiving notifications for.

i have attached the file
Attachments
objects.zip
(4.02 KiB) Downloaded 246 times
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: How can enable notify via send email

Post by rkennedy »

baber wrote:
rkennedy wrote:Please attach the file /usr/local/nagios/var/objects.cache for us to look at, and let us know which host / service AND contact you're not receiving notifications for.

i have attached the file
We also need this information -
let us know which host / service AND contact you're not receiving notifications for.
Former Nagios Employee
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: How can enable notify via send email

Post by baber »

rkennedy wrote:
baber wrote:
rkennedy wrote:Please attach the file /usr/local/nagios/var/objects.cache for us to look at, and let us know which host / service AND contact you're not receiving notifications for.

i have attached the file
We also need this information -
let us know which host / service AND contact you're not receiving notifications for.

previously i have sent my cfg file i just add contact line in one of my services

Code: Select all

define service{
        use                     local-service
        host_name               redhat6.4
        service_description     DNS
        check_command           check_nrpe!check_dns
        contacts                nagiosadmin
        }

and my host is :

Code: Select all

define host{
use             linux-server
host_name       redhat6.4
alias           server redhat6.4
address         172.x.x.x
}


i have attached my .cfg file

i am confused and i am not sure my sendmail service is working correctly or not

warm regards
Babak
Attachments
redhat7.cfg
(3.84 KiB) Downloaded 396 times
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: How can enable notify via send email

Post by rkennedy »

Are ALL notifications not working on your system then?

What is the output of which mail?
Former Nagios Employee
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: How can enable notify via send email

Post by baber »

rkennedy wrote:Are ALL notifications not working on your system then?

What is the output of which mail?
output is:

Code: Select all

/bin/mail
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: How can enable notify via send email

Post by rkennedy »

baber wrote:
rkennedy wrote:Are ALL notifications not working on your system then?

What is the output of which mail?
output is:

Code: Select all

/bin/mail
That looks proper then. You still have not told us if you're testing notifications for one service, or your whole system. I'm unsure with what is working and whatnot.
Are ALL notifications not working on your system then?
Also, when you go to the Home page, click 'Notifications' under the Reports section -- do you see the notifications listed here? Can you show us a screenshot of this page?

Lastly, please post your maillog. It's located at /var/log/maillog
Former Nagios Employee
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: How can enable notify via send email

Post by baber »

rkennedy wrote:
baber wrote:
rkennedy wrote:Are ALL notifications not working on your system then?

What is the output of which mail?
output is:

Code: Select all

/bin/mail
That looks proper then. You still have not told us if you're testing notifications for one service, or your whole system. I'm unsure with what is working and whatnot.
Are ALL notifications not working on your system then?
Also, when you go to the Home page, click 'Notifications' under the Reports section -- do you see the notifications listed here? Can you show us a screenshot of this page?

Lastly, please post your maillog. It's located at /var/log/maillog

i have put notification for test on one of my service in a host

Code: Select all

define host{
use             linux-server
host_name       redhat6.4
alias           server redhat6.4
address         172.x.x.x
}

define service{
        use                     local-service
        host_name               redhat6.4
        service_description     DNS
        check_command           check_nrpe!check_dns
        contacts                nagiosadmin
        }

and attach a pic and log file


i am so confused i don't know what is my problem
Attachments
mail&log.zip
(4.24 MiB) Downloaded 256 times
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: How can enable notify via send email

Post by rkennedy »

Looking at your maillog I noticed -

Code: Select all

Jun  1 19:57:03 lin postfix/error[13841]: 7FF7371C8D: to=<[email protected]>, relay=none, delay=0.3, delays=0.25/0/0/0.04, dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=dsa.co.ir type=MX: Host not found, try again)
It looks like Nagios is firing the notifications properly. From the CLI of Nagios, can you run nslookup dsa.co.ir? Also, can you post your /etc/hosts file?
Former Nagios Employee
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: How can enable notify via send email

Post by baber »

rkennedy wrote:Looking at your maillog I noticed -

Code: Select all

Jun  1 19:57:03 lin postfix/error[13841]: 7FF7371C8D: to=<[email protected]>, relay=none, delay=0.3, delays=0.25/0/0/0.04, dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=dsa.co.ir type=MX: Host not found, try again)
It looks like Nagios is firing the notifications properly. From the CLI of Nagios, can you run nslookup dsa.co.ir? Also, can you post your /etc/hosts file?

nslookup dsa.co.ir :
connection timeout ; trying next origin
connection timeout ; no server request

/etc/host
127.0.0.1 localhost
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: How can enable notify via send email

Post by rkennedy »

Do you have DNS setup on your machine? This is why your notifications aren't sending properly. You could also add a manual entry to your /etc/hosts file for dsa.co.ir.

It resolves fine on my end -

Code: Select all

[root@localhost var]# nslookup dsa.co.ir
Server:         192.168.5.2
Address:        192.168.5.2#53

Non-authoritative answer:
Name:   dsa.co.ir
Address: 185.10.72.56
Former Nagios Employee
Locked