Nagios Core 4.0.8 Notification - Service Alert

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.
Locked
esetman
Posts: 9
Joined: Mon Dec 08, 2014 4:17 pm

Nagios Core 4.0.8 Notification - Service Alert

Post by esetman »

Hi experts,
I have a weird problem with Nagios Core 4.0.8 OS CentOS 5.11
Installed it, configured all its working as expected with one exception.

I have a problem with sending Services notifications.

If I set the following values (just like that):
max_check_attempts 1
retry_interval 1
so everything is OK. Notification will be sent

Setting other than 1, 1 for example.:
max_check_attempts 3
retry_interval 3
notification is not sent :(


Annex adding screen configuration.
Interestingly, in the case Hosts Alers notification is sent without problems.


Can you please tell me whats happening. I already google it, but found no anser.
I appreciate you help.

Thank you
Attachments
my-settings
my-settings
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios Core 4.0.8 Notification - Service Alert

Post by Box293 »

So when you say the notification is not sent, has the service entered a hard state?

The reason why your first example works straight away is it will only allow 1 check attempt before going into a hard state.

With your second example, your service must fail three times before it enters a hard state. Example:

1.12pm - Service check fails, retry interval is 3 so next attempt is 1.15pm (check attempt #1) (soft state)
1.15pm - Service check retry fails, retry interval is 3 so next attempt is 1.18pm (check attempt #2) (soft state)
1.18pm - Service check retry fails, max_check_attempts reached (check attempt #3) so alert is sent (hard state)
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
esetman
Posts: 9
Joined: Mon Dec 08, 2014 4:17 pm

Re: Nagios Core 4.0.8 Notification - Service Alert

Post by esetman »

Hello,
Thank you for your response :).

Nagios check service 3x. Service entered a hard state.
Host check-host-alive: max_check_attempts 3 retry_interval 3 ==> notification has been send
Servis notification unsent :(

cat /usr/local/nagios/var/nagios.log

[1418107553] PROGRAM_RESTART event encountered, restarting...
[1418107553] Event broker module 'NERD' deinitialized successfully.
[1418107553] Nagios 4.0.8 starting... (PID=30162)
[1418107553] Local time is Tue Dec 09 07:45:53 CET 2014
[1418107553] LOG VERSION: 2.0
[1418107553] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1418107553] qh: core query handler registered
[1418107553] nerd: Channel hostchecks registered successfully
[1418107553] nerd: Channel servicechecks registered successfully
[1418107553] nerd: Channel opathchecks registered successfully
[1418107553] nerd: Fully initialized and ready to rock!
[1418107553] wproc: Successfully registered manager as @wproc with query handler
[1418107553] wproc: Registry request: name=Core Worker 25091;pid=25091
[1418107553] wproc: Registry request: name=Core Worker 25092;pid=25092
[1418107553] wproc: Registry request: name=Core Worker 25093;pid=25093
[1418107553] wproc: Registry request: name=Core Worker 25094;pid=25094
[1418107570] HOST ALERT: ups-u-dedy;DOWN;SOFT;1;CRITICAL - Host Unreachable (192.168.42.1)
[1418107575] SERVICE ALERT: ups-u-dedy;HTTP;CRITICAL;SOFT;1;connect to address 192.168.42.1 and port 80: No route to host
[1418107706] SERVICE ALERT: ups-u-dedy;PING PO KLENOVCE;CRITICAL;SOFT;1;CRITICAL - Host Unreachable (192.168.42.1)
[1418107709] HOST ALERT: ups-u-dedy;DOWN;SOFT;2;CRITICAL - Host Unreachable (192.168.42.1)
[1418107755] SERVICE ALERT: ups-u-dedy;HTTP;CRITICAL;SOFT;2;connect to address 192.168.42.1 and port 80: No route to host
[1418107758] HOST ALERT: ups-u-dedy;DOWN;HARD;3;CRITICAL - Host Unreachable (192.168.42.1)
[1418107758] HOST NOTIFICATION: michal-email;ups-u-dedy;DOWN;notify-host-by-email;CRITICAL - Host Unreachable (192.168.42.1)
[1418107758] HOST NOTIFICATION: tatka-email;ups-u-dedy;DOWN;notify-host-by-email;CRITICAL - Host Unreachable (192.168.42.1)

[1418107761] SERVICE ALERT: becolink-prelouc-bod2;PING DO INTERNETU;CRITICAL;SOFT;1;PING CRITICAL - Packet loss = 0%, RTA = 367.52 ms
[1418107761] SERVICE EVENT HANDLER: becolink-prelouc-bod2;PING DO INTERNETU;CRITICAL;SOFT;1;notify-service-by-email
[1418107766] SERVICE ALERT: ups-u-dedy;PING PO KLENOVCE;CRITICAL;SOFT;2;CRITICAL - Host Unreachable (192.168.42.1)
[1418107821] SERVICE ALERT: becolink-prelouc-bod2;PING DO INTERNETU;OK;SOFT;2;PING OK - Packet loss = 0%, RTA = 4.16 ms
[1418107821] SERVICE EVENT HANDLER: becolink-prelouc-bod2;PING DO INTERNETU;OK;SOFT;2;notify-service-by-email
[1418107826] SERVICE ALERT: ups-u-dedy;PING PO KLENOVCE;CRITICAL;HARD;3;CRITICAL - Host Unreachable (192.168.42.1)
[1418107935] SERVICE ALERT: ups-u-dedy;HTTP;CRITICAL;HARD;3;connect to address 192.168.42.1 and port 80: No route to host

Annex adding new screen

Any idea?
Attachments
screen2.jpg
emislivec
Posts: 52
Joined: Tue Feb 25, 2014 10:06 am

Re: Nagios Core 4.0.8 Notification - Service Alert

Post by emislivec »

Can you post the service definition and the definition for contacts that should be notified? The templates they use will help too.
esetman
Posts: 9
Joined: Mon Dec 08, 2014 4:17 pm

Re: Nagios Core 4.0.8 Notification - Service Alert

Post by esetman »

I attach configuration in Annex. I send something else?
Have you found anything?

thank you
Attachments
problem-service-notification.zip
(8.78 KiB) Downloaded 241 times
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios Core 4.0.8 Notification - Service Alert

Post by Box293 »

Code: Select all

[1418107758] HOST ALERT: ups-u-dedy;DOWN;HARD;3;CRITICAL - Host Unreachable (192.168.42.1)
[1418107935] SERVICE ALERT: ups-u-dedy;HTTP;CRITICAL;HARD;3;connect to address 192.168.42.1 and port 80: No route to host
Because you're host has gone down first, service notifications are suppressed.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
esetman
Posts: 9
Joined: Mon Dec 08, 2014 4:17 pm

Re: Nagios Core 4.0.8 Notification - Service Alert

Post by esetman »

yes, but already there is not:
[1418192254] SERVICE NOTIFICATION: michal-email;ups-u-dedy;HTTP;CRITICAL;notify-service-by-email;connect to address 192.168.42.1 and port 80: No route to host
[1418192254] SERVICE NOTIFICATION: tatka-email;ups-u-dedy;HTTP;CRITICAL;notify-service-by-email;connect to address 192.168.42.1 and port 80: No route to host


If I set:
max_check_attempts 1
retry_interval 1

it's ok: SERVICE NOTIFICATION SEND:
[1418192254] SERVICE ALERT: ups-u-dedy;HTTP;CRITICAL;HARD;1;connect to address 192.168.42.1 and port 80: No route to host
[1418192254] SERVICE NOTIFICATION: michal-email;ups-u-dedy;HTTP;CRITICAL;notify-service-by-email;connect to address 192.168.42.1 and port 80: No route to host
[1418192254] SERVICE NOTIFICATION: tatka-email;ups-u-dedy;HTTP;CRITICAL;notify-service-by-email;connect to address 192.168.42.1 and port 80: No route to host


Setting other than 1, 1 for example.:
max_check_attempts 3
retry_interval 3
notification is not sent


in the log only: (SERVICE NOTIFICATION is missing) :(
[1418107575] SERVICE ALERT: ups-u-dedy;HTTP;CRITICAL;SOFT;1;connect to address 192.168.42.1 and port 80: No route to host
1418107755] SERVICE ALERT: ups-u-dedy;HTTP;CRITICAL;SOFT;2;connect to address 192.168.42.1 and port 80: No route to host
[1418107935] SERVICE ALERT: ups-u-dedy;HTTP;CRITICAL;HARD;3;connect to address 192.168.42.1 and port 80: No route to host
esetman
Posts: 9
Joined: Mon Dec 08, 2014 4:17 pm

Re: Nagios Core 4.0.8 Notification - Service Alert

Post by esetman »

Today was a power outage. Thus, everything was down.
It is interesting that two services are set the same as the other non-functional, but the notification was sent.
But it was not sent from all monitored hosts the specific service.

Services - conig name: check_ping service name: PING PO KLENOVCE
has set member hosts: bridge-vesnice-unas,bridge-vesnice-ziegler,gateway-mikrotik-stodola,mikrotik-chalupy-udedy,mikrotik-obec-ziegler,ovislink-ap-unas,ovislink-ap-ziegler,teplomer-u-nas,ups-u-dedy,watch-dog-ziegler
SERVICE ALERT notification has been send from hosts: teplomer-u-nas,bridge-vesnice-unas (only) :(

I do not understand it :(
Do you have any idea?

thank you
esetman
Posts: 9
Joined: Mon Dec 08, 2014 4:17 pm

Re: Nagios Core 4.0.8 Notification - Service Alert

Post by esetman »

Box293 sorry, I missed your reply.
So if check the hosts reached the first state hard, so to suppress the notification of hard state services?

When I disable check hosts:
active_checks_enabled 0
passive_checks_enabled 0

so log:
[1418238418] SERVICE ALERT: ups-u-dedy;PING PO KLENOVCE;CRITICAL;SOFT;1;CRITICAL - Host Unreachable (192.168.42.1)
[1418238461] SERVICE ALERT: ups-u-dedy;HTTP;CRITICAL;SOFT;1;connect to address 192.168.42.1 and port 80: No route to host
[1418238478] SERVICE ALERT: ups-u-dedy;PING PO KLENOVCE;CRITICAL;SOFT;2;CRITICAL - Host Unreachable (192.168.42.1)
[1418238521] SERVICE ALERT: ups-u-dedy;HTTP;CRITICAL;SOFT;2;connect to address 192.168.42.1 and port 80: No route to host
[1418238538] SERVICE ALERT: ups-u-dedy;PING PO KLENOVCE;CRITICAL;HARD;3;CRITICAL - Host Unreachable (192.168.42.1)
[1418238581] SERVICE ALERT: ups-u-dedy;HTTP;CRITICAL;HARD;3;connect to address 192.168.42.1 and port 80: No route to host

==> service notification unsent...
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Core 4.0.8 Notification - Service Alert

Post by abrist »

Was the host up during the logs in your last post?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked