go-zabbix-mssql

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2017 License: MIT Imports: 11 Imported by: 0

README

go-zabbix-mssql

Intro

First of all, this is the utility to collect tricky metrics from MS SQL Server instance and send it to Zabbix trapper items using Go implementation of zabbix-sender.

In case there would be developed any universal templates that can be easily imported into Zabbix or Grafana, it would be also added to repository. Anyway, I got plans to describe everything in some kind of guide.

This development inspired by Grafana dashboard which utilizes list of MS SQL metrics by Telegraf team.

One of the goals is to achieve something like following view with zabbix + windows performance counters + go-zabbix-mssql + grafana telegraf-sqlserver-full

Features

  1. With just one config YAML file, this util allows to send almost endless list of queries that is joining with UNION ALL before SQL engine get it. So technically any number of lines in YAML still produces just one query, amirite? Be careful about response time for final big query!
  2. You must use command line flags to tune few details for zabbix-sender part^
    • -U -- login for MS SQL connection
    • -P -- password for MS SQL connection
    • -S -- connection string in server_name[\instance_name] format
    • -Z -- zabbix-server FQDN where proper trapper items live
    • -H -- MS SQL Instance hostname, as it named in zabbix-server
    • -F -- full path to config YAML file, like go-zabbix-mssql.config.yaml
  3. Util can be easily used as part of zabbix-agent:
    • make sure, you have UnsafeUserParameters=1 in zabbix_agentd.conf
    • also add something like UserParameter=mssql.metrics[*],${zabbix-agent\scripts}\go-zabbix-mssql.exe -U=$1 -P=$2 -S=$3 -Z=$4 -H=$5 -F="${full path to YAML config}"
    • configure proper Macros details (in Zabbix console) to every monitored host (read official guide for UnsafeUserParameters) which gonna replace all those $1, $2 and so on...
    • add items to your template/host with type Zabbix trapper
  4. Execution of code returns decimal number -- it shows how much of all collected metrics was not received correctly by zabbix-server. So perfect return must be 0.

Notes

  1. I love Prometheus project and its ideas so that's why metrics from example YAML named so.

TODOs

  1. Need to finish list of metrics for YAML
  2. Add all metrics to zabbix-server as proper Zabbix trapper items
  3. Finish Grafana dashboard tuning
  4. Add necessary exports to current repo
  5. Describe everything in documentation

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL