Using MSSQL Query

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
azam101
Posts: 50
Joined: Fri Mar 18, 2016 6:01 am

Using MSSQL Query

Post 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?
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Using MSSQL Query

Post 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]
Former Nagios Employee
azam101
Posts: 50
Joined: Fri Mar 18, 2016 6:01 am

Re: Using MSSQL Query

Post by azam101 »

Ran the above in the cli and got the same error.

the ran nmap with sql server ip address
Got the message
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Using MSSQL Query

Post 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.
Former Nagios Employee
azam101
Posts: 50
Joined: Fri Mar 18, 2016 6:01 am

Re: Using MSSQL Query

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Using MSSQL Query

Post 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

Code: Select all

domain/username
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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
azam101
Posts: 50
Joined: Fri Mar 18, 2016 6:01 am

Re: Using MSSQL Query

Post by azam101 »

I have been trying with both domain and local accounts.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Using MSSQL Query

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
azam101
Posts: 50
Joined: Fri Mar 18, 2016 6:01 am

Re: Using MSSQL Query

Post 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.
azam101
Posts: 50
Joined: Fri Mar 18, 2016 6:01 am

Re: Using MSSQL Query

Post by azam101 »

Hi

I have got it to work now, think it was just the queries I was running.
Locked