Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(inputs_m-z): migrate sample configs into separate files #11133

Merged
merged 1 commit into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions plugins/inputs/mailchimp/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Gathers metrics from the /3.0/reports MailChimp API
[[inputs.mailchimp]]
## MailChimp API key
## get from https://admin.mailchimp.com/account/api/
api_key = "" # required

## Reports for campaigns sent more than days_old ago will not be collected.
## 0 means collect all and is the default value.
days_old = 0

## Campaign ID to get, if empty gets all campaigns, this option overrides days_old
# campaign_id = ""
18 changes: 18 additions & 0 deletions plugins/inputs/marklogic/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Retrieves information on a specific host in a MarkLogic Cluster
[[inputs.marklogic]]
## Base URL of the MarkLogic HTTP Server.
url = "http://localhost:8002"

## List of specific hostnames to retrieve information. At least (1) required.
# hosts = ["hostname1", "hostname2"]

## Using HTTP Basic Authentication. Management API requires 'manage-user' role privileges
# username = "myuser"
# password = "mypassword"

## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
8 changes: 8 additions & 0 deletions plugins/inputs/mcrouter/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Read metrics from one or many mcrouter servers.
[[inputs.mcrouter]]
## An array of address to gather stats about. Specify an ip or hostname
## with port. ie tcp://localhost:11211, tcp://10.0.0.1:11211, etc.
servers = ["tcp://localhost:11211", "unix:///var/run/mcrouter.sock"]

## Timeout for metric collections from all servers. Minimum timeout is "1s".
# timeout = "5s"
5 changes: 5 additions & 0 deletions plugins/inputs/mdstat/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get kernel statistics from /proc/mdstat
[[inputs.mdstat]]
## Sets file path
## If not specified, then default is /proc/mdstat
# file_name = "/proc/mdstat"
3 changes: 3 additions & 0 deletions plugins/inputs/mem/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Read metrics about memory usage
[[inputs.mem]]
# no configuration
15 changes: 15 additions & 0 deletions plugins/inputs/memcached/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Read metrics from one or many memcached servers.
[[inputs.memcached]]
# An array of address to gather stats about. Specify an ip on hostname
# with optional port. ie localhost, 10.0.0.1:11211, etc.
servers = ["localhost:11211"]
# An array of unix memcached sockets to gather stats about.
# unix_sockets = ["/var/run/memcached.sock"]

## Optional TLS Config
# enable_tls = true
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## If false, skip chain & host verification
# insecure_skip_verify = true
42 changes: 42 additions & 0 deletions plugins/inputs/mesos/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Telegraf plugin for gathering metrics from N Mesos masters
[[inputs.mesos]]
## Timeout, in ms.
timeout = 100

## A list of Mesos masters.
masters = ["http://localhost:5050"]

## Master metrics groups to be collected, by default, all enabled.
master_collections = [
"resources",
"master",
"system",
"agents",
"frameworks",
"framework_offers",
"tasks",
"messages",
"evqueue",
"registrar",
"allocator",
]

## A list of Mesos slaves, default is []
# slaves = []

## Slave metrics groups to be collected, by default, all enabled.
# slave_collections = [
# "resources",
# "agent",
# "system",
# "executors",
# "tasks",
# "messages",
# ]

## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
13 changes: 13 additions & 0 deletions plugins/inputs/minecraft/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Collects scores from a Minecraft server's scoreboard using the RCON protocol
[[inputs.minecraft]]
## Address of the Minecraft server.
# server = "localhost"

## Server RCON Port.
# port = "25575"

## Server RCON Password.
password = ""

## Uncomment to remove deprecated metric components.
# tagdrop = ["server"]
27 changes: 27 additions & 0 deletions plugins/inputs/mock/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generate metrics for test and demonstration purposes
[[inputs.mock]]
## Set the metric name to use for reporting
metric_name = "mock"

## Optional string key-value pairs of tags to add to all metrics
# [inputs.mock.tags]
# "key" = "value"

