Monitoring MS SQLServer 2005 with Nagios

Need to monitor a SQLserver with Nagios? There’s check_mssql.sh in the latest nagios plugins’ contrib folder. This check command only works with SQLServer 7 and 2000, though.

To make it work with SQLServer 2005, you only need to change 1 line in the script. Find this line:

echo -e "select loginame from sysprocesses where spid > $spid ...

and change it to

echo -e "select loginame from sys.sysprocesses where spid > $spid ...

Now, if your freetds installation (the actual SQLServer client that does all the magic) supports SQLServer 2005, you can run the script as though you’re checking a SQLServer 2000 installation.

Tags: ,

2 Responses to “Monitoring MS SQLServer 2005 with Nagios”

  1. Dan Ovidiu says:

    Hi, a new plugin came out this week (one of a whole family of database-monitoring-plugins). http://www.consol.de/opensource/nagios/check-mssql-health
    It is really feature-rich.
    Dan

  2. sql training says:

    impressive technical knowledge. It just helped me today. thanks.

Leave a Reply