Page 2 of 2

Re: check mssql health

Posted: Thu Feb 19, 2015 3:51 am
by braindope
Hi tgriep,

Here below the content of my freetds.conf

# server specific section
[global]
# TDS protocol version
; tds version = 8.0

# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug flags = 0xffff

# Command and connection timeouts
; timeout = 10
; connect timeout = 10

# If you get out-of-memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# Try setting 'text size' to a more reasonable limit
text size = 64512

# A typical Sybase server
[egServer50]
host = symachine.domain.com
port = 5000
tds version = 5.0

# A typical Microsoft server
[egServer70]
host = ntmachine.domain.com
port = 1433
tds version = 7.0

[sqlhost1]
server = <first server that i successfully run the check>
port = 1433
tds version = 8.0

[sqlhost2]
server = <second server that i want to add>
port = 30127
tds version = 8.0

[sqlhost3]
server = <third server that i want to add>
port = 30127
tds version = 8.0




below is the sample commands

define command{
command_name check_sqlhealth_Server2_free-list-stalls
command_line $USER1$/check_mssql_health --server xx.xx.xx.xx --username username --password password --port 30127 --name server2 --mode free-list-stalls

Re: check mssql health

Posted: Thu Feb 19, 2015 1:11 pm
by tgriep
For the second server, try changing the check command to the following.
Change it from

Code: Select all

command_line $USER1$/check_mssql_health --server xx.xx.xx.xx --username username --password password --port 30127 --name server2 --mode free-list-stalls
to

Code: Select all

command_line $USER1$/check_mssql_health --server xx.xx.xx.xx --username username --password password --port 30127 --name sqlhost2 --mode free-list-stalls
Run it and post back any errors that you receive.

Re: check mssql health

Posted: Mon Feb 23, 2015 7:34 pm
by braindope
Hi tgriep,

I did change my commands as per your advise. Please my error below.

CRITICAL - cannot connect to <server IP>. DBI connect(':server=<server IP>','<server username>',...) failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (41)
Server <server IP>, database
Message String: Unable to connect: Adaptive Server is unavailable or does not exist
at /usr/local/nagios/libexec/check_mssql_health line 1981

Re: check mssql health

Posted: Mon Feb 23, 2015 11:12 pm
by braindope
Hi Everyone,

I've successfully add my two additional server to be check, i just change my freetds.conf as seen below, since my first server is working in that configuration i didn't change it.

[sqlhost1]
server = <first server IP>
port = 1433
tds version = 8.0

[<second server IP>]
host = <second server IP>
port = 30127
tds version = 8.0

[<third server IP>]
host = <third server IP>
port = 30127
tds version = 8.0

and here is my commands

command_line $USER1$/check_mssql_health --server <server IP> --username username --password password --port 30127 --name <server name> --mode free-list-stalls

Thank you all for the response it help me a lot :D :D :D :D :D :D :D :D