Stumped - check_mssql_server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Stumped - check_mssql_server

Post by Pilly170 »

Hi,

I am stumped using check_mssql_server. Everything I do I get

CRITICAL:Unable to access SQL Server.

I've tried various flavours of

/usr/local/nagios/libexec/check_mssql_database.py -H "10.4.2.20" -U "sa" -P "password" -T "databasename" -p 1433 -I "LIVE" --datasize

on the console/commandline.

Ive tried ' around fields, Ive tried dynamic ports, variations on the instance. Some with instance, sometimes without. But nothing.


Can someone point me in the right direction?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Stumped - check_mssql_server

Post by scottwilkerson »

If the DB is using instances you would need to remove the port

Code: Select all

/usr/local/nagios/libexec/check_mssql_database.py -H "10.4.2.20" -U "sa" -P "password" -T "databasename" -I "LIVE" --datasize
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Stumped - check_mssql_server

Post by Pilly170 »

I got via putty session

/usr/local/nagios/libexec/check_mssql_database.py -H "10.4.2.20" -U 'sa' -P 'password' -T 'SQLdmNewsRepository' -I LIVE --activetrans --warning 10 --critical 20
CRITICAL:Unable to access SQL Server.


(Service Check Timed Out) via the GUI... created from the MSSQL config wizard.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Stumped - check_mssql_server

Post by slansing »

Are you sure that the following are valid beyond a doubt?:

Username is actually

Code: Select all

sa
Password is actually

Code: Select all

password
The table name is

Code: Select all

SQLdmNewsRepository
And that lastly you need to have a valid instance name, and it's name is

Code: Select all

LIVE
The checks are case sensitive so be sure of that as well.
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Stumped - check_mssql_server

Post by Pilly170 »

Yes, the username, password and database are correct as they are all written down on our Keepass Server Passwords List when we create the servers.

The instance is "live", I got the instance name using the SQL query on the server
select @@ServerName
Resulted in SQL3\Live (server\instance)


I've also tried
MSSQL$LIVE
MSSQLSERVER$LIVE
SQL3\LIVE
LIVE


* This is a clustered SQL server by the way.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Stumped - check_mssql_server

Post by slansing »

If "Live" is the actual instance name, I believe it is case sensitive, have you tried it with the correct case set for each character?
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Stumped - check_mssql_server

Post by Pilly170 »

Just checked.
Still no luck with this.

Ive also tried creating a new user, assigned db reader role to the database. still says
CRITICAL:Unable to access SQL Server.

I think its a permissions issue, is there anyway I can easily check?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Stumped - check_mssql_server

Post by abrist »

Check the remote database systems logs. Do you see any "connection refused", "timeout" or access denied type errors?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Stumped - check_mssql_server

Post by lmiltchev »

If you are sure that the username and the password are correct, you need to check the firewall settings next. Make sure port 1433 (unless you use a different one) is open. Can you telnet to port 1433 from your nagios server?

Code: Select all

telnet <mssql server IP> 1433
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Stumped - check_mssql_server

Post by Pilly170 »

Used putty, set IP and port to 1433

Screen went black, no text appeared
Locked