chech_cluster
-
- Posts: 29
- Joined: Mon Aug 22, 2016 8:14 am
chech_cluster
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.
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.
Re: chech_cluster
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 -
See this page for more of an explanation - https://assets.nagios.com/downloads/nag ... tions.html
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
Former Nagios Employee
-
- Posts: 29
- Joined: Mon Aug 22, 2016 8:14 am
Re: chech_cluster
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.
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
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
-
- Posts: 29
- Joined: Mon Aug 22, 2016 8:14 am
Re: chech_cluster
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
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
This is completely different from your initial posting. How is the check_cluster command defined?
Former Nagios Employee
-
- Posts: 29
- Joined: Mon Aug 22, 2016 8:14 am
Re: chech_cluster
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.
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
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?
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!
-
- Posts: 29
- Joined: Mon Aug 22, 2016 8:14 am
Re: chech_cluster
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
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 228 times
Re: chech_cluster
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.
Since the nagiosadmin account is using that template, that will enable notifications for it.
Code: Select all
host_notifications_enabled 1
service_notifications_enabled 1
Be sure to check out our Knowledgebase for helpful articles and solutions!