sqlServer采集器安装说明

sqlServer Exporter

问题描述

需要对sqlServer进行监控,部署了sql_exporter,对过程进行一下记录。

源码参见sqlServer_exporter

①下载

https://github.com/free/sql_exporter/releases

②解压缩

tar -xzvf sql_exporter-0.5.linux-amd64.tar.gz

③启动:

先进入exporter

cd sql_exporter-0.5.linux-amd64

然后修改sql_exporter.yml文件中data_source_name: ’ sqlserver:// prom_user:[email protected]:1433 '的内容,根据实际情况修改sqlServer的用户名和密码,以及目标ip

vi sql_exporter.yml

最后启动exporter

./sql_exporter

④验证:

curl localhost:9399/metrics

预期输出:

# HELP mssql_batch_requests Number of command batches received.
# TYPE mssql_batch_requests counter
mssql_batch_requests 13
# HELP mssql_connections Number of active connections.
# TYPE mssql_connections gauge
mssql_connections{db="master"} 48
# HELP mssql_deadlocks Number of lock requests that resulted in a deadlock.
# TYPE mssql_deadlocks counter
mssql_deadlocks 0
# HELP mssql_io_stall_seconds Stall time in seconds per database and I/O operation.
# TYPE mssql_io_stall_seconds counter
mssql_io_stall_seconds{db="master",operation="read"} 0.895
mssql_io_stall_seconds{db="master",operation="write"} 0.07
mssql_io_stall_seconds{db="model",operation="read"} 0.233
mssql_io_stall_seconds{db="model",operation="write"} 0.021
mssql_io_stall_seconds{db="msdb",operation="read"} 0.439
mssql_io_stall_seconds{db="msdb",operation="write"} 0.029
mssql_io_stall_seconds{db="tempdb",operation="read"} 0.156
mssql_io_stall_seconds{db="tempdb",operation="write"} 0.018
# HELP mssql_io_stall_total_seconds Total stall time in seconds per database.
# TYPE mssql_io_stall_total_seconds counter
mssql_io_stall_total_seconds{db="master"} 0.965
mssql_io_stall_total_seconds{db="model"} 0.254
mssql_io_stall_total_seconds{db="msdb"} 0.468
mssql_io_stall_total_seconds{db="tempdb"} 0.174
# HELP mssql_kill_connection_errors Number of severe errors that caused SQL Server to kill the connection.
# TYPE mssql_kill_connection_errors counter
mssql_kill_connection_errors 0
# HELP mssql_local_time_seconds Local time in seconds since epoch (Unix time).
# TYPE mssql_local_time_seconds gauge
mssql_local_time_seconds 1.578622388e+09
# HELP mssql_log_growths Number of times the transaction log has been expanded, per database.
# TYPE mssql_log_growths counter
mssql_log_growths{db="master"} 0
mssql_log_growths{db="model"} 0
mssql_log_growths{db="msdb"} 0
mssql_log_growths{db="mssqlsystemresource"} 0
mssql_log_growths{db="tempdb"} 0
...

你可能感兴趣的:(监控运维,采集器,prometheus,sqlserver,数据库)