You can now find a plugin called check_mssql.sh in the contrib/ subdirectory of the latest plugin distribution that will check MS SQL servers.
Up until SQL Server 7, Microsoft officially supported Sybase client software. So you could download the Sybase client, and connect to MS SQL. With TDS version 8.0 (and legacy support for version 7.0) in SQL 2000, compatibility with Sybase client was broken. However, you can use the Freetds libraries instead.
So here's what I've done to have a way to connect to both SQL 7 and SQL 2000:
- Download and install freetds from http://www.freetds.org.
- Download and install sqsh from http://www.sqsh.org.
- export SYBASE=/usr/local/freetds (or where ever your freetds is installed)
Now you can use sqsh to connect to your MS SQL:
sqsh -S servername -U username
You're now ready to script your own plugins based on the output you get from your queries. Works great.
If someone is really interested to write a Perl plugin, you can find more info on http://www.whirlycott.com/phil/dbdsybase/ on how to use a Perl module for this (DBD::Sybase). This paper is written for SQL 7and the Sybase libraries. But with the info I gave above, it should be possible to use SQL 2000 with the freetds libraries as well.
A Third Option:
Use the plugin "check_mssql_health" to monitor MS
SQL Servers. Unlike other plugins, it not only checks for a
successful connection, but gets > 20 useful metrics (some of the most popular found in several sql server tuning and monitoring howtos). You can download this plugin from http://www.consol.de/opensource/nagios/check-mssql-health .