Skip to content
Collect Microsoft SQL Server metrics for reporting to InfluxDB and visualize them with Grafana
Go Shell
Branch: master
Clone or download
Latest commit 58c5833 Aug 6, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
Godeps init Jan 17, 2016
etl init Jan 17, 2016
grafana init Jan 17, 2016
log init Jan 17, 2016
scripts Fix build package Aug 5, 2017
sqlscripts Fix build package Aug 5, 2017
LICENSE init Jan 17, 2016 Update Mar 5, 2016
influxdb-sqlserver Fix build package Aug 5, 2017
influxdb-sqlserver.conf Fix build package Aug 5, 2017
influxdb-sqlserver.go init Jan 17, 2016

Twitter | Email


Collect Microsoft SQL Server metrics, send to InfluxDB and visualize with Grafana


Getting Started

  • InfluxDB:
  • Grafana:
  • influxdb-sqlserver:
  • SQL Server:
    • Create a login - with a strong password - in every SQL Server instance you want to monitor:
     USE master; 
     CREATE LOGIN [linuxuser] WITH PASSWORD = N'mystrongpassword';
     GRANT VIEW SERVER STATE TO [linuxuser]; 

How to use GO code

  • Run in background: go run influxdb-sqlserver.go &
  • Build in the current directory: go build influxdb-sqlserver.go
  • Install in $GOPATH/bin: go install influxdb-sqlserver.go


Command-line flags

-config (string) = the configuration filepath in toml format (default="influxdb-sqlserver.conf")
-h = usage

T-SQL Scripts provided

Scripts provided are lightweight and use Dynamic Management Views supplied by SQL Server

  • getperfcounters.sql: 1000+ metrics from sys.dm_os_performance_counters
  • getperfmetrics.sql: some special performance metrics
  • getwaitstatscat.sql: list of wait tasks categorized from sys.dm_os_wait_stats
  • getmemoryclerksplit.sql: memory breakdown from sys.dm_os_memory_clerks
  • getmemory.sql: available and used memory from sys.dm_os_sys_memory
  • getdatabasesizetrend.sql: database size trend, datafile and logfile from sys.dm_io_virtual_file_stats
  • getdatabaseio.sql: database I/O from sys.dm_io_virtual_file_stats
  • getcpu.sql: cpu usage from sys.dm_os_ring_buffers

influxdb-sqlserver uses InfluxDB line protocol. If you add a sql query you have to return one column formatted with this protocol. For more details, see scripts provided in the repository and the InfluxDB documentation


MIT-LICENSE. See LICENSE file provided in the repository for details

You can’t perform that action at this time.