Page 1 of 4

MSSQL Database Wizard not working

Posted: Mon Dec 19, 2011 11:58 am
by ordwaycenter
Hi,

I ran the MSSQL Database wizard and all my services have a status of "null". I tried running ./check_mssql_database.py from the command line and all I can get is "Unable to access SQL Server". I've tried variations of username with [email protected] and domain\username, etc. I'm not sure how I would put my specific servername in there as MSSQL has it as "SERVER\SQLNAME". Would the host be IP.ADDRESS\SQLNAME or would I put it with the table as SQLNAME\TABLE? The error message is not very helpful in telling me what's wrong.

Thanks,
Dumont

Re: MSSQL Database Wizard not working

Posted: Mon Dec 19, 2011 12:15 pm
by scottwilkerson
Dumont,

I believe the instructions for that particular plugin are found here:
http://exchange.nagios.org/directory/Pl ... ts/details

The server is specified with the -H parameter

Re: MSSQL Database Wizard not working

Posted: Mon Dec 19, 2011 12:22 pm
by ordwaycenter
Thanks for the reply. I found the right terminology for what I'm talking about. It's the server "instance". Where do you put the instance name?

Dumont

Re: MSSQL Database Wizard not working

Posted: Mon Dec 19, 2011 1:38 pm
by scottwilkerson
Dumont,

I believe the instance name goes in the -T flag

Can you give that a try?

Re: MSSQL Database Wizard not working

Posted: Mon Dec 19, 2011 2:26 pm
by ordwaycenter
-T is the table, which is different from the Instance.

Re: MSSQL Database Wizard not working

Posted: Mon Dec 19, 2011 3:18 pm
by scottwilkerson
While is is marked table in the usage, it refer's to the database.

When running the wizard, on the first page it asks for the database which defaults to master.
This populates the -T arg.

Also, going back to your beginning question, you ran the MSSQL Database wizard, the server IP should go in the Address field right on the first page, along with the mssql username, password and database name to monitor.

Re: MSSQL Database Wizard not working

Posted: Mon Dec 19, 2011 3:30 pm
by ordwaycenter
There's three things here in the equation, but Nagios only has a spot for two of them.

Host - yes
Instance - nope
Database - yes

When I login to the SQL management on my server, I have to choose SERVERNAME\INSTANCE in addition to putting in my username and password. Then inside the instance, I have a production, staging, and testing database. Nagios has no place to put in the INSTANCE name. The script itself (running from the command line) has no place for the "instance" either.

Thanks,
Dumont

Re: MSSQL Database Wizard not working

Posted: Mon Dec 19, 2011 3:33 pm
by scottwilkerson
Here's the command we want to try:

Code: Select all

cd /usr/local/nagios/libexec
./check_mssql_database.py -H IP_ADDRESS -U MSSQL_USER -P MSSQL_PASS -T master --time2connect
Obviously changing IP_ADDRESS, MSSQL_USER and MSSQL_PASS to those that apply for your MSSQL server.

If this succeeds, let's change master to be the name of the database you want to monitor.

Re: MSSQL Database Wizard not working

Posted: Mon Dec 19, 2011 3:35 pm
by scottwilkerson
ordwaycenter wrote: Host - yes
Instance - nope
Database - yes
When you say instance, are you running multiple MSSQL servers on multiple ports?

The check makes a call to an host on the default port of 1433 or you can specify a different port with the -p flag

Re: MSSQL Database Wizard not working

Posted: Mon Dec 19, 2011 3:40 pm
by ordwaycenter
That's what I was already doing. It says "Unable to access SQL Server".

As far as multiple servers, it's really just that one. I don't know why it had to be set up with an instance...I didn't set it up. Nevertheless, there's just the one instance. But there's nowhere to give the script the name of the instance.

Thanks,
Dumont