DB-Lib error message 20009, severity 9

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

DB-Lib error message 20009, severity 9

Post by dlukinski »

DB-Lib error message 20009, severity 9 error after using SQL DB instance monitoring wizard to configure dozen of instance checks.
It there a way to test what exactly is wrong with accessing SQL instance? (read some of the older cases, but errors were not same)
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: DB-Lib error message 20009, severity 9

Post by rkennedy »

Can you try running the following commands and output the result + /tmp/freetds.log?

Code: Select all

export TDSDUMP=/tmp/freetds.log
tsql -H myip -p 1433 -U myuser
(replace myip / myuser as needed, and enter the password when prompted)
Former Nagios Employee
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: DB-Lib error message 20009, severity 9

Post by dlukinski »

rkennedy wrote:Can you try running the following commands and output the result + /tmp/freetds.log?

Code: Select all

export TDSDUMP=/tmp/freetds.log
tsql -H myip -p 1433 -U myuser
(replace myip / myuser as needed, and enter the password when prompted)
Here are the results:

# tsql -H 10.z.z.z -p 1438 -U 'XXX\yyyyyyyy'
Password:
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: DB-Lib error message 20009, severity 9

Post by scottwilkerson »

Connection REQUIRES sqlserver account, and will not work with a windows user account
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: DB-Lib error message 20009, severity 9

Post by dlukinski »

scottwilkerson wrote:Connection REQUIRES sqlserver account, and will not work with a windows user account
Ah-a / did not realize that.
Let me try in coming days, please keep this ticket open if possible

Thank you
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: DB-Lib error message 20009, severity 9

Post by hsmith »

We can leave this open for now, but please do not reply until you have additional information. We use a dashboard here at Nagios, and if an employee has not responded to something it shows up. There's currently not a way to differentiate between "pending" and "needs help"(that I am aware of:)). Let us know when you have more information.

Thanks!
Former Nagios Employee.
me.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: DB-Lib error message 20009, severity 9

Post by dlukinski »

hsmith wrote:We can leave this open for now, but please do not reply until you have additional information. We use a dashboard here at Nagios, and if an employee has not responded to something it shows up. There's currently not a way to differentiate between "pending" and "needs help"(that I am aware of:)). Let us know when you have more information.

Thanks!
We've changes to local SQL authentication, but no luck still:

Unable to connect: Adaptive Server is unavailable or does not exist
Net-Lib error during Connection refused Error 111 - Connection refused
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: DB-Lib error message 20009, severity 9

Post by rkennedy »

Does the Nagios server IP have permission to access SQL?

Code: Select all

nmap <serverip>
Does port 1433 appearopen?
Former Nagios Employee
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: DB-Lib error message 20009, severity 9

Post by dlukinski »

rkennedy wrote:Does the Nagios server IP have permission to access SQL?

Code: Select all

nmap <serverip>
Does port 1433 appearopen?
Actually this would be 1438 (in that case).
I specified instance instead, maybe it is trying to find instance on the default port and failing?

- how could I change that?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: DB-Lib error message 20009, severity 9

Post by lmiltchev »

Can you show us the actual command that you are running from the command line along with the output of it? Hide sensitive info.

Example:

Code: Select all

/usr/local/nagios/libexec/check_mssql_server.py -H x.x.x.x -U 'username' -P 'password' -I 'instancename' --time2connect --warning 1 --critical 5
OK: Time to connect was 0.00740003585815s|time=0.00740003585815s;1;5;;
You can use either port or an instance name but not both. Also, check the permissions of your user. I believe, the user needs server level permissions of "Connect SQL" and "View server state." Also needs database level permissions of "Connect" and "Select". To check these permissions, the user have to log in the MSSQL server, and run the following queries:

Code: Select all

SELECT * FROM fn_my_permissions(null, 'DATABASE')
SELECT * FROM fn_my_permissions(null, 'SERVER')
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked