Page 1 of 1

Check_Cluster returns different results UI vs Run Check CMD

Posted: Fri Jan 05, 2018 2:16 pm
by imadc
Hello Support

I am trying to use check_cluster but I am getting errors in the output

the remote servers I am trying to reach can be reached by server IP. Check my configuration below on the service\command

$USER1$/check_cluster --service -l $ARG1$ -w $ARG2$ -c $ARG3$ -d $ARG4$

$ARG1$ - > "Genoa Email Service"
$ARG2$ - > 1
$ARG3$ - > 1
$ARG4$ - > "$SERVICESTATEID:10.110.2.1:Genoa Email Service$,$SERVICESTATEID:10.110.2.2:Genoa Email Service$"

When checking from Service Management " Run check command" - I get the following output successfull -

[[email protected] ~]$ /usr/local/nagios/libexec/check_cluster --service -l "Genoa Email Service" -w 1 -c 1 -d "$SERVICESTATEID:10.110.2.1:Genoa Email Service$,$SERVICESTATEID:10.110.2.2:Genoa Email Service$"
CLUSTER OK: Genoa Email Service: 2 ok, 0 warning, 0 unknown, 0 critical

When I apply changes and check the webui - I get an error
CLUSTER CRITICAL: Genoa Email Service: 0 ok, 0 warning, 2 unknown, 0 critical

Can someone help me solve this issue please?

Thanks
Imad

Re: Check_Cluster returns different results UI vs Run Check

Posted: Fri Jan 05, 2018 3:42 pm
by npolovenko
Hello, @imadc. Can you take a screenshot of the command definition in XI? You'd go to the Core Configurations Manager and click on the service, and take a screenshot of the whole "Service Management Page". Here's an example of what that should look like:
screenssdsadsd.png

Re: Check_Cluster returns different results UI vs Run Check

Posted: Mon Jan 08, 2018 10:47 am
by imadc
Dear Support

Check my attached screenshoot

Encase you can't see the ARG here is what is in ARG 4

$ARG4 = "$SERVICESTATEID:10.110.2.1:Genoa Email Service$,$SERVICESTATEID:10.110.2.2:Genoa Email Service$"

Let me know if you need anything else

Thanks
Imad

Re: Check_Cluster returns different results UI vs Run Check

Posted: Mon Jan 08, 2018 12:08 pm
by npolovenko
@imadc, I think you have this problem because you're using the $SERVICESTATEID macro in your command. When Nagios runs the check it assigns the value to this macro only after it receives the state result. So at the moment when Nagios runs the check, $SERVICESTATEID is undefined. So instead of using a macro, I'd suggest to hardcode the state value:

Code: Select all

./check_cluster --service -l "Genoa Email Service" -w 1 -c 1 -d "0:10.110.2.1:Genoa Email Service$,0:10.110.2.2:Genoa Email Service$"

Re: Check_Cluster returns different results UI vs Run Check

Posted: Mon Jan 08, 2018 1:00 pm
by imadc
Thanks!

Just tried it out and it works

Imad

Re: Check_Cluster returns different results UI vs Run Check

Posted: Mon Jan 08, 2018 1:25 pm
by npolovenko
@imadc, Not a problem. Can I go ahead and close this thread now?

Re: Check_Cluster returns different results UI vs Run Check

Posted: Mon Jan 08, 2018 1:33 pm
by imadc
Yes Please

Thanks
Imad