Page 2 of 2

Re: chech_cluster

Posted: Wed Sep 14, 2016 7:30 am
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.

Re: chech_cluster

Posted: Wed Sep 14, 2016 10:13 am
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.

Re: chech_cluster

Posted: Thu Sep 15, 2016 8:17 am
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.

Re: chech_cluster

Posted: Thu Sep 15, 2016 2:36 pm
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?

Re: chech_cluster

Posted: Fri Sep 16, 2016 3:54 am
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.

Re: chech_cluster

Posted: Fri Sep 16, 2016 10:35 am
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.

Re: chech_cluster

Posted: Mon Sep 19, 2016 3:09 am
by natalia.fitsyk
Hi,
Now is ok.
Thank you very much for the help.
Regards.
:)

Re: chech_cluster

Posted: Mon Sep 19, 2016 9:47 am
by tmcdonald
I'll be closing this thread now, but feel free to open another if you need anything in the future!