## One or more mock data fields *must* be defined.
##
## [[inputs.mock.random]]
## name = "rand"
## min = 1.0
## max = 6.0
## [[inputs.mock.sine_wave]]
## name = "wave"
## amplitude = 1.0
## period = 0.5
## [[inputs.mock.step]]
## name = "plus_one"
## start = 0.0
## step = 1.0
## [[inputs.mock.stock]]
## name = "abc"
## price = 50.00
## volatility = 0.2
196 changes: 196 additions & 0 deletions plugins/inputs/modbus/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
# Retrieve data from MODBUS slave devices
[[inputs.modbus]]
## Connection Configuration
##
## The plugin supports connections to PLCs via MODBUS/TCP, RTU over TCP, ASCII over TCP or
## via serial line communication in binary (RTU) or readable (ASCII) encoding
##
## Device name
name = "Device"

## Slave ID - addresses a MODBUS device on the bus
## Range: 0 - 255 [0 = broadcast; 248 - 255 = reserved]
slave_id = 1

## Timeout for each request
timeout = "1s"

## Maximum number of retries and the time to wait between retries
## when a slave-device is busy.
# busy_retries = 0
# busy_retries_wait = "100ms"

# TCP - connect via Modbus/TCP
controller = "tcp://localhost:502"

## Serial (RS485; RS232)
# controller = "file:///dev/ttyUSB0"
# baud_rate = 9600
# data_bits = 8
# parity = "N"
# stop_bits = 1

## For Modbus over TCP you can choose between "TCP", "RTUoverTCP" and "ASCIIoverTCP"
## default behaviour is "TCP" if the controller is TCP
## For Serial you can choose between "RTU" and "ASCII"
# transmission_mode = "RTU"

## Trace the connection to the modbus device as debug messages
## Note: You have to enable telegraf's debug mode to see those messages!
# debug_connection = false

## Define the configuration schema
## |---register -- define fields per register type in the original style (only supports one slave ID)
## |---request -- define fields on a requests base
configuration_type = "register"

## --- "register" configuration style ---

## Measurements
##

## Digital Variables, Discrete Inputs and Coils
## measurement - the (optional) measurement name, defaults to "modbus"
## name - the variable name
## address - variable address

discrete_inputs = [
{ name = "start", address = [0]},
{ name = "stop", address = [1]},
{ name = "reset", address = [2]},
{ name = "emergency_stop", address = [3]},
]
coils = [
{ name = "motor1_run", address = [0]},
{ name = "motor1_jog", address = [1]},
{ name = "motor1_stop", address = [2]},
]

## Analog Variables, Input Registers and Holding Registers
## measurement - the (optional) measurement name, defaults to "modbus"
## name - the variable name
## byte_order - the ordering of bytes
## |---AB, ABCD - Big Endian
## |---BA, DCBA - Little Endian
## |---BADC - Mid-Big Endian
## |---CDAB - Mid-Little Endian
## data_type - INT16, UINT16, INT32, UINT32, INT64, UINT64,
## FLOAT32-IEEE, FLOAT64-IEEE (the IEEE 754 binary representation)
## FLOAT32, FIXED, UFIXED (fixed-point representation on input)
## scale - the final numeric variable representation
## address - variable address

holding_registers = [
{ name = "power_factor", byte_order = "AB", data_type = "FIXED", scale=0.01, address = [8]},
{ name = "voltage", byte_order = "AB", data_type = "FIXED", scale=0.1, address = [0]},
{ name = "energy", byte_order = "ABCD", data_type = "FIXED", scale=0.001, address = [5,6]},
{ name = "current", byte_order = "ABCD", data_type = "FIXED", scale=0.001, address = [1,2]},
{ name = "frequency", byte_order = "AB", data_type = "UFIXED", scale=0.1, address = [7]},
{ name = "power", byte_order = "ABCD", data_type = "UFIXED", scale=0.1, address = [3,4]},
]
input_registers = [
{ name = "tank_level", byte_order = "AB", data_type = "INT16", scale=1.0, address = [0]},
{ name = "tank_ph", byte_order = "AB", data_type = "INT16", scale=1.0, address = [1]},
{ name = "pump1_speed", byte_order = "ABCD", data_type = "INT32", scale=1.0, address = [3,4]},
]

## --- "request" configuration style ---

## Per request definition
##

## Define a request sent to the device
## Multiple of those requests can be defined. Data will be collated into metrics at the end of data collection.
[[inputs.modbus.request]]
## ID of the modbus slave device to query.
## If you need to query multiple slave-devices, create several "request" definitions.
slave_id = 1

## Byte order of the data.
## |---ABCD -- Big Endian (Motorola)
## |---DCBA -- Little Endian (Intel)
## |---BADC -- Big Endian with byte swap
## |---CDAB -- Little Endian with byte swap
byte_order = "ABCD"

