Observing following error While Executing the telegraf to send data from telegraf to influx db.
confg file data is correct, any idea why this error ? how to fix this?
**2024-03-20T13:09:10Z E! [inputs.exec] Error in plugin: metric parse error: expected field at 1:13: "HTTP/1.1 204 No Content" 2024-03-20T13:09:19Z E! [inputs.exec] Error in plugin: metric parse error: expected field at 1:13: "HTTP/1.1 204 No Content" 2024-03-20T13:10:01Z E! [inputs.exec] Error in plugin: exec: command timed out for command "/root/udp3.sh": % Total % Received % Xferd Average Spee 2024-03-20T13:09:30Z E! [inputs.exec] Error in plugin: exec: command timed out for command "/root/tcp3.sh": % Total % Received % Xferd Average Spee> **
I suspect for the metric error "Im having the syntax like this in the script
curl -i -XPOST 'http://150.240.76.167:8086/write?db=staging' --data-binary "$measurement_name,host=$host,sender_bitrate=sender_bitrate sender_bitrate=$sender_bitrate $timestamp"
can someone check this once or correct it ?
The exec plugin exists to run arbitrary commands, which then return metrics for telegraf to parse and generate metrics. The errors you are seeing are stating that the plugin cannot parse the resulting output successfully.
By default, the plugin expects metrics in the format of line protocol like:
But that can be changed via the
data_formatoption to one of the supported parsers. That explains the metric parse errors.The timeout errors are, as they imply, the command taking too long.
If you want to send metrics or data to InfluxDB, then I would suggest one of the following: