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

database-*file-auto-growths not working #26

Open ltjessem opened 7 years ago

ltjessem commented 7 years ago

It's reporting 0 regardless of autogrowth events happening. Here's an example using database-logfile-auto-growths, tempdb has had 11 log file growth events in the time period, the output is showing 0, but you can see the 11 count in the debugging output:

Thu Dec  8 10:48:44 2016: SQL:
 SELECT @@VERSION 
ARGS:
$VAR1 = [];

Thu Dec  8 10:48:44 2016: RESULT:
$VAR1 = [
          'Microsoft SQL Server 2014 (SP2-CU2-GDR) (KB3194718) - 12.0.5532.0 (X64) 
    Oct  5 2016 20:28:25 
    Copyright (c) Microsoft Corporation
    Standard Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)
'
        ];

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::DBI::override_opt

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::DBI::check_messages

Thu Dec  8 10:48:44 2016: SQL:
 SELECT SYSTEM_USER 
ARGS:
$VAR1 = [];

Thu Dec  8 10:48:44 2016: RESULT:
$VAR1 = [
          'adm\\nagios'
        ];

Thu Dec  8 10:48:44 2016: SQL:
 SELECT @@SERVICENAME 
ARGS:
$VAR1 = [];

Thu Dec  8 10:48:44 2016: RESULT:
$VAR1 = [
          'MSSQLSERVER'
        ];

Thu Dec  8 10:48:44 2016: SQL:
 SELECT CAST(COALESCE(SERVERPROPERTY('IsHadrEnabled'), 0) as int) 
ARGS:
$VAR1 = [];

Thu Dec  8 10:48:44 2016: RESULT:
$VAR1 = [
          0
        ];

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::DBI::analyze_and_check_database_subsystem

Thu Dec  8 10:48:44 2016: SQL:

        SELECT name FROM master.sys.databases

ARGS:
$VAR1 = [];

Thu Dec  8 10:48:44 2016: RESULT:
$VAR1 = [
          [
            'master'
          ],
          [
            'tempdb'
          ],
          [
            'model'
          ],
          [
            'msdb'
          ],
          [
            'DB_service'
          ],
          [
            'DB_service_test2'
          ]
        ];

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::Component::DatabaseSubsystem::Database::override_opt

Thu Dec  8 10:48:44 2016: SQL:

          DECLARE @path NVARCHAR(1000)
          SELECT
              @path = Substring(PATH, 1, Len(PATH) - Charindex('\', Reverse(PATH))) + '\log.trc'
          FROM
              sys.traces
          WHERE
              id = 1
          SELECT
              databasename, COUNT(*)
          FROM
              ::fn_trace_gettable(@path, 0)
          INNER JOIN
              sys.trace_events e
          ON
              eventclass = trace_event_id
          -- INNER JOIN
          --    sys.trace_categories AS cat
          -- ON
          --     e.category_id = cat.category_id
          WHERE
              e.name IN( 'Log File Auto Grow' ) AND datediff(Minute, starttime, current_timestamp) < ?
          GROUP BY
              databasename

ARGS:
$VAR1 = [
          '10000'
        ];

Thu Dec  8 10:48:44 2016: RESULT:
$VAR1 = [
          [
            'tempdb',
            11
          ]
        ];

Thu Dec  8 10:48:44 2016: $self->{components}->{database_subsystem} = Classes::MSSQL::Component::DatabaseSubsystem->new()
Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::DBI::check_database_subsystem

Thu Dec  8 10:48:44 2016: AUTOLOAD Monitoring::GLPlugin::DB::SUPER::set_thresholds

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::Component::DatabaseSubsystem::Database::check_thresholds

Thu Dec  8 10:48:44 2016: AUTOLOAD Monitoring::GLPlugin::DB::SUPER::set_thresholds

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::Component::DatabaseSubsystem::Database::check_thresholds

Thu Dec  8 10:48:44 2016: AUTOLOAD Monitoring::GLPlugin::DB::SUPER::set_thresholds

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::Component::DatabaseSubsystem::Database::check_thresholds

Thu Dec  8 10:48:44 2016: AUTOLOAD Monitoring::GLPlugin::DB::SUPER::set_thresholds

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::Component::DatabaseSubsystem::Database::check_thresholds

Thu Dec  8 10:48:44 2016: AUTOLOAD Monitoring::GLPlugin::DB::SUPER::set_thresholds

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::Component::DatabaseSubsystem::Database::check_thresholds

Thu Dec  8 10:48:44 2016: AUTOLOAD Monitoring::GLPlugin::DB::SUPER::set_thresholds

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::Component::DatabaseSubsystem::Database::check_thresholds

[DATABASESUBSYSTEM]
info: checking databases

[DATABASE]
autogrowshrink: 0
full_name: tempdb
growshrinkinterval: 10000
name: tempdb

[DATABASE]
autogrowshrink: 0
full_name: msdb
growshrinkinterval: 10000
name: msdb

[DATABASE]
autogrowshrink: 0
full_name: model
growshrinkinterval: 10000
name: model

[DATABASE]
autogrowshrink: 0
full_name: master
growshrinkinterval: 10000
name: master

[DATABASE]
autogrowshrink: 0
full_name: DB_service_test2
growshrinkinterval: 10000
name: DB_service_test2

[DATABASE]
autogrowshrink: 0
full_name: DB_service
growshrinkinterval: 10000
name: DB_service

[DATABASE]
count: 11
full_name: tempdb
name: tempdb

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::DBI::reduce_messages_short

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::DBI::check_messages

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::DBI::check_messages

Thu Dec  8 10:48:44 2016: AUTOLOAD Classes::MSSQL::DBI::nagios_exit

OK - tempdb had 0 log file auto grow events in the last 10000 minutes, msdb had 0 log file auto grow events in the last 10000 minutes, model had 0 log file auto grow events in the last 10000 minutes, master had 0 log file auto grow events in the last 10000 minutes, DB_service_test2 had 0 log file auto grow events in the last 10000 minutes, DB_service had 0 log file auto grow events in the last 10000 minutes
checking databases
Thu Dec  8 10:48:44 2016: try to clean up command and result files
Thu Dec  8 10:48:44 2016: try to clean up command and result files
Thu Dec  8 10:48:44 2016: try to clean up command and result files
Thu Dec  8 10:48:44 2016: try to clean up command and result files
Thu Dec  8 10:48:44 2016: try to clean up command and result files
Thu Dec  8 10:48:44 2016: try to clean up command and result files
Thu Dec  8 10:48:44 2016: try to clean up command and result files
Thu Dec  8 10:48:44 2016: try to clean up command and result files
Thu Dec  8 10:48:44 2016: try to clean up command and result files