Upgrade linux & can't connect MS-SQL anymore

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
softcon
Posts: 9
Joined: Wed Nov 02, 2011 4:33 am

Re: Upgrade linux & can't connect MS-SQL anymore

Post by softcon »

I can connect with tsql, but I can't with check_mssql_health

Code: Select all

# tsql -H 192.168.0.252 -p 1854 -U <user> -P <pass> 
locale is "hu_HU.UTF-8"
locale charset is "UTF-8"
1> select name from master.dbo.sysdatabases;
2> go
name
master
tempdb
model
msdb
ESETRADB
(5 rows affected)

Code: Select all

#./check_mssql_health --hostname 192.168.0.252 --port 1854 --username <user> --password <pass> --mode list-databases
CRITICAL - cannot connect to 192.168.0.252. DBI connect(';host=192.168.0.252;port=1854','nagioscheck',...) failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (44)
Server , database
Message String: Server name not found in configuration files.
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (45)
Server , database
Message String: Unknown host machine name.
 at ./check_mssql_health line 2175

Code: Select all

# export
declare -x TDSVER="8.0"
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Upgrade linux & can't connect MS-SQL anymore

Post by mguthrie »

What distro of Linux and version are you running? Some of the mssql packages have changed in recent releases, is this a migrated install of XI? How did you go about the upgrade?
softcon
Posts: 9
Joined: Wed Nov 02, 2011 4:33 am

Re: Upgrade linux & can't connect MS-SQL anymore

Post by softcon »

What distro of Linux and version are you running?
x64

Code: Select all

# cat /proc/version
Linux version 2.6.18-274.12.1.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)) #1 SMP Tue Nov 29 13:37:46 EST 2011
#  cat /etc/redhat-release
CentOS release 5.7 (Final)
How did you go about the upgrade?
"Yum update" or "yum upgrade" never mind! Both of that made corrupt something for "check_mssql_health".
..is this a migrated install of XI?
I don't understand, what do you think. :(
I've installed XI from source and upgrade it regularly.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Upgrade linux & can't connect MS-SQL anymore

Post by mguthrie »

That plugin requires the perl DBD Sybase package, can you check to make sure that is still installed.

Code: Select all

yum list installed | grep DBD
softcon
Posts: 9
Joined: Wed Nov 02, 2011 4:33 am

Re: Upgrade linux & can't connect MS-SQL anymore

Post by softcon »

Code: Select all

# yum list installed | grep DBD
perl-DBD-MySQL.x86_64                    3.0007-2.el5                  installed
perl-DBD-ODBC.x86_64                     1.23-1.el5.rf                 installed
perl-DBD-Sybase.x86_64                   1.10-1.el5.rf                 installed
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Upgrade linux & can't connect MS-SQL anymore

Post by nscott »

Do you have your /etc/freetds.conf configured at all? If you don't I assume you didn't have to do it in the past. However, I was reading the plugins comments and found this one:

Code: Select all

I can’t succeed in using this plugin. I have this error :
[root@helios libexec]# ./check_mssql_health –hostname CPTA-PROD-SQL –mode connection-time –username=SA –password=CPTAPROD CRITICAL – cannot connect to CPTA-PROD-SQL. DBI connect(‘;host=CPTA-PROD-SQL;port=1433′,’SA’,…) failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (41) Server , database Message String: Server is unavailable or does not exist.
Which looks very similar to what you're getting. This is the response from the developer:

Code: Select all

Configure /etc/freetds.conf and try it with –server. Also try tsql.
So a direct fix would be configuring the freetds.conf. However, and the reason you're asking is why it was messed up after the upgrade. It might be some dependency was moved in the Perl dependencies. Perhaps the upgrade moved some of the perl modules or config files around which is what has it looking for the freetds.conf now.
Nicholas Scott
Former Nagios employee
softcon
Posts: 9
Joined: Wed Nov 02, 2011 4:33 am

Re: Upgrade linux & can't connect MS-SQL anymore

Post by softcon »

nscott wrote:

Code: Select all

Configure /etc/freetds.conf and try it with –server. Also try tsql.
It works, thanks!
Locked