Issue with SQL scripts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mistawac
Posts: 3
Joined: Tue Dec 04, 2012 2:21 pm

Issue with SQL scripts

Post by mistawac »

I'm having some issues getting SQL monitoring setup. To start, it won't connect. I don't know if this is because every time I enter my account name with domain creds in front of it, or if I simply cannot connect. Our server allows only Windows Auth and my user account is set to DBReader, which I assume is plenty of rights to read statistics from the server. Whenever I enter my domain credentials in as such:

DOM\Username

..and click Test Check Command, they appear in the code as:

DOM\\Username

which I'm guessing is why I can't pull any SQL info. Ideas on how to remedy this?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Issue with SQL scripts

Post by lmiltchev »

What is the plugin that you are using? Can you show the command that you are running from the command line and the output of it? (You can hide sensitive data).

I suspect that this will only work with SQL server credentials, not Windows domain credentials.

You can see the usage of the plugin by running the "-h" flag:

Code: Select all

cd /usr/local/nagios/libexec
./check_<whatever> -h
Be sure to check out our Knowledgebase for helpful articles and solutions!
mistawac
Posts: 3
Joined: Tue Dec 04, 2012 2:21 pm

Re: Issue with SQL scripts

Post by mistawac »

Here's the code:

./check_mssql_database.py -H '172.15.12.7' -U 'DOM\\username' -P 'dom_pass' -T 'database_name' -I MSSQLSERVER --time2connect --warning 1 --critical 5

I think you're correct with the inability to login with windows domain creds. I used the help option and it says "Specify MSSQL username"

Is there any way around this? We have SQL auth turned off.
mistawac
Posts: 3
Joined: Tue Dec 04, 2012 2:21 pm

Re: Issue with SQL scripts

Post by mistawac »

Here's the check:

./usr/local/nagios/libexec/check_mssql -H '172.17.16.63' -U 'DOM\user' -P 'password' -I MSSQLSERVER

And I cannot connect. So far, from what I'm reading, everyone is saying that this script cannot pass Windows Auth to SQL.

New question:
Is there a way (any way at all) to pass Windows Auth creds (AD) through this SQL script? We only use Windows Auth on our SQL setup and won't open SQL Auth for a single monitoring solution. I refuse to believe that there is no way to do this...
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Issue with SQL scripts

Post by scottwilkerson »

Unfortunately at this time the plugin only does SQL authentication and cannot use Windows auth.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked