Hello Folks,
i want to read out my heater with the help from telegraf. The vendor has a xml api which i can use for reading the needed data
telegraf config:
[agent]
interval = “5s”
debug = true
quiet = false
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = “0s”
flush_interval = “2s”
flush_jitter = “0s”
precision = “”
[[outputs.prometheus_client]]
listen = “:9273”
metric_version = 2
path = “/metrics”
collectors_exclude = [“gocollector”, “process”]
Input Plugins
[[inputs.http]]
urls = [“http://192.168.0.221:8080/user/var/120/10251/0/0/12242”]
method = “GET”
data_format = “xml”
[[inputs.http.xml]]
[inputs.http.xml.fields]
puffer_oben = “/eta/value[1]/@strValue”
[[inputs.http]]
urls = [“http://192.168.0.221:8080/user/var/120/10251/0/0/12528”]
method = “GET”
data_format = “xml”
[[inputs.http.xml]]
[inputs.http.xml.fields]
puffer_ladezustand = “/eta/value[1]/@strValue”
in the syslogfile i see that the two metrics has been found
example
Mar 17 20:33:05 eta-data-collector telegraf[2652]: 2022-03-17T20:33:05Z D! [parsers.xml::http] Number of selected metric nodes: 1
Mar 17 20:33:05 eta-data-collector telegraf[2652]: 2022-03-17T20:33:05Z D! [parsers.xml::http] Number of selected metric nodes: 1
Mar 17 20:33:05 eta-data-collector telegraf[2652]: 2022-03-17T20:33:05Z D! [outputs.prometheus_client] Wrote batch of 2 metrics in 172.538µs
if i do a curl like curl http://localhost:9273/metrics there are no metrics. Does someone have a clue what my fault is?