Check_Cluster returns different results UI vs Run Check CMD

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
imadc
Posts: 58
Joined: Wed Jun 14, 2017 12:10 pm

Check_Cluster returns different results UI vs Run Check CMD

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Check_Cluster returns different results UI vs Run Check

Post 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
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
imadc
Posts: 58
Joined: Wed Jun 14, 2017 12:10 pm

Re: Check_Cluster returns different results UI vs Run Check

Post 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
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Check_Cluster returns different results UI vs Run Check

Post 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$"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
imadc
Posts: 58
Joined: Wed Jun 14, 2017 12:10 pm

Re: Check_Cluster returns different results UI vs Run Check

Post by imadc »

Thanks!

Just tried it out and it works

Imad
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Check_Cluster returns different results UI vs Run Check

Post by npolovenko »

@imadc, Not a problem. Can I go ahead and close this thread now?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
imadc
Posts: 58
Joined: Wed Jun 14, 2017 12:10 pm

Re: Check_Cluster returns different results UI vs Run Check

Post by imadc »

Yes Please

Thanks
Imad
Locked