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

Re: chech_cluster

Post by natalia.fitsyk »

Hi,
This is contact for Nagios Admin:

define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user

email myemail@mail.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}

and I added the line for host_ and services_ about your indications.
But the mail don't arrived from the cluster if the service is down :(
Thank you.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: chech_cluster

Post by rkennedy »

Since it's not an issue with sendmail, please post your /usr/local/nagios/var/objects.cache file for us to review. Then, let us know exactly which host / service is not notifying properly.
Former Nagios Employee
natalia.fitsyk
Posts: 29
Joined: Mon Aug 22, 2016 8:14 am

Re: chech_cluster

Post by natalia.fitsyk »

Hi,
I have the problem with cluster node 1 and cluster node 2 because nrpe don't send the mail with alert if the cluster service is down, the check_nrpe send the output message on dashboard with this text :

UP 15-09-2016 15:08:57 9d 22h 28m 53s CRITICAL:service_cluster disabled::RGMANAGER:RUNNING:

Thanks.
Attachments
objects_cache.txt
(13.93 KiB) Downloaded 365 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: chech_cluster

Post by tgriep »

I looked on the Objects Cache file and did not find any services called service_cluster or RGMANAGER from your example.
If you could post that, we could help out.

But the configs for the 2 host checks called cluster node 1 and cluster node 2 are configured to send email notifications when they are down and the nagiosadmin looks to be enabled correctly for notifications as well.
So those host checks should be sending notifications. Is this what you want?
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,
This is output when I run the .sh for check the cluster status.

[root@cluster_node1 ~]# /usr/local/nagios/libexec/check_nrpe -2 -H localhost -c check_nrpe_cluster
CRITICAL:service_cluster disabled;:RGMANAGER:RUNNING;

[root@cluster_node1 ~]# echo $?
1

In this chase I need the email alert from Nagios Server .
But the mail don't arrived with critical message, the mail arrived only if the system operation is down, but not if the service_cluster is down.
I explain me?
Thanks.
Attachments
check_rhcs.sh
(1.64 KiB) Downloaded 383 times
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: chech_cluster

Post by rkennedy »

Your plugin is not written correctly - https://nagios-plugins.org/doc/guidelines.html

Specifically this part -

Code: Select all

if [[ "$ERRORS" ]]
then
        echo "CRITICAL:$ERRORS:$STATUS"
        #echo "1"
        exit 1
else
        echo "OK:$STATUS"
        #echo "0"
        exit 0
fi

0 is OK status, but 1 is NOT Critical, 1 is a WARNING status.

Nagios is expecting an exit 2 in a CRITICAL state.
Former Nagios Employee
natalia.fitsyk
Posts: 29
Joined: Mon Aug 22, 2016 8:14 am

Re: chech_cluster

Post by natalia.fitsyk »

Hi,
Now is ok.
Thank you very much for the help.
Regards.
:)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: chech_cluster

Post by tmcdonald »

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked