Thursday, 19 March 2009

Querying Microsoft SQL Server from RHEL 4

I needed to monitor some tables on a Microsoft SQL Server from a RedHat 4 nagios server today so I decided to create a python script to plug into Nagios. I knew that pymssql worked well on Debian, but unfortunately it doesn't play well with RedHat 4 as the python installation is too old at version 2.3.4. With this version of python only an old version of pymssql would work, I had to modify the python c source for pymssql to get it working and in the process I also had to disable all of its date processing - not good. Surprisingly python 2.3.4 is the only version supported by RedHat for version 4 and version 5 of their OS but at least for rhel5 there is a [hopefully fully] working python-mssql on dag.wieers web site - note to self: try this after I've upgraded to rhel5.

Later I had a brainwave and decided to check freetds.org and found a whole bunch of utilities that can be used in shell scripts. Freetds is at the dag.wieers web site for rhel 4 & 5. Using them was a breeze (I only needed bsqldb) and the Nagios plugin was done. Great!

No comments:

Post a Comment