Page 1 of 2

chech_cluster

Posted: Mon Sep 05, 2016 10:04 am
by natalia.fitsyk
Hi everyone,
I have a problem with my check nrpe.
The config on nagios server are:
objects/commands.cfg

# 'check_cluster' command definition
define command{
command_name check_nrpe_cluster
command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c check_nrpe_cluster

define service{
use generic-service
host_name remote_host
service_description check cluster
check_command check_nrpe!check_nrpe_cluster!1!
}

when I try to execute I check_cluster

[root@server ~]# /usr/local/nagios/libexec/check_nrpe -H 10.10.10.10 -c check_nrpe_cluster
CRITICAL:service_name disabled;:RGMANAGER:RUNNING;

(I disable a service on the cluster for testing nagios alert)

on the remote host:
nrep.cfg:

command[check_nrpe_cluster]=/usr/local/nagios/libexec/check_rhcs.sh

but don't arrive the mail alert

Where I do wrong?
Thank everyone.

Re: chech_cluster

Posted: Tue Sep 06, 2016 10:49 am
by rkennedy
Are notifications turned on and configured?

It doesn't look like you have a contact assigned in your service definition, does your template generic-service have one assigned?

For example -

Code: Select all

	notification_interval	#
	first_notification_delay	#
	notification_period	timeperiod_name
	notification_options	[w,u,c,r,f,s]
	notifications_enabled	[0/1]
	contacts	contacts
See this page for more of an explanation - https://assets.nagios.com/downloads/nag ... tions.html

Re: chech_cluster

Posted: Wed Sep 07, 2016 2:35 am
by natalia.fitsyk
Hi,
yes notification is defined:

define host{
name generic-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
notification_period 24x7 ; Send host notifications at any time
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}

When I shutdown the server mail alert arrived with

** PROBLEM Host Alert: remote_host is DOWN **

When I execute check_nrpe on local machine this is the output

[root@remote_machine ~]# /usr/local/nagios/libexec/check_nrpe -2 -H 10.10.10.10 -c check_nrpe_cluster
CRITICAL:cluster_service disabled;:RGMANAGER:RUNNING;

[root@remote_machine ~]# echo $?
1

but mail notification don't arrived.

Thank you.
:)

Re: chech_cluster

Posted: Wed Sep 07, 2016 10:39 am
by rkennedy
You posted the template for generic-host, not generic-service. Hosts / services do operate together, but will vary based on the settings for each. Could you post the generic-service template?

Re: chech_cluster

Posted: Fri Sep 09, 2016 9:18 am
by natalia.fitsyk
Hi,
define service {
name check_cluster
service_description check cluster status
display_name check_cluster_status
check_command check_cluster!
initial_state 0
max_check_attempts 2
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 30
notification_period 24x7
notification_options w,c,r
contact_groups admins
hosts inode1,node2
}

Thanks

Re: chech_cluster

Posted: Fri Sep 09, 2016 10:19 am
by rkennedy
This is completely different from your initial posting. How is the check_cluster command defined?

Re: chech_cluster

Posted: Mon Sep 12, 2016 2:51 am
by natalia.fitsyk
Hi,
on Nagios Server

# 'check_cluster' command definition
define command{
command_name check_nrpe_cluster
command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c check_nrpe_cluster
}

On Nagios Client

command[check_nrpe_cluster]=/usr/local/nagios/libexec/check_rhcs.sh -c 1

Thank you.

Re: chech_cluster

Posted: Mon Sep 12, 2016 4:21 pm
by tgriep
Have you setup the server for either Sendmail or Postfix daemon to run and accept emails and forward them on?
That has to be done first so the server can send emails.

Can you post the config for the contact group called admins, also the contact settings for those contacts and the templates use for those configs?

Re: chech_cluster

Posted: Tue Sep 13, 2016 2:47 am
by natalia.fitsyk
Hi,
The sandmail in config correctly, because I recived the mail from Nagios Server if other server is down.
** PROBLEM Host Alert: server_client is DOWN **
or
** RECOVERY Host Alert: server_client is UP **

# Generic contact definition template - This is NOT a real contact, just a template!

define contact{
name generic-contact ; The name of this contact template
service_notification_period 24x7 ; service notifications can be sent anytime
host_notification_period 24x7 ; host notifications can be sent anytime
service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events
host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events
service_notification_commands notify-service-by-email ; send service notifications via email
host_notification_commands notify-host-by-email ; send host notifications via email
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
}

Thank you

Re: chech_cluster

Posted: Tue Sep 13, 2016 10:49 am
by tgriep
Edit the generic-contact template and add the following so that is any contact uses that template, they will have the host and service notifications enabled.

Code: Select all

host_notifications_enabled              1
service_notifications_enabled          1
Since the nagiosadmin account is using that template, that will enable notifications for it.