Page 1 of 1

check_mssql plug in fails with MSSQL/DBLIB is not installed

Posted: Fri Feb 24, 2017 2:07 pm
by mlecours
When I try to run the check_mssql plug in it fails with:

[nagios@nagios modules]$ check_mssql -S 10.21.50.131 -U nagios -P nagios
UNKNOWN: MSSQL/DBLIB support is not installed on this server. pdo_dblib must be usable.

I looked up pdo_dblib and it seems it's no longer provided with the mssql drivers (I'm php 7.0 on Centos 7) I found a note that it was part of FreeTDS. I downloaded and installed the latest FreeTDS but still get the error. I also can't see where it has installed any drivers with a name like pdo_dblib. Any suggestions?

I can connect to my mssql server just fine through sqlcmd and thought a php test page, just not with check_mssql.

Re: check_mssql plug in fails with MSSQL/DBLIB is not instal

Posted: Fri Feb 24, 2017 2:45 pm
by dwhitfield
I assume you are using https://exchange.nagios.org/directory/P ... ql/details ?

Have you looked at an of the other SQLServer plugins? https://exchange.nagios.org/directory/P ... /SQLServer

Some are written in different languages, so you might have better luck with the libraries. Also, I wonder if downgrading your PHP is an option.

Re: check_mssql plug in fails with MSSQL/DBLIB is not instal

Posted: Mon Feb 27, 2017 2:09 pm
by mlecours
Yes, I'm using the download from the Nagios plugins exchange. Downgrading php is not an option as the server has other uses. I picked check_mssql over the other plugins because the reviews said it was easy to install. If I can't get this resolved I may have to use one of the others.

Re: check_mssql plug in fails with MSSQL/DBLIB is not instal

Posted: Mon Feb 27, 2017 3:09 pm
by dwhitfield
https://exchange.nagios.org/directory/P ... ts/details uses python so you get around the Perl/CPAN issues, and around the PHP incompatibility you have. Please let us know if that doesn't work for you.

Re: check_mssql plug in fails with MSSQL/DBLIB is not instal

Posted: Tue Feb 28, 2017 10:40 am
by mlecours
I tried check_mssql_database.py. Per the instructions I installed freeTDS through yum, I installed pymssql with pip. I added the lines in the freetds.config file for port 1433 and set the tds version to 7.0. But I get the error when I try to run check_mssql_database as follows

[nagios@nagios ~]$ check_mssql_database.py -H 10.21.50.131 -U nagios -p nagios --time2connect
/usr/local/nagios/libexec/check_mssql_database.py: line 7: syntax error near unexpected token `newline'
/usr/local/nagios/libexec/check_mssql_database.py: line 7: `<!DOCTYPE html>'

Re: check_mssql plug in fails with MSSQL/DBLIB is not instal

Posted: Tue Feb 28, 2017 12:28 pm
by dwhitfield
What's the output of tail -10 /usr/local/nagios/libexec/check_mssql_database.py?

Looking at https://github.com/NagiosEnterprises/ch ... atabase.py, line 7 should be a comment. I suspect something got pasted into there accidentally, or we have a Windows newline issue (but why there and not earlier in the document is interesting). Did you download this on Windows and the move it to your Core machine?

wget https://raw.githubusercontent.com/Nagio ... atabase.py should download it to your Core server directly.