Coder Social home page Coder Social logo

metricd's Introduction

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.

[accouting.test]
database = "db"                 # influx database name
measurement = "measurement"     # influx measurement name
sample_time = 1000              # sample time in ms
host = "192.168.178.1"          # router os host ip address
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.

[mysql.test]
database = "database"                                   # influx database name
measurement = "measurement"                             # influx measurement name
sample_time = 60000                                     # sample time in ms
sql_uri = "user:pass@tcp(127.0.0.1:3306)/database"      # database uri
queries = [                                             # query with value name
        "val1:SELECT AVG(time) FROM table",
        "val2:SELECT count(*) FROM table",
]
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.

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

SNMP

Cyclically acquires information from an SNMP target.

[snmp.test]
host = "1921.68.178.1"
community = "public"
database = "database"
measurement = "measurement"
sample_time = 1000
tags = ["foo:bar"]
datapoints = [
	".1.3.6.1.2.1.31.1.1.1.10.1:tx_bytes",
	".1.3.6.1.2.1.31.1.1.1.6.1:rx_bytes",
]

metricd's People

Contributors

faryon93 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.