Hy everyone i try to use this “piped command” on the exec input :
but i have this error :
2018-04-04T12:53:50Z E! Error in plugin [inputs.exec]: exec: exit status 2 for command ‘curl --user admin:password http:// 192.168.1.21/ISAPI/System/status -s | xml_grep ‘cpuUtilization’ --text_only’: curl: option --text_only: is unknown…
Command works well in CLI :
[root@influxDB ~]# curl --user admin:password http:// 192.168.1.21/ISAPI/System/status -s | xml_grep ‘cpuUtilization’ --text_only
43
On my telegraf.conf :
[[inputs.exec]]
commands = [“curl --user admin:password http:// 192.168.1.21/ISAPI/System/status -s | xml_grep ‘cpuUtilization’ --text_only”]
name_override = “Hikvision_cpu”
data_format = “value”
data_type = “integer”