chech_cluster

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.
natalia.fitsyk
Posts: 29
Joined: Mon Aug 22, 2016 8:14 am

chech_cluster

Post 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.
Last edited by natalia.fitsyk on Wed Sep 07, 2016 2:26 am, edited 1 time in total.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: chech_cluster

Post 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
Former Nagios Employee
natalia.fitsyk
Posts: 29
Joined: Mon Aug 22, 2016 8:14 am

Re: chech_cluster

Post 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.
:)
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: chech_cluster

Post 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?
Former Nagios Employee
natalia.fitsyk
Posts: 29
Joined: Mon Aug 22, 2016 8:14 am

Re: chech_cluster

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: chech_cluster

Post by rkennedy »

This is completely different from your initial posting. How is the check_cluster command defined?
Former Nagios Employee
natalia.fitsyk
Posts: 29
Joined: Mon Aug 22, 2016 8:14 am

Re: chech_cluster

Post 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.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: chech_cluster

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
natalia.fitsyk
Posts: 29
Joined: Mon Aug 22, 2016 8:14 am

Re: chech_cluster

Post 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
Attachments
contact_name_group_nagios.txt
(2.44 KiB) Downloaded 215 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: chech_cluster

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked