Page 1 of 1
Issue with SQL scripts
Posted: Tue Dec 04, 2012 2:27 pm
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?
Re: Issue with SQL scripts
Posted: Tue Dec 04, 2012 4:29 pm
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
Re: Issue with SQL scripts
Posted: Wed Dec 05, 2012 7:17 am
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.
Re: Issue with SQL scripts
Posted: Wed Dec 05, 2012 8:55 am
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...
Re: Issue with SQL scripts
Posted: Wed Dec 05, 2012 10:23 am
by scottwilkerson
Unfortunately at this time the plugin only does SQL authentication and cannot use Windows auth.