Zabbix监控 Windows SQL Server
时间:2022-03-15 06:45
Zabbix监控 Windows SQL Server
[TOC]
1. 模板来源
此模板来自如下模板的修改和翻译。因为原模板为葡萄牙语。
2. 模板使用
假如zabbix agent目录为D:\zabbix
确保zabbix agent配置文件D:\zabbix\etc\zabbix_agentd.conf
有此配置Include=D:\zabbix\etc\zabbix_agentd.conf.d\
自定义key文件D:\zabbix\etc\zabbix_agentd.conf.d\discovery.mssql.server.conf
内容:
# key of zabbix
UserParameter=discovery.mssql.databases,powershell.exe -noprofile -executionpolicy bypass -File D:\zabbix\scripts\discovery.mssql.server.ps1 JSONDB
UserParameter=discovery.mssql.jobs,powershell.exe -noprofile -executionpolicy bypass -File D:\zabbix\scripts\discovery.mssql.server.ps1 JSONJOB
UserParameter=discovery.mssql.data[*],powershell.exe -noprofile -executionpolicy bypass -File D:\zabbix\scripts\discovery.mssql.server.ps1 $1 "$2"
powershell脚本文件D:\zabbix\scripts\discovery.mssql.server.ps1
内容:
# parameter
Param(
[string]$select,
[string]$2
)
# Login SQLSERVER
$username = "username"
$password = "password"
# JSONDB
if ( $select -eq ‘JSONDB‘ )
{
$database = sqlcmd -d Master -U $username -P $password -h -1 -W -Q "set nocount on;SELECT name FROM master..sysdatabases"
$idx = 1
write-host "{"
write-host " `"data`":[`n"
foreach ($db in $database)
{
if ($idx -lt $database.Count)
{
$line= "{ `"{#MSSQLDBNAME}`" : `"" + $db + "`" },"
write-host $line
}
elseif ($idx -ge $database.Count)
{
$line= "{ `"{#MSSQLDBNAME}`" : `"" + $db + "`" }"
write-host $line
}
$idx++;
}
write-host
write-host " ]"
write-host "}"
}
# STATUS
if ( $select -eq ‘STATUS‘ )
{
sqlcmd -d Master -U $username -P $password -h -1 -W -Q "set nocount on;SELECT coalesce(max(state),7) from sys.databases where name = ‘$2‘"
}
# CONN
if ( $select -eq ‘CONN‘ )
{
sqlcmd -d Master -U $username -P $password -h -1 -W -Q "set nocount on;DECLARE @AllConnections TABLE(
SPID INT,
Status VARCHAR(MAX),
LOGIN VARCHAR(MAX),
HostName VARCHAR(MAX),
BlkBy VARCHAR(MAX),
DBName VARCHAR(MAX),
Command VARCHAR(MAX),
CPUTime INT,
DiskIO INT,
LastBatch VARCHAR(MAX),
ProgramName VARCHAR(MAX),
SPID_1 INT,
REQUESTID INT
)
INSERT INTO @AllConnections EXEC sp_who2
SELECT count(*) FROM @AllConnections WHERE DBName = ‘$2‘"
}
# JSONJOB
if ( $select -eq ‘JSONJOB‘ )
{
$jobname = sqlcmd -d Master -U $username -P $password -h -1 -W -Q "set nocount on;SELECT [name] FROM msdb.dbo.sysjobs"
$idx = 1
write-host "{"
write-host " `"data`":[`n"
foreach ($job in $jobname)
{
if ($idx -lt $jobname.Count)
{
$line= "{ `"{#MSSQLJOBNAME}`" : `"" + $job + "`" },"
write-host $line
}
elseif ($idx -ge $jobname.Count)
{
$line= "{ `"{#MSSQLJOBNAME}`" : `"" + $job + "`" }"
write-host $line
}
$idx++;
}
write-host
write-host " ]"
write-host "}"
}
# JOBSTATUS
if ( $select -eq ‘JOBSTATUS‘ )
{
sqlcmd -d Master -U $username -P $password -h -1 -W -Q "set nocount on;WITH last_hist_rec AS
(
SELECT ROW_NUMBER() OVER
(PARTITION BY job_id ORDER BY run_date DESC, run_time DESC) AS [RowNum]
, job_id
, run_date AS [last_run_date]
, run_time AS [last_run_time]
, CASE run_status
WHEN 0 THEN ‘0‘
WHEN 1 THEN ‘1‘
WHEN 2 THEN ‘2‘
WHEN 3 THEN ‘3‘
WHEN 4 THEN ‘4‘
END AS [status]
FROM msdb.dbo.sysjobhistory
)
SELECT jobs.name AS [job_name]
, hist.status
FROM msdb.dbo.sysjobs jobs
LEFT JOIN last_hist_rec hist ON hist.job_id = jobs.job_id
AND hist.RowNum = 1
WHERE jobs.name = ‘$2‘" | % {$_.substring($_.length-1) -replace ‘‘} | ForEach-Object {$_ -Replace "N", "5"}
}
# VERSION
if ( $select -eq ‘VERSION‘ )
{
sqlcmd -d Master -U $username -P $password -h -1 -W -Q "set nocount on;SELECT
SERVERPROPERTY ( ‘ProductVersion‘ ),
SERVERPROPERTY ( ‘Edition‘ ),
SERVERPROPERTY ( ‘ProductLevel‘ )"
}
注意
需要替换脚本中SQL Server的用户和密码;
用zabbix运行用户确认脚本运行正常(手动模拟zabbix运行);
模板xml文件(zabbix3.2版本)Template Windows LLD MSSQL.xml
内容:
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>3.2</version>
<date>2018-02-11T06:11:01Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
<template>
<template>Template Windows LLD MSSQL</template>
<name>Template Windows LLD MSSQL</name>
<description># Desenvolvido por Diego Cavalcante - 06/12/2017
# Monitoramento Windows SQLServer</description>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<applications>
<application>
<name>MSSQL General</name>
</application>
<application>
<name>MSSQL Jobs Status</name>
</application>
<application>
<name>MSSQL Memory</name>
</application>
<application>
<name>MSSQL Services</name>
</application>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<items>
<item>
<name>Version</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>discovery.mssql.data[version]</key>
<delay>86400</delay>
<history>15</history>
<trends>0</trends>
<status>0</status>
<value_type>1</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>Version of SQLServer.</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>MSSQL is running</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>net.tcp.port[,{$MSSQLPORT}]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL General</name>
</application>
</applications>
<valuemap>
<name>Service state</name>
</valuemap>
<logtimefmt/>
</item>
<item>
<name>Processor Time (%)</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\Process(sqlservr)\% Processor Time]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>%</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\Process(sqlservr)\% Processor Time]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Memory in Use</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\Process(sqlservr)\Private Bytes]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>B</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>Memory in Use
perf_counter[\Process(sqlservr)\Private Bytes]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Memory</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Buffer Cache Hit Ratio (%)</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Buffer Manager\Buffer cache hit ratio]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>%</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\{$MSSQLINST}:Buffer Manager\Buffer cache hit ratio]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Memory</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Checkpoint Pages por (SEG)</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Buffer Manager\Checkpoint pages/sec]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>p/sec</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\{$MSSQLINST}:Buffer Manager\Checkpoint pages/sec]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Database Pages</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Buffer Manager\Database pages]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\SQLServer:Buffer Manager\Database pages]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Lazy Writes por (SEG)</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Buffer Manager\Lazy writes/sec]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>p/sec</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\{$MSSQLINST}:Buffer Manager\Lazy writes/sec]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Page Life Expectancy</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Buffer Manager\Page life expectancy]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>s</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\{$MSSQLINST}:Buffer Manager\Page life expectancy]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Target Pages</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Buffer Manager\Target pages]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\{$MSSQLINST}:Buffer Manager\Target pages]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Total pages</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Buffer Manager\Total pages]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>1</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\{$MSSQLINST}:Buffer Manager\Total pages]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Total size of the data banks</name>
<type>7</type>
<snmp_community/>
<multiplier>1</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Databases(_Total)\Data File(s) Size (KB)]</key>
<delay>3600</delay>
<history>15</history>
<trends>90</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>B</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1024</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>Total size of the data banks.
perf_counter[\{$MSSQLINST}:Databases(_Total)\Data File(s) Size (KB)]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL General</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Total size of logs</name>
<type>7</type>
<snmp_community/>
<multiplier>1</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Databases(_Total)\Log File(s) Size (KB)]</key>
<delay>3600</delay>
<history>15</history>
<trends>90</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>B</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1024</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>日志的大小
perf_counter[\{$MSSQLINST}:Databases(_Total)\Log File(s) Size (KB)]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL General</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Total of connections in the databases</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:General Statistics\User Connections]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>总的数据库连接
perf_counter[\{$MSSQLINST}:General Statistics\User Connections]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Lock Waits por (SEG)</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Locks(_Total)\Lock Waits/sec]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units>p/sec</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\{$MSSQLINST}:Locks(_Total)\Lock Waits/sec]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Grants Pending Memory</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Memory Manager\Memory Grants Pending]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\{$MSSQLINST}:Memory Manager\Memory Grants Pending]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Memory</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Cache Memory</name>
<type>7</type>
<snmp_community/>
<multiplier>1</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Memory Manager\SQL Cache Memory (KB)]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>B</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1024</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>Cache Memory
perf_counter[\{$MSSQLINST}:Memory Manager\SQL Cache Memory (KB)]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Memory</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Memory Reserved</name>
<type>7</type>
<snmp_community/>
<multiplier>1</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Memory Manager\Target Server Memory (KB)]</key>
<delay>3600</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units>B</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1024</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\{$MSSQLINST}:Memory Manager\Target Server Memory (KB)]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Memory</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>Erros por (SEG)</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:SQL Errors(_Total)\Errors/sec]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>p/sec</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\{$MSSQLINST}:SQL Errors(_Total)\Errors/sec]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>SQL Compilations por (SEG)</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:SQL Statistics\SQL Compilations/sec]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>p/sec</units>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>perf_counter[\{$MSSQLINST}:SQL Statistics\SQL Compilations/sec]</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Statistics</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
</item>
<item>
<name>SQL Server Integration Services 10.0</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>service.info[MsDtsServer100]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>Service: MsDtsServer100
Name: SQL Server Integration Services 10.0
Description: Provides management support for storing and running SSIS packages.</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Services</name>
</application>
</applications>
<valuemap>
<name>MSSQL Service</name>
</valuemap>
<logtimefmt/>
</item>
<item>
<name>SQL Server Agent {$MSSQLAGENT}</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>service.info[{$MSSQLAGENT}]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>Service: SQLSERVERAGENT
Name: SQL Server Agent ({$ MSSQLAGENT})
Description: Performs tasks, monitors SQL Server, triggers alerts, and allows the automation of some administrative tasks.</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Services</name>
</application>
</applications>
<valuemap>
<name>MSSQL Service</name>
</valuemap>
<logtimefmt/>
</item>
<item>
<name>SQL Server {$MSSQLSERVER}</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>service.info[{$MSSQLSERVER}]</key>
<delay>300</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>Service: MSSQLSERVER
Name: SQL Server ({$ MSSQLSERVER})
Description: Offers storage, processing, and controlled access to data and fast transaction processing.</description>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>MSSQL Services</name>
</application>
</applications>
<valuemap>
<name>MSSQL Service</name>
</valuemap>
<logtimefmt/>
</item>
</items>
<discovery_rules>
<discovery_rule>
<name>MSSQL Databases</name>
<type>7</type>
<snmp_community/>
<snmp_oid/>
<key>discovery.mssql.databases</key>
<delay>3600</delay>
<status>0</status>
<allowed_hosts/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<delay_flex/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<filter>
<evaltype>0</evaltype>
<formula/>
<conditions/>
</filter>
<lifetime>1</lifetime>
<description>MSSQL数据库服务器发现</description>
<item_prototypes>
<item_prototype>
<name>{#MSSQLDBNAME} Number of Connections</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>discovery.mssql.data[CONN,{#MSSQLDBNAME}]</key>
<delay>600</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>Number of MSSQL Database Connections - {#MSSQLDBNAME}</description>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
<logtimefmt/>
<application_prototypes>
<application_prototype>
<name>MSSQL database info - {#MSSQLDBNAME}</name>
</application_prototype>
</application_prototypes>
</item_prototype>
<item_prototype>
<name>{#MSSQLDBNAME} Status</name>
<type>7</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>discovery.mssql.data[STATUS,{#MSSQLDBNAME}]</key>
<delay>600</delay>
<history>7</history>
<trends>30</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description>MONITOR o Status to DATE MINIMUM - {# MOUNT}</description>
<inventory_link>0</inventory_link>
<applications/>
<valuemap>
<name>MSSQL Databases Status</name>
</valuemap>
<logtimefmt/>
<application_prototypes>
<application_prototype>
<name>MSSQL database info - {#MSSQLDBNAME}</name>
</application_prototype>
</application_prototypes>
</item_prototype>
<item_prototype>
<name>{#MSSQLDBNAME} Database Size</name>
<type>7</type>
<snmp_community/>
<multiplier>1</multiplier>
<snmp_oid/>
<key>perf_counter[\{$MSSQLINST}:Databases({#MSSQLDBNAME})\Data File(s) Size (KB)]</key>