Page 1 of 2

Quick Email Alert Notifications

Posted: Thu Sep 27, 2018 5:35 am
by rlinux57
Hi Team,

I want to know what settings I have to use in order get to quick email alerts if hosts gets down and service gets critical or warning. Or if it gets socket timeout etc ? Kindly mention the settings here.
I am using nagios core Version 4.4.2

Regards,
rlinux57

Re: Quick Email Alert Notifications

Posted: Thu Sep 27, 2018 11:18 am
by scottwilkerson
The fastest alerts would be up to 1 minute, if you set the following in the object definitions

Code: Select all

check_interval 1
max_check_attempts 1
retry_interval 1

Re: Quick Email Alert Notifications

Posted: Thu Sep 27, 2018 2:32 pm
by rlinux57
I have set:
max_attempts 3 (for host)
max_attempts 5 (for services)
Actually when my node goes down, I got"SERVICE ALERT" and "Warning: Return code of 255 for check of service" of some services. Moreover, I didn't get any "HOST ALERT" warning or critical. I don't know why ?

Re: Quick Email Alert Notifications

Posted: Thu Sep 27, 2018 3:07 pm
by scottwilkerson
We would need to see all the relevant configurations for the hosts and included templates as well as the associated contact definitions and defined commands in order to evaluate why there were no host notifications.

Re: Quick Email Alert Notifications

Posted: Fri Sep 28, 2018 5:18 am
by rlinux57
I have sent detail in private message to you and hide all sensitive information.

Re: Quick Email Alert Notifications

Posted: Fri Sep 28, 2018 7:53 am
by scottwilkerson
received, waiting on a few additional details. We can continue via PM

Re: Quick Email Alert Notifications

Posted: Fri Sep 28, 2018 1:42 pm
by scottwilkerson
I setup all the configs you sent me and there were no services defined.

That said, I did re-read your previous message.
rlinux57 wrote:Actually when my node goes down, I got"SERVICE ALERT" and "Warning: Return code of 255 for check of service" of some services. Moreover, I didn't get any "HOST ALERT" warning or critical. I don't know why ?
Are you saying you are getting an email notification or just an alert in the UI/Log? Because getting alerted in the UI/Log is standard behavior, only the email notification would be suppressed if the host was down.

Re: Quick Email Alert Notifications

Posted: Fri Sep 28, 2018 2:37 pm
by rlinux57
Service has defined in that file, I mean to say HOST DOWN Alert and Notification has not generated, When Host gets down.

Re: Quick Email Alert Notifications

Posted: Fri Sep 28, 2018 2:51 pm
by scottwilkerson
rlinux57 wrote:Service has defined in that file, I mean to say HOST DOWN Alert and Notification has not generated, When Host gets down.
I am seeing both the host down alerts and the notifications in my /usr/local/nagios/var/nagios.log

Code: Select all

[1538159800] HOST ALERT: linux-01;DOWN;SOFT;1;check_icmp: Failed to resolve IP-ADDRESS
[1538159815] HOST ALERT: linux-02;DOWN;SOFT;1;check_icmp: Failed to resolve IP-ADDRESS
[1538159836] HOST ALERT: linux-03;DOWN;SOFT;1;check_icmp: Failed to resolve IP-ADDRESS
[1538159924] HOST NOTIFICATION: nagiosadmin;linux-01;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538159924] HOST NOTIFICATION: john;linux-01;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538159924] HOST ALERT: linux-01;DOWN;HARD;3;check_icmp: Failed to resolve IP-ADDRESS
[1538159932] HOST NOTIFICATION: nagiosadmin;linux-02;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538159932] HOST NOTIFICATION: john;linux-02;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538159932] HOST ALERT: linux-02;DOWN;HARD;3;check_icmp: Failed to resolve IP-ADDRESS
[1538159954] HOST NOTIFICATION: nagiosadmin;linux-03;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538159954] HOST NOTIFICATION: john;linux-03;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538159954] HOST ALERT: linux-03;DOWN;HARD;3;check_icmp: Failed to resolve IP-ADDRESS
[1538160104] HOST NOTIFICATION: nagiosadmin;linux-01;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538160104] HOST NOTIFICATION: john;linux-01;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538160112] HOST NOTIFICATION: nagiosadmin;linux-02;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538160112] HOST NOTIFICATION: john;linux-02;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538160134] HOST NOTIFICATION: nagiosadmin;linux-03;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538160139] HOST NOTIFICATION: john;linux-03;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538160284] HOST NOTIFICATION: nagiosadmin;linux-01;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
[1538160284] HOST NOTIFICATION: john;linux-01;DOWN;notify-host-by-email;check_icmp: Failed to resolve IP-ADDRESS
additionally, after adding the missing services (sorry about that, had to fix hostgroups to get them added), I can see the logs for them as well

Code: Select all

[1538164055] SERVICE ALERT: linux-01;Memory - Usage;WARNING;HARD;1;(No output on stdout) stderr: Could not resolve hostname IP-ADDRESS: Name or service not known
[1538164072] SERVICE ALERT: linux-02;Memory - Usage;WARNING;HARD;1;(No output on stdout) stderr: Could not resolve hostname IP-ADDRESS: Name or service not known
[1538164087] SERVICE ALERT: linux-03;Memory - Usage;WARNING;HARD;1;(No output on stdout) stderr: Could not resolve hostname IP-ADDRESS: Name or service not known

Re: Quick Email Alert Notifications

Posted: Sat Sep 29, 2018 12:34 am
by rlinux57
Then What's missing ?