lausser / check_mssql_health

Wenn du dich für Plugins (oder OMD oder allgemein Monitoring) interessierst oder von deiner Installation erzählen willst...die Tradition der deutschsprachigen Monitoring-Workshops wird wiederbelebt: https://discord.gg/jDfPZ63FcJ A plugin, which checks various parameters of Microsoft SQL database servers.
http://labs.consol.de/nagios/check_mssql_health
GNU General Public License v2.0
39 stars 28 forks source link

Fix mode backup-age on SQL Server 2000 #3

Closed julthomas closed 9 years ago

julthomas commented 11 years ago

SQL query used in mode backup-age does not work in SQL Server 2000 (version 8.0). On this version, column recovery_model does not exist in table master.dbo.sysdatabases.

Mon Jun 24 14:21:01 2013: bumm DBD::Sybase::st execute failed: \ Server message number=207 severity=16 state=3 line=2 \ server=mssql-2b text=Invalid column name 'recovery_model'. \ at /tmp/check_mssql_health line 3158.

CRITICAL - unable to aquire database info

This patch is based on the following post: http://www.sqlservercentral.com/Forums/Topic1182788-5-1.aspx#bm1182799

In SQL 2000, the recovery model is not displayed in the system catalogue like it is in 2005. However, thanks to the magic of functions you can retrieve it by using the following script.

select name, databasepropertyex(name, 'Recovery') as RecoveryModel from master.dbo.sysdatabases order by name