## Type of the register for the request
## Can be "coil", "discrete", "holding" or "input"
register = "coil"

## Name of the measurement.
## Can be overriden by the individual field definitions. Defaults to "modbus"
# measurement = "modbus"

## Field definitions
## Analog Variables, Input Registers and Holding Registers
## address - address of the register to query. For coil and discrete inputs this is the bit address.
## name *1 - field name
## type *1,2 - type of the modbus field, can be INT16, UINT16, INT32, UINT32, INT64, UINT64 and
## FLOAT32, FLOAT64 (IEEE 754 binary representation)
## scale *1,2 - (optional) factor to scale the variable with
## output *1,2 - (optional) type of resulting field, can be INT64, UINT64 or FLOAT64. Defaults to FLOAT64 if
## "scale" is provided and to the input "type" class otherwise (i.e. INT* -> INT64, etc).
## measurement *1 - (optional) measurement name, defaults to the setting of the request
## omit - (optional) omit this field. Useful to leave out single values when querying many registers
## with a single request. Defaults to "false".
##
## *1: Those fields are ignored if field is omitted ("omit"=true)
##
## *2: Thise fields are ignored for both "coil" and "discrete"-input type of registers. For those register types
## the fields are output as zero or one in UINT64 format by default.

## Coil / discrete input example
fields = [
{ address=0, name="motor1_run"},
{ address=1, name="jog", measurement="motor"},
{ address=2, name="motor1_stop", omit=true},
{ address=3, name="motor1_overheating"},
]

[[inputs.modbus.request.tags]]
machine = "impresser"
location = "main building"

[[inputs.modbus.request]]
## Holding example
## All of those examples will result in FLOAT64 field outputs
slave_id = 1
byte_order = "DCBA"
register = "holding"
fields = [
{ address=0, name="voltage", type="INT16", scale=0.1 },
{ address=1, name="current", type="INT32", scale=0.001 },
{ address=3, name="power", type="UINT32", omit=true },
{ address=5, name="energy", type="FLOAT32", scale=0.001, measurement="W" },
{ address=7, name="frequency", type="UINT32", scale=0.1 },
{ address=8, name="power_factor", type="INT64", scale=0.01 },
]

[[inputs.modbus.request.tags]]
machine = "impresser"
location = "main building"

[[inputs.modbus.request]]
## Input example with type conversions
slave_id = 1
byte_order = "ABCD"
register = "input"
fields = [
{ address=0, name="rpm", type="INT16" }, # will result in INT64 field
{ address=1, name="temperature", type="INT16", scale=0.1 }, # will result in FLOAT64 field
{ address=2, name="force", type="INT32", output="FLOAT64" }, # will result in FLOAT64 field
{ address=4, name="hours", type="UINT32" }, # will result in UIN64 field
]

[[inputs.modbus.request.tags]]
machine = "impresser"
location = "main building"

## Enable workarounds required by some devices to work correctly
# [inputs.modbus.workarounds]
## Pause between read requests sent to the device. This might be necessary for (slow) serial devices.
# pause_between_requests = "0ms"
## Close the connection after every gather cycle. Usually the plugin closes the connection after a certain
## idle-timeout, however, if you query a device with limited simultaneous connectivity (e.g. serial devices)
## from multiple instances you might want to only stay connected during gather and disconnect afterwards.
# close_connection_after_gather = false
34 changes: 34 additions & 0 deletions plugins/inputs/mongodb/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Read metrics from one or many MongoDB servers
[[inputs.mongodb]]
## An array of URLs of the form:
## "mongodb://" [user ":" pass "@"] host [ ":" port]
## For example:
## mongodb://user:[email protected]:27017,
## mongodb://10.10.3.33:18832,
servers = ["mongodb://127.0.0.1:27017/?connect=direct"]

## When true, collect cluster status.
## Note that the query that counts jumbo chunks triggers a COLLSCAN, which
## may have an impact on performance.
# gather_cluster_status = true

## When true, collect per database stats
# gather_perdb_stats = false

## When true, collect per collection stats
# gather_col_stats = false

## When true, collect usage statistics for each collection
## (insert, update, queries, remove, getmore, commands etc...).
# gather_top_stat = false

## List of db where collections stats are collected
## If empty, all db are concerned
# col_stats_dbs = ["local"]

## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
Loading