chech_cluster

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

chech_cluster

Postby natalia.fitsyk » Mon Sep 05, 2016 10:04 am

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

Re: chech_cluster

Postby rkennedy » Tue Sep 06, 2016 10:49 am

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
Nagios Fusion 4 will be here soon! https://www.youtube.com/watch?v=Edc8ScCAYZk

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
rkennedy
Support Tech
 
Posts: 6495
Joined: Mon Oct 05, 2015 11:45 am
Location: Nagios Enterprises

Re: chech_cluster

Postby natalia.fitsyk » Wed Sep 07, 2016 2:35 am

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

Re: chech_cluster

Postby rkennedy » Wed Sep 07, 2016 10:39 am

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?
Nagios Fusion 4 will be here soon! https://www.youtube.com/watch?v=Edc8ScCAYZk

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
rkennedy
Support Tech
 
Posts: 6495
Joined: Mon Oct 05, 2015 11:45 am
Location: Nagios Enterprises

Re: chech_cluster

Postby natalia.fitsyk » Fri Sep 09, 2016 9:18 am

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

Re: chech_cluster

Postby rkennedy » Fri Sep 09, 2016 10:19 am

This is completely different from your initial posting. How is the check_cluster command defined?
Nagios Fusion 4 will be here soon! https://www.youtube.com/watch?v=Edc8ScCAYZk

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
rkennedy
Support Tech
 
Posts: 6495
Joined: Mon Oct 05, 2015 11:45 am
Location: Nagios Enterprises

Re: chech_cluster

Postby natalia.fitsyk » Mon Sep 12, 2016 2:51 am

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

Re: chech_cluster

Postby tgriep » Mon Sep 12, 2016 4:21 pm

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

Re: chech_cluster

Postby natalia.fitsyk » Tue Sep 13, 2016 2:47 am

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

Re: chech_cluster

Postby tgriep » Tue Sep 13, 2016 10:49 am

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

Next

Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests