not getting email notification
not getting email notification
Hi,I have built a new CentOS 7 server, installed the latest version 4.4.3 of Nagios core and added one Windows 2016 server to be monitored.
When I go to the nagios web interface I can see the test server with the services I have configured, but when I power off the Windows server I don't get an email notifying me the server id down. I have added my email address in the contacts.cfg.
Please help I don't know what am I missing. I keep checking and researching on the Internet but I get no luck.
When I go to the nagios web interface I can see the test server with the services I have configured, but when I power off the Windows server I don't get an email notifying me the server id down. I have added my email address in the contacts.cfg.
Please help I don't know what am I missing. I keep checking and researching on the Internet but I get no luck.
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: not getting email notification
Hello @CaptainG,
Take a look at the object definition to make sure all the settings are correct or you can post the contact and service definition for us to review.
Nagios Core Object Definitions
Assuming that is configured correctly, try sending a custom notification from the web interface and check your mail log, /var/log/maillog, for errors.
Take a look at the object definition to make sure all the settings are correct or you can post the contact and service definition for us to review.
Nagios Core Object Definitions
Assuming that is configured correctly, try sending a custom notification from the web interface and check your mail log, /var/log/maillog, for errors.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: not getting email notification
I have attached the contacts and windows.cfg and capture of maillog. To answer "...try sending a custom notification from the web interface and check your mail log" I don't know how to do this. I went to the web interface but I don't see any link for email. Thank you for your help.
- Attachments
-
- windows.cfg
- (4.37 KiB) Downloaded 192 times
-
- contacts.cfg
- (2.14 KiB) Downloaded 193 times
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: not getting email notification
Hello @CaptainG,
Thanks for sending the configuration files over, it looks ok. By the way, I assuming you took removed the ip address for TEST2016B for security.
1. Have you run the pre-flight check on the configuration to verify everything is ok:
The windows server template is set to notify on down and recovery ( notification_options d,r ) so if you power it off it will be in a unreachable state but you should get a notification on the recovery.
You can try adjusting the check command to force the host in a down state. You'll find the check command in commands.cfg. The host check utilizes check ping.
2. Verify if a notification was sent for the host
You can see if Nagios tried to send a notification in log file ( /usr/local/nagios/nagios.log ) or take a look at the reports available in the web interface ( see attached image).
3. If the notification was sent but you did not receive it, then there's a mail settings issue here, and review the mail log on your system for errors.
Thanks for sending the configuration files over, it looks ok. By the way, I assuming you took removed the ip address for TEST2016B for security.
1. Have you run the pre-flight check on the configuration to verify everything is ok:
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
You can try adjusting the check command to force the host in a down state. You'll find the check command in commands.cfg. The host check utilizes check ping.
2. Verify if a notification was sent for the host
You can see if Nagios tried to send a notification in log file ( /usr/local/nagios/nagios.log ) or take a look at the reports available in the web interface ( see attached image).
3. If the notification was sent but you did not receive it, then there's a mail settings issue here, and review the mail log on your system for errors.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: not getting email notification
Hi,
I have Nagios Core 4.4.2 . I want to receive mail to my mail adress . I follow the steps in this sites : https://www.smsk.biz/nagios-use-an-exte ... fications/
But i can' t receive the mail notification . I have 2 mail adress. xxxxx@mydomain.com.tr ( this is sender mail address) and yyyyy@mydomain.com ( this is my receiver mail adress ) .
Please help me Why can't I get receive mail notification ? If you want my .cfg file, I can share this files with you.
I have Nagios Core 4.4.2 . I want to receive mail to my mail adress . I follow the steps in this sites : https://www.smsk.biz/nagios-use-an-exte ... fications/
But i can' t receive the mail notification . I have 2 mail adress. xxxxx@mydomain.com.tr ( this is sender mail address) and yyyyy@mydomain.com ( this is my receiver mail adress ) .
Please help me Why can't I get receive mail notification ? If you want my .cfg file, I can share this files with you.
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: not getting email notification
Hi @seliimgnc,
Are you using sendmail or an external SMTP server for mail delivery? Can you send a test message using sendmail from the command line?
Can you tail the mail log and post the output for us to review?
Lastly, can you post your notificaiton commands for notify-host-by-email and notify-service-by-email. This should be in /usr/local/nagios/etc/objects/commands.cfg. Thanks.
Are you using sendmail or an external SMTP server for mail delivery? Can you send a test message using sendmail from the command line?
Can you tail the mail log and post the output for us to review?
Code: Select all
tail /var/log/maillog
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: not getting email notification
Hi, I' ve tried send a test mail but I saw this error:benjaminsmith wrote:Hi @seliimgnc,
Are you using sendmail or an external SMTP server for mail delivery? Can you send a test message using sendmail from the command line?
Can you tail the mail log and post the output for us to review?Lastly, can you post your notificaiton commands for notify-host-by-email and notify-service-by-email. This should be in /usr/local/nagios/etc/objects/commands.cfg. Thanks.Code: Select all
tail /var/log/maillog
sendEmail -vt < /usr/local/nagios/mail.txt
Apr 08 16:29:22 ubuntu sendEmail[44758]: ERROR => You must specify a 'from' field! Try --help.
Re: not getting email notification
Also you can see my commands.cfg :benjaminsmith wrote:Hi @seliimgnc,
Are you using sendmail or an external SMTP server for mail delivery? Can you send a test message using sendmail from the command line?
Can you tail the mail log and post the output for us to review?Lastly, can you post your notificaiton commands for notify-host-by-email and notify-service-by-email. This should be in /usr/local/nagios/etc/objects/commands.cfg. Thanks.Code: Select all
tail /var/log/maillog
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b%b%b%b%b%b%b" \
"***** Nagios *****\n\n" \
"Notification Type: $NOTIFICATIONTYPE$\n" \
"Host: $HOSTNAME$\n" \
"State: $HOSTSTATE$\n" \
"Address: $HOSTADDRESS$\n" \
"Info: $HOSTOUTPUT$\n\n" \
"Date/Time: $LONGDATETIME$\n" \
| /usr/bin/sendemail -s $USER7$ \
-l /var/log/sendemail \
-f $USER5$ \
-t $CONTACTEMAIL$ \
-u "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **"
}
# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b%b%b%b%b%b%b%b%b" \
"***** Nagios *****\n\n" \
"Notification Type: $NOTIFICATIONTYPE$\n\n" \
"Service: $SERVICEDESC$\n" \
"Host: $HOSTALIAS$\n" \
"Address: $HOSTADDRESS$\n" \
"State: $SERVICESTATE$\n\n" \
"Date/Time: $LONGDATETIME$\n\n" \
"Additional Info:\n\n" \
"$SERVICEOUTPUT$" \
| /usr/bin/sendemail -s $USER7$ \
-l /var/log/sendemail \
-f $USER5$ \
-t $CONTACTEMAIL$ \
-u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **"
}
Re: not getting email notification
@CapitanG, let us know if you have any further questions for this post.
@seliimgnc, if you login the Nagios web interface, and go the Process Info menu, are Notifications enabled?
If you go to the Reports > Notification menu, is the system trying to send the notifications to a contact?
Do you see any errors or entries in this log file?
@seliimgnc, if you login the Nagios web interface, and go the Process Info menu, are Notifications enabled?
If you go to the Reports > Notification menu, is the system trying to send the notifications to a contact?
Do you see any errors or entries in this log file?
Code: Select all
/var/log/sendemail
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: not getting email notification
I go to /usr/local/Nagios- but there is no nagio.log file !