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.

Re: chech_cluster

Postby natalia.fitsyk » Wed Sep 14, 2016 7:30 am

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

Re: chech_cluster

Postby rkennedy » Wed Sep 14, 2016 10:13 am

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

Re: chech_cluster

Postby natalia.fitsyk » Thu Sep 15, 2016 8:17 am

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

Re: chech_cluster

Postby tgriep » Thu Sep 15, 2016 2:36 pm

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

Re: chech_cluster

Postby natalia.fitsyk » Fri Sep 16, 2016 3:54 am

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

Re: chech_cluster

Postby rkennedy » Fri Sep 16, 2016 10:35 am

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

Re: chech_cluster

Postby natalia.fitsyk » Mon Sep 19, 2016 3:09 am

Hi,
Now is ok.
Thank you very much for the help.
Regards.
:)
natalia.fitsyk
 
Posts: 29
Joined: Mon Aug 22, 2016 8:14 am

Re: chech_cluster

Postby tmcdonald » Mon Sep 19, 2016 9:47 am

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tmcdonald
Support Manager
 
Posts: 7931
Joined: Mon Sep 23, 2013 8:40 am

Previous

Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 1 guest