You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Telegraf Configuration## Telegraf is entirely plugin driven. All metrics are gathered from the# declared inputs, and sent to the declared outputs.## Plugins must be declared in here to be active.# To deactivate a plugin, comment out the name and any variables.## Use 'telegraf -config telegraf.conf -test' to see what metrics a config# file would generate.## Environment variables can be used anywhere in this config file, simply surround# them with ${}. For strings the variable must be within quotes (ie, "${STR_VAR}"),# for numbers and booleans they should be plain (ie, ${INT_VAR}, ${BOOL_VAR})# Global tags can be specified here in key="value" format.
[global_tags]
# dc = "us-east-1" # will tag all metrics with dc=us-east-1# rack = "1a"## Environment variables can be used as tags, and throughout the config file# user = "$USER"# Configuration for telegraf agent
[agent]
## Default data collection interval for all inputsinterval = "5s"## Rounds collection interval to 'interval'## ie, if interval="10s" then always collect on :00, :10, :20, etc.round_interval = true## Telegraf will send metrics to outputs in batches of at most## metric_batch_size metrics.## This controls the size of writes that Telegraf sends to output plugins.metric_batch_size = 1000## Maximum number of unwritten metrics per output. Increasing this value## allows for longer periods of output downtime without dropping metrics at the## cost of higher maximum memory usage.metric_buffer_limit = 10000## Collection jitter is used to jitter the collection by a random amount.## Each plugin will sleep for a random time within jitter before collecting.## This can be used to avoid many plugins querying things like sysfs at the## same time, which can have a measurable effect on the system.collection_jitter = "5s"## Default flushing interval for all outputs. Maximum flush_interval will be## flush_interval + flush_jitterflush_interval = "10s"## Jitter the flush interval by a random amount. This is primarily to avoid## large write spikes for users running a large number of telegraf instances.## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15sflush_jitter = "5s"## By default or when set to "0s", precision will be set to the same## timestamp order as the collection interval, with the maximum being 1s.## ie, when interval = "10s", precision will be "1s"## when interval = "250ms", precision will be "1ms"## Precision will NOT be used for service inputs. It is up to each individual## service input to set the timestamp at the appropriate precision.## Valid time units are "ns", "us" (or "µs"), "ms", "s".precision = ""## Override default hostname, if empty use os.Hostname()hostname = ""## If set to true, do no set the "host" tag in the telegraf agent.omit_hostname = falsedebug = truequiet = false################################################################################ OUTPUT PLUGINS ################################################################################# Configuration for sending metrics to InfluxDB 2.0
[[outputs.influxdb_v2]]
alias = "opc-ua-db"## The URLs of the InfluxDB cluster nodes.#### Multiple URLs can be specified for a single cluster, only ONE of the## urls will be written to each interval.## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]urls = ["${INFLUX_HOST}"]
## Token for authentication.token = "${INFLUX_TOKEN}"## Organization is the name of the organization you wish to write to.organization = "${INFLUX_ORG}"## Destination bucket to write into.bucket = "${INFLUX_BUCKET}"################################################################################ INPUT PLUGINS ################################################################################
[[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 namename = "Device"name_prefix = "egx150warehouse_"## Slave ID - addresses a MODBUS device on the bus## Range: 0 - 255 [0 = broadcast; 248 - 255 = reserved]slave_id = 1## Timeout for each requesttimeout = "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/TCPcontroller = "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 = true## 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 = [4]}#]# coils = [# { name = "motor1_run", address = [4]}#]## 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 (deprecated), FIXED, UFIXED (fixed-point representation on input)## scale - the final numeric variable representation## address - variable addressholding_registers = [
{ name = "power_factor", byte_order = "DCBA", data_type = "UINT64", scale=0.01, address = [0, 1]}
]
#input_registers = [#{ name = "tank_level", byte_order = "BA", data_type = "FIXED", scale=0.01, address = [1]},#]## 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
Relevant telegraf.conf
Logs from Telegraf
System info
Latest
Docker
No response
Steps to reproduce
Run Modbus simulator
Create two registers at address 0 and 1
Run config.
Expected behavior
Panic.
Actual behavior
Offical behaviour should be a config error.
Additional info
No response
The text was updated successfully, but these errors were encountered: