Page 1 of 1

MSSQL Check Works on CLI not UI

Posted: Mon Feb 01, 2021 3:47 pm
by blariv
i can run the check_mssql query check from the command line but it fails at the UI. it is using its own user created for the DC.

CLI:
/usr/local/nagios/libexec/check_mssql -H HOSTNAME --username 'user' --password 'pass' --database DB --port 3342 --query "query" --decode --result "0"

UI:
CRITICAL: Could not connect to dblib:host=xxx;dbname=xxx as xxx(Exception: SQLSTATE[01002] Adaptive Server connection failed (xxx) (severity 9)).

Re: MSSQL Check Works on CLI not UI

Posted: Tue Feb 02, 2021 2:53 pm
by benjaminsmith
Hi @blariv,

When testing this locally, if I enter the wrong password I am getting the same error message. I believe there may be some special characters in the password that are not getting passed correctly to the plugin.

What part of the UI is this failing? If this is happening using the Run Check Command button from the CCM interface, this is a known issue. Go ahead and configure the service then go to Home > Details > Service Status, find the service, and check to see if you're getting the correct results.

Regards,
Benjamin

Re: MSSQL Check Works on CLI not UI

Posted: Tue Feb 02, 2021 4:06 pm
by blariv
I cant believe I didn't check that first...... looks like it is working fine...sorry for the waste of time

you can lock this

Re: MSSQL Check Works on CLI not UI

Posted: Tue Feb 02, 2021 5:21 pm
by benjaminsmith
HI @blariv,

Not a problem!

We'll go ahead and close this out.

Best Regards,
Benjamin