Reciving a connection error when setting up MSSQL checks

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
jajenkins
Posts: 4
Joined: Fri Jun 05, 2015 10:46 am

Reciving a connection error when setting up MSSQL checks

Post by jajenkins »

Hello,

I am attempting to set up a MSSQL Server check through the wizard, and am receiving the following error after the check is set up:

Connection to the database failed for an unknown reason.

Any Ideas?
There is no Spoon.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Reciving a connection error when setting up MSSQL checks

Post by jdalrymple »

Is your MSSQL server setup to allow external TCP/IP connections. Typically the default is to not allow those connections. If it is, can you verify connectivity from another application like sqlcmd or Microsoft SQL Management Studio?
User avatar
jajenkins
Posts: 4
Joined: Fri Jun 05, 2015 10:46 am

Re: Reciving a connection error when setting up MSSQL checks

Post by jajenkins »

i'm not sure, let me check with our SQL admin and ill let you know.
There is no Spoon.
User avatar
jajenkins
Posts: 4
Joined: Fri Jun 05, 2015 10:46 am

Re: Reciving a connection error when setting up MSSQL checks

Post by jajenkins »

Just verified that external tcp/ip is allowed.
There is no Spoon.
User avatar
jajenkins
Posts: 4
Joined: Fri Jun 05, 2015 10:46 am

Re: Reciving a connection error when setting up MSSQL checks

Post by jajenkins »

@jdalrymple I solved the problem. :D

I had to modify the actual Command: check_xi_mssql_server i modified it from $USER1$/check_mssql_server.py -H $HOSTADDRESS$: $ARG1$ to $USER1$/check_mssql_server.py -H $HOSTADDRESS$:1433 $ARG1$

it's odd that in the Wizard that I was unable to create it like that to begin with, i was given this error: Cannot specify port and instance.

Any idea why the Wizard would block that?
There is no Spoon.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Reciving a connection error when setting up MSSQL checks

Post by jdalrymple »

The commands are created in such a way so that they shouldn't have to be modified but still offer great flexibility in the wizard itself. I think in the case of our wizard you specify the port, or the instance, but not both. If you're using port 1433 that means (I think) you're not using the browser service, which is fine, but that means you don't need or want to name the instance.

Did you go through the wizard trying to specify only the port? Had you done that I think that the resulting service should have had the -p argument so no ":1433" would be needed:

Code: Select all

check_xi_mssql_server!-U 'foo' -P 'bar' -p 1433 --locktimeouts --warning 20 --critical 30
In this case expanding that out with the included command would be:

Code: Select all

$USER1$/check_mssql_server.py -H <windowsip> -U 'foo' -P 'bar' -p 1433 --locktimeouts --warning 20 --critical 30
Locked