Bosch Rexroth ctrlX Data Layer 输入插件
此插件从 ctrlX 数据层收集数据,这是运行在 Bosch Rexroth 的 ctrlX CORE 设备上的通信中间件。该平台用于专业的自动化应用,如工业自动化、楼宇自动化、机器人、IoT 网关或作为传统的 PLC。
引入版本: Telegraf v1.27.0 标签: iot, messaging 操作系统支持: all
全局配置选项
插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md。
配置
# A ctrlX Data Layer server sent event input plugin
[[inputs.ctrlx_datalayer]]
## Hostname or IP address of the ctrlX CORE Data Layer server
## example: server = "localhost" # Telegraf is running directly on the device
## server = "192.168.1.1" # Connect to ctrlX CORE remote via IP
## server = "host.example.com" # Connect to ctrlX CORE remote via hostname
## server = "10.0.2.2:8443" # Connect to ctrlX CORE Virtual from development environment
server = "localhost"
## Authentication credentials
username = "boschrexroth"
password = "boschrexroth"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
## Timeout for HTTP requests. (default: "10s")
# timeout = "10s"
## Create a ctrlX Data Layer subscription.
## It is possible to define multiple subscriptions per host. Each subscription can have its own
## sampling properties and a list of nodes to subscribe to.
## All subscriptions share the same credentials.
[[inputs.ctrlx_datalayer.subscription]]
## The name of the measurement. (default: "ctrlx")
measurement = "memory"
## Configure the ctrlX Data Layer nodes which should be subscribed.
## address - node address in ctrlX Data Layer (mandatory)
## name - field name to use in the output (optional, default: base name of address)
## tags - extra node tags to be added to the output metric (optional)
## Note:
## Use either the inline notation or the bracketed notation, not both.
## The tags property is only supported in bracketed notation due to toml parser restrictions
## Examples:
## Inline notation
nodes=[
{name="available", address="framework/metrics/system/memavailable-mb"},
{name="used", address="framework/metrics/system/memused-mb"},
]
## Bracketed notation
# [[inputs.ctrlx_datalayer.subscription.nodes]]
# name ="available"
# address="framework/metrics/system/memavailable-mb"
# ## Define extra tags related to node to be added to the output metric (optional)
# [inputs.ctrlx_datalayer.subscription.nodes.tags]
# node_tag1="node_tag1"
# node_tag2="node_tag2"
# [[inputs.ctrlx_datalayer.subscription.nodes]]
# name ="used"
# address="framework/metrics/system/memused-mb"
## The switch "output_json_string" enables output of the measurement as json.
## That way it can be used in in a subsequent processor plugin, e.g. "Starlark Processor Plugin".
# output_json_string = false
## Define extra tags related to subscription to be added to the output metric (optional)
# [inputs.ctrlx_datalayer.subscription.tags]
# subscription_tag1 = "subscription_tag1"
# subscription_tag2 = "subscription_tag2"
## The interval in which messages shall be sent by the ctrlX Data Layer to this plugin. (default: 1s)
## Higher values reduce load on network by queuing samples on server side and sending as a single TCP packet.
# publish_interval = "1s"
## The interval a "keepalive" message is sent if no change of data occurs. (default: 60s)
## Only used internally to detect broken network connections.
# keep_alive_interval = "60s"
## The interval an "error" message is sent if an error was received from a node. (default: 10s)
## Higher values reduce load on output target and network in case of errors by limiting frequency of error messages.
# error_interval = "10s"
## The interval that defines the fastest rate at which the node values should be sampled and values captured. (default: 1s)
## The sampling frequency should be adjusted to the dynamics of the signal to be sampled.
## Higher sampling frequencies increases load on ctrlX Data Layer.
## The sampling frequency can be higher, than the publish interval. Captured samples are put in a queue and sent in publish interval.
## Note: The minimum sampling interval can be overruled by a global setting in the ctrlX Data Layer configuration ('datalayer/subscriptions/settings').
# sampling_interval = "1s"
## The requested size of the node value queue. (default: 10)
## Relevant if more values are captured than can be sent.
# queue_size = 10
## The behaviour of the queue if it is full. (default: "DiscardOldest")
## Possible values:
## - "DiscardOldest"
## The oldest value gets deleted from the queue when it is full.
## - "DiscardNewest"
## The newest value gets deleted from the queue when it is full.
# queue_behaviour = "DiscardOldest"
## The filter when a new value will be sampled. (default: 0.0)
## Calculation rule: If (abs(lastCapturedValue - newValue) > dead_band_value) capture(newValue).
# dead_band_value = 0.0
## The conditions on which a sample should be captured and thus will be sent as a message. (default: "StatusValue")
## Possible values:
## - "Status"
## Capture the value only, when the state of the node changes from or to error state. Value changes are ignored.
## - "StatusValue"
## Capture when the value changes or the node changes from or to error state.
## See also 'dead_band_value' for what is considered as a value change.
## - "StatusValueTimestamp":
## Capture even if the value is the same, but the timestamp of the value is newer.
## Note: This might lead to high load on the network because every sample will be sent as a message
## even if the value of the node did not change.
# value_change = "StatusValue"
Metrics
所有测量值都标有设备服务器地址和 ctrlX Data Layer 中定义的相应节点地址。
- 测量名称
- 标签 (tags)
source(从中收集指标的 ctrlX Data Layer 服务器)node(ctrlX Data Layer 节点的地址)
- 字段 (fields)
{name}(适用于简单数据类型的节点){name}_{index}(适用于数组数据类型的节点){name}_{jsonflat.key}(适用于对象数据类型的节点)
- 标签 (tags)
输出格式
切换开关“output_json_string”决定了输出指标的格式。
输出默认格式
使用默认输出格式
output_json_string=false根据数据类型,输出将自动格式化如下:
简单数据类型
值按原样传递给具有以下模式的度量:
{name}={value}ctrlX Data Layer 的简单数据类型
bool8,int8,uint8,int16,uint16,int32,uint32,int64,uint64,float,double,string,timestamp数组数据类型
数组中的每个值都传递给具有以下模式的度量:
{name}_{index}={value[index]}示例
myarray=[1,2,3] -> myarray_1=1, myarray_2=2, myarray_3=3ctrlX Data Layer 的数组数据类型
arbool8,arint8,aruint8,arint16,aruint16,arint32,aruint32,arint64,aruint64,arfloat,ardouble,arstring,artimestamp对象数据类型 (JSON)
扁平化 JSON 的每个值都传递给具有以下模式的度量:
{name}_{jsonflat.key}={jsonflat.value}示例
myobj={"a":1,"b":2,"c":{"d": 3}} -> myobj_a=1, myobj_b=2, myobj_c_d=3输出 JSON 格式
使用输出 JSON 格式
output_json_string=true输出将格式化为 JSON 字符串
{name}="{value}"示例
input=true -> output="true"input=[1,2,3] -> output="[1,2,3]"input={"x":4720,"y":9440,"z":{"d": 14160}} -> output="{\"x\":4720,\"y\":9440,\"z\":14160}"JSON 输出字符串可以传递给处理器插件进行转换,例如 解析器处理器插件 或 Starlark 处理器插件。
示例
[[inputs.ctrlx_datalayer.subscription]]
measurement = "osci"
nodes = [
{address="oscilloscope/instances/Osci_PLC/rec-values/allsignals"},
]
output_json_string = true
[[processors.starlark]]
namepass = [
'osci',
]
script = "oscilloscope.star"故障排除
此插件由 Bosch Rexroth 贡献。有关 ctrlX AUTOMATION 和此插件的问题,请随时查看并加入 ctrlX AUTOMATION 社区 以获得额外支持或留下您的想法和反馈。
如果您对 telegraf 工程团队有任何疑问或评论,也请加入 InfluxData 社区 Slack 或 InfluxData 社区页面。
示例输出
该插件处理简单、数组和对象 (JSON) 数据类型。
简单数据类型示例
配置
[[inputs.ctrlx_datalayer.subscription]]
measurement="memory"
[inputs.ctrlx_datalayer.subscription.tags]
sub_tag1="memory_tag1"
sub_tag2="memory_tag2"
[[inputs.ctrlx_datalayer.subscription.nodes]]
name ="available"
address="framework/metrics/system/memavailable-mb"
[inputs.ctrlx_datalayer.subscription.nodes.tags]
node_tag1="memory_available_tag1"
node_tag2="memory_available_tag2"
[[inputs.ctrlx_datalayer.subscription.nodes]]
name ="used"
address="framework/metrics/system/memused-mb"
[inputs.ctrlx_datalayer.subscription.nodes.tags]
node_tag1="memory_used_node_tag1"
node_tag2="memory_used_node_tag2"来源
"framework/metrics/system/memavailable-mb" : 365.93359375
"framework/metrics/system/memused-mb" : 567.67578125Metrics
memory,source=192.168.1.1,host=host.example.com,node=framework/metrics/system/memavailable-mb,node_tag1=memory_available_tag1,node_tag2=memory_available_tag2,sub_tag1=memory2_tag1,sub_tag2=memory_tag2 available=365.93359375 1680093310249627400
memory,source=192.168.1.1,host=host.example.com,node=framework/metrics/system/memused-mb,node_tag1=memory_used_node_tag1,node_tag2=memory_used_node_tag2,sub_tag1=memory2_tag1,sub_tag2=memory_tag2 used=567.67578125 1680093310249667600数组数据类型示例
配置
[[inputs.ctrlx_datalayer.subscription]]
measurement="array"
nodes=[
{ name="ar_uint8", address="alldata/dynamic/array-of-uint8"},
{ name="ar_bool8", address="alldata/dynamic/array-of-bool8"},
]来源
"alldata/dynamic/array-of-bool8" : [true, false, true]
"alldata/dynamic/array-of-uint8" : [0, 255]Metrics
array,source=192.168.1.1,host=host.example.com,node=alldata/dynamic/array-of-bool8 ar_bool8_0=true,ar_bool8_1=false,ar_bool8_2=true 1680095727347018800
array,source=192.168.1.1,host=host.example.com,node=alldata/dynamic/array-of-uint8 ar_uint8_0=0,ar_uint8_1=255 1680095727347223300对象数据类型 (JSON) 示例
配置
[[inputs.ctrlx_datalayer.subscription]]
measurement="motion"
nodes=[
{name="linear", address="motion/axs/Axis_1/state/values/actual"},
{name="rotational", address="motion/axs/Axis_2/state/values/actual"},
]来源
"motion/axs/Axis_1/state/values/actual" : {"actualPos":65.249329860957,"actualVel":5,"actualAcc":0,"actualTorque":0,"distLeft":0,"actualPosUnit":"mm","actualVelUnit":"mm/min","actualAccUnit":"m/s^2","actualTorqueUnit":"Nm","distLeftUnit":"mm"}
"motion/axs/Axis_2/state/values/actual" : {"actualPos":120,"actualVel":0,"actualAcc":0,"actualTorque":0,"distLeft":0,"actualPosUnit":"deg","actualVelUnit":"rpm","actualAccUnit":"rad/s^2","actualTorqueUnit":"Nm","distLeftUnit":"deg"}Metrics
motion,source=192.168.1.1,host=host.example.com,node=motion/axs/Axis_1/state/values/actual linear_actualVel=5,linear_distLeftUnit="mm",linear_actualAcc=0,linear_distLeft=0,linear_actualPosUnit="mm",linear_actualAccUnit="m/s^2",linear_actualTorqueUnit="Nm",linear_actualPos=65.249329860957,linear_actualVelUnit="mm/min",linear_actualTorque=0 1680258290342523500
motion,source=192.168.1.1,host=host.example.com,node=motion/axs/Axis_2/state/values/actual rotational_distLeft=0,rotational_actualVelUnit="rpm",rotational_actualAccUnit="rad/s^2",rotational_distLeftUnit="deg",rotational_actualPos=120,rotational_actualVel=0,rotational_actualAcc=0,rotational_actualPosUnit="deg",rotational_actualTorqueUnit="Nm",rotational_actualTorque=0 1680258290342538100如果配置中设置了 output_json_string
output_json_string = true那么指标将按此生成:
motion,source=192.168.1.1,host=host.example.com,node=motion/axs/Axis_1/state/values/actual linear="{\"actualAcc\":0,\"actualAccUnit\":\"m/s^2\",\"actualPos\":65.249329860957,\"actualPosUnit\":\"mm\",\"actualTorque\":0,\"actualTorqueUnit\":\"Nm\",\"actualVel\":5,\"actualVelUnit\":\"mm/min\",\"distLeft\":0,\"distLeftUnit\":\"mm\"}" 1680258290342523500
motion,source=192.168.1.1,host=host.example.com,node=motion/axs/Axis_2/state/values/actual rotational="{\"actualAcc\":0,\"actualAccUnit\":\"rad/s^2\",\"actualPos\":120,\"actualPosUnit\":\"deg\",\"actualTorque\":0,\"actualTorqueUnit\":\"Nm\",\"actualVel\":0,\"actualVelUnit\":\"rpm\",\"distLeft\":0,\"distLeftUnit\":\"deg\"}" 1680258290342538100此页面是否有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一员!我们欢迎并鼓励您对 Telegraf 和本文档提出反馈和 bug 报告。要获取支持,请使用以下资源
具有年度合同或支持合同的客户可以 联系 InfluxData 支持。