Quick Email Alert Notifications

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.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Quick Email Alert Notifications

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Quick Email Alert Notifications

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Quick Email Alert Notifications

Post 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 ?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Quick Email Alert Notifications

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Quick Email Alert Notifications

Post by rlinux57 »

I have sent detail in private message to you and hide all sensitive information.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Quick Email Alert Notifications

Post by scottwilkerson »

received, waiting on a few additional details. We can continue via PM
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Quick Email Alert Notifications

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Quick Email Alert Notifications

Post by rlinux57 »

Service has defined in that file, I mean to say HOST DOWN Alert and Notification has not generated, When Host gets down.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Quick Email Alert Notifications

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Quick Email Alert Notifications

Post by rlinux57 »

Then What's missing ?
Locked