check_mssql plug in fails with MSSQL/DBLIB is not installed

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
mlecours
Posts: 4
Joined: Thu Feb 16, 2017 2:48 pm

check_mssql plug in fails with MSSQL/DBLIB is not installed

Post 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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

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

Post 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.
mlecours
Posts: 4
Joined: Thu Feb 16, 2017 2:48 pm

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

Post 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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

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

Post 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.
mlecours
Posts: 4
Joined: Thu Feb 16, 2017 2:48 pm

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

Post 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>'
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

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

Post 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.
Locked