Number of ERRORLOG files


Job details

Name: Number of ERRORLOG files
Platform: Sqlserver
Category: Security
Premium package: Security and compliance package
Description: Checks the number of error log files created on the operating file system.
Long description: Checks the number of error log files created on the operating file system. The SQL Server error log contains important information about major server events. Retaining more error logs helps prevent loss from frequent recycling.
Version: 1.22
Default schedule: 28 1 1 *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2005′ & hasengine=‘YES’ & eng_inst_priv = 0 & (engine_edition = ‘Microsoft SQL Server’ engine_edition = ‘Azure SQL Managed Instance’)]

Parameters

Name Default value Description
return status 1 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when the number of error log files (created on the operating file system) is less than “minimum error log files” parameter value.
history threshold 365 The maximum number of days to keep statistics for in the historic tables.
minimum error log files 7 The number of error log files (created on the operating file system).

Job Summary

dir /s/b/a-d "path_to_error_log*"

Details and Operations

Implementation Steps

The procedure involves:

Dependencies

These are necessary for storing current and historical data regarding error log files and other helper outputs during the procedure execution.

Output Presentation

This information is crucial for auditing and monitoring practices ensuring system integrity and compliance.

Compliance and Security