Page 1 of 1

After 5.4 update: Check returns different results WebUI/CLI

Posted: Wed Jan 11, 2017 4:36 am
by sohasup
Hi,

I'm experiencing an issue after the v5.4 update:
One of my checks is no longer working properly.

So far, only 1 check is affected.
When NagiosXI performs the check, it will always return unknown.
Image

But when I execute the check from CLI or with Run Check Command from the service configuration page, then it works just fine:

Code: Select all

[[email protected] ~]$ /usr/local/nagios/libexec/check_cluster --service -l SQL Server Cluster -c 1 -d $SERVICESTATEID:sh-mgt-db1.shr.local:SQL Server$,$SERVICESTATEID:sh-mgt-db2.shr.local:SQL Server$
CLUSTER OK: SQL: 1 ok, 0 warning, 0 unknown, 0 critical
Before the 5.4 upgrade the check was working just fine.


Does anybody have an idea what could be causing this strange behavior?
Any help would be very apreciated.


Thanks in advance!
Alex

Re: After 5.4 update: Check returns different results WebUI/

Posted: Wed Jan 11, 2017 10:05 am
by rkennedy
Please post the service definition, and also the related command definition for us to look at.

Re: After 5.4 update: Check returns different results WebUI/

Posted: Thu Jan 12, 2017 3:47 am
by sohasup
Hi rkennedy and thank you for your reply.

Here are the service & command definitions:

Code: Select all

define service {
        host_name                       MSCL: SH-MGT-DBCL
        service_description             SQL Server Cluster
        use                             xiwizard_windowsserver_nsclient_service
        servicegroups                   SH MSSQL Server
        check_command                   check_service_cluster!SQL Server Cluster!1!$SERVICESTATEID:sh-mgt-db1.shr.local:SQL Server$,$SERVICESTATEID:sh-mgt-db2.shr.local:SQL Server$!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        nagiosadmin
        _xiwizard                       windowsserver
        register                        1
        }

Code: Select all

define command {
       command_name                             check_service_cluster
       command_line                             $USER1$/check_cluster --service -l $ARG1$ -c $ARG2$ -d $ARG3$
}


I also didn't provide information about my Nagios machine, so here it is:
Manual Install
CentOS Linux release 7.3.1611 (Core)
The box is running as VM on a Windows 2012R2 Hypervisor

Code: Select all

Linux sh-mgt-nag1.shr.local 3.10.0-514.2.2.el7.x86_64 #1 SMP Tue Dec 6 23:06:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Thank you in advance for your help!
Alex

Re: After 5.4 update: Check returns different results WebUI/

Posted: Thu Jan 12, 2017 2:44 pm
by ssax
Please PM one of us a copy of your profile so that we can review your configuration, you can download it by going to Admin > System Config > System Profile and click the Download Profile button in the top right corner.

Thank you

Re: After 5.4 update: Check returns different results WebUI/

Posted: Fri Jan 13, 2017 2:29 am
by sohasup
Hi ssax,

I PM'ed you my profile.
The issue seems to be that the $SERVICESTATEID$ macro is always returning unknown in the web front end, right?
That's why the check_cluster plugin is returning critical.

Thanks

Re: After 5.4 update: Check returns different results WebUI/

Posted: Fri Jan 13, 2017 11:35 am
by ssax
Received, thank you.

The reason that it is not working is because the hostnames have changed, sh-mgt-db1.shr.local should be SRV: SH-MGT-DB1 and sh-mgt-db2.shr.local should be SRV: SH-MGT-DB2, the hostnames/service descriptions are case sensitive as well.

Also, I'm unable to see a way for it to work with the : in the host name, my recommendation would be for you to remove the colon from the host names:

Code: Select all

SRV SH-MGT-DB1
SRV SH-MGT-DB2
Then edit your MSCL: SH-MGT-DBCL SQL Server Cluster service and change $ARG3$ to:

Code: Select all

$SERVICESTATEID:SRV SH-MGT-DB1:SQL Server$,$SERVICESTATEID:SRV SH-MGT-DB2:SQL Server$
Now Apply Configuration and test, let us know the results.

Re: After 5.4 update: Check returns different results WebUI/

Posted: Thu Jan 19, 2017 11:31 am
by sohasup
Hi ssax,

please accept my apologies for my late reply. I was out of office.

I will make the changes as you suggested and report back asap.
Thanks a lot so far!

Re: After 5.4 update: Check returns different results WebUI/

Posted: Thu Jan 19, 2017 2:37 pm
by sohasup
Hi saxx,

well, i was missing the forest for the trees...
Everything is working fine now.
Thank you SO much!

Re: After 5.4 update: Check returns different results WebUI/

Posted: Thu Jan 19, 2017 5:06 pm
by tgriep
Glad that the issue is resolved now. I will lock and mark this post as solved and if you have any new issues, please feel free to open a new post.