Page 1 of 2
Using MSSQL Query
Posted: Thu Apr 28, 2016 5:03 am
by azam101
Hi,
We recently bought nasgios XI and are trying to test some of the features.
Currently trying to get monitor a mssql database query working from the Configuration Wizard MSSQL Query.
But for some reason we keep getting the error see attached
The database works fine with the login locally.
Will nagios allow domain logins to databases or do they have to be SQL server authentication
We have tried with all types of logins, but cant get it to connect to database.
The database server is on online, nagios can ping it fine .
Is there something were missing?
Re: Using MSSQL Query
Posted: Thu Apr 28, 2016 1:50 pm
by rkennedy
The test from the web GUI isn't the best, what happens if you let the check run it's full course?
Also, can you attempt to run the check over the CLI? When you're there, also run nmap samevalueof-H (replace samevalueof-H with the IP for the MSSQL server]
Re: Using MSSQL Query
Posted: Fri Apr 29, 2016 4:46 am
by azam101
Ran the above in the cli and got the same error.
the ran nmap with sql server ip address
Got the message
Re: Using MSSQL Query
Posted: Fri Apr 29, 2016 10:15 am
by rkennedy
The nmap is only reporting that it sees port 113, and even that is closed. Do you have a firewall running on the MSSQL server, or one between that and the XI machine? I would take a look there to begin.
Re: Using MSSQL Query
Posted: Fri Apr 29, 2016 10:27 am
by azam101
does port 113 need to be open
the sql server works fine with other nagios alerts , like CPU , RAM , Memory and services.
I tried it on a different server , which I am having the same issue with Using MSSQL Query and get the same error, did the same command see attached
Re: Using MSSQL Query
Posted: Fri Apr 29, 2016 1:44 pm
by tgriep
You can try to see if you can use the domain login to access that server.
If you do try it, the username should be like the example below
The forward slash is important.
If it still fails, create a local user account and see it that works.
I thing the plugin may require a local account.
Re: Using MSSQL Query
Posted: Tue May 03, 2016 2:57 am
by azam101
I have been trying with both domain and local accounts.
Re: Using MSSQL Query
Posted: Tue May 03, 2016 10:25 am
by tgriep
Can you login as root to the XI server and try to run a query like the example below and see if that works for you?
Code: Select all
/usr/local/nagios/libexec/check_mssql -H xxx.xxx.xxx.xxx -U 'username' -P 'password' -I 'instance' --database master -q "select count(*) from sys.sysperfinfo"
Replace xxx.xxx.xxx.xx with the IP address of the MSSQL server and also the username, password and instance name.
Can you login to the MSSQL server and see what the errors are?
Re: Using MSSQL Query
Posted: Tue May 10, 2016 3:37 am
by azam101
Hi
The Query seems to run now and connects to the database fine, no errors.
But Im not getting any alerts, i change the expected results in the query to something so that is should alert.
Re: Using MSSQL Query
Posted: Tue May 10, 2016 9:30 am
by azam101
Hi
I have got it to work now, think it was just the queries I was running.