MS-SQL Used space in file

Purpose

The disk space allocated to a data file is logically divided into pages and extents

Being able to monitor database files used space evolution becomes then important to stablish a good database storage strategy.

Monitor features include :

Monitoring of every SQL Server file type (Data - row -, Log ...) and specific file name

Able to alert if used space in a file (of any type) has reached a given threshold expressed in MB or percenatage

Configuration hints

Surveillance table:

This is a table of rules that you can use to configure and customize the configuration.

Each line of the table will define a rule of monitoring.

You can combine multiple rules to cover different cases.

Within a rule, you can configure the SQL Server file type you want to monitor, specific file name(s) using regular expressions, a used space in file threshold expressed in MB or percentage

File type
Select the specific SQL server file type you want to monitor , select “Any” to monitor used space in any kind of file, select “Aggregate if you need to monitor the total used space of all database files

File name:
You can set a file specific rule by setting its name in the File name filter field. Use * to match any file name, or use regular expressions.

Used space in file:
Use the multi-threshold syntax to set multiple threshold/severity associations: G2W:10 W2M:60 M2C:90 (Green To Warning, Warning To Major, etc...), expressed in MB or percentage An alarm of the corresponding severity will be sent if used sace in file is over threshold. Set 0 in the field if unused

Notice that values retrieved in MB will be rounded

Surveillance table

Parameter	Description
Active	Use this field to activate or deactivate a line of configuration.
File type	Select the specific SQL Server type of file you want to monitor Select “Any” so to monitor every type of file Select “Aggregate” if you want to monitor the used space of all database files (aggregated)
File name	A filter to match only a specific SQL Server file name, you can use regular expression, white or black list
Used space in file	The threshold for the used space in file You can use the multi threshold syntax (i.e. : G2W:10 W2C:40) . Values can be expressed in MB or Percentage
Unit	Represents the used space in file unit of measure
Auto clear	If checked, the alarm will be cleared as soon as the alarm condition is not met anymore.
Alarm tag	This field allows to add custom text within the alarm message. %MSG% variable will contain the actual generated message and can be used such as: “my_prefix %MSG% my_suffix”. By default, tag will be used as prefix.
Alarm	If checked, this line of surveillance will be used for alarm generation.
Metric	If checked, this line of surveillance will be used for metric generation.
Report	If checked, this line of surveillance will used for showing threshold and severity in the daily report

Examples

Active	File type	File name	Used space in file	Unit	Auto clear	Alarm tag	Alarm	Metric	Report
true	Data	DBDATA	G2W:60 W2M:85	Percentage	true	true	true	true

Effect : For this rule, only Data - rows - type files will be monitored (File Type set to : “Data”).

All Data type files containing the string “DBDATA” on their file names will be taken into account. A WARNING alarm is sent if used space in file is 60% or more, a MAJOR alarm if 85% or more.

Generated metrics

metricId	metricUnit	metricTarget	metricDescription
MSSQL_DATABASE_AGG_USED_SPACE_IN_FILE_MB	MB	AGGREGATE	The addition of all retrieved SQL Server files used spaces - aggregated - of a given database, expressed in MB
MSSQL_DATABASE_AGG_USED_SPACE_IN_FILE_PERCENT	Percentage	AGGREGATE	The addition of all retrieved SQL Server files used spaces - aggregated - of a given database, expressed in percentage
MSSQL_DATABASE_USED_SPACE_IN_FILE_MB	MB	[File type] - [File name]	Retrieved SQL Server file used space, expressed in MB
MSSQL_DATABASE_USED_SPACE_IN_FILE_PERCENT	Percentage	[File type] - [File name]	Retrieved SQL Server file used space, expressed in percentage