项目作者: faryon93

项目描述 :
metric collector for influxdb
高级语言: Go
项目地址: git://github.com/faryon93/metricd.git
创建时间: 2017-01-03T13:57:34Z
项目社区:https://github.com/faryon93/metricd

开源协议:GNU General Public License v3.0

下载


metricd - metric collector for influxdb

This is a simple metric collector service which was built for me personal needs.
Only InfluxDB is supported as a data storage backend. The following modules are
available for metric aggregation:

Mikrotik RouterOS Accounting

This modules uses the accounting functionality of Mikrotiks RouterOS. It provides per client traffic statistics.
The clients ip adddress is stored as the tag host.

  1. [accouting.test]
  2. database = "db" # influx database name
  3. measurement = "measurement" # influx measurement name
  4. sample_time = 1000 # sample time in ms
  5. host = "192.168.178.1" # router os host ip address
  6. network = "192.168.178.0/24" # network to obtain traffic stats from

MySQL

The MySQL module can be used to execute arbitrary SQL queries against an mysql server and store the results.
The queries are executed every sample_time milliseconds.

  1. [mysql.test]
  2. database = "database" # influx database name
  3. measurement = "measurement" # influx measurement name
  4. sample_time = 60000 # sample time in ms
  5. sql_uri = "user:pass@tcp(127.0.0.1:3306)/database" # database uri
  6. queries = [ # query with value name
  7. "val1:SELECT AVG(time) FROM table",
  8. "val2:SELECT count(*) FROM table",
  9. ]
  10. tags = ["foo:bar"] # static tags

Syslog

The syslog module creates an RFC3164 compatible syslog server and parses the log messages with a standard golang regex.
Named capture groups with the prefix tag_ are stored as tags and capture groups with the prefix val_ are parsed as float numbers and stored as point values.

  1. [syslog.test]
  2. database = "database" # influxdb database name
  3. measurement = "measurement" # influxdb measurement name
  4. listen = "0.0.0.0:514" # listen address for syslog server
  5. regex = "(key:\\s+(?P<val_value>.+)" # regex to parse log message
  6. tags = ["foo:bar"] # static tags

SNMP

Cyclically acquires information from an SNMP target.

  1. [snmp.test]
  2. host = "1921.68.178.1"
  3. community = "public"
  4. database = "database"
  5. measurement = "measurement"
  6. sample_time = 1000
  7. tags = ["foo:bar"]
  8. datapoints = [
  9. ".1.3.6.1.2.1.31.1.1.1.10.1:tx_bytes",
  10. ".1.3.6.1.2.1.31.1.1.1.6.1:rx_bytes",
  11. ]