Telegraf losts changes in input,output plugins after system restart

telegraf
influxdb

#1

I’m using Telegraf(which is running on Raspberry-pi 3B) to collect data via inputs.mqtt_consumer and pushing data into influxdb (which is on server) using output.influxdb.

Everything is working as per expectation and Telegraf is able to push mqtt data into influxdb.
So, now if i update any of the plugin and restarts telegraf, modifications becomes successfully active and everything works fine.
But, as soon as I turn off my Raspberry-Pi and power-on/restarts it, all these modifications are lost.

For example :

  1. I have current inputs.mqtt_consumer in telegraf.conf (/etc/telegraf/telegraf.conf) which looks like:
[[inputs.mqtt_consumer]]
#   ## MQTT broker URLs to be used. The format should be scheme://host:port,
#   ## schema can be tcp, ssl, or ws.
    servers = ["tcp://localhost:1883"]
#   ## MQTT QoS, must be 0, 1, or 2
    qos = 2
#   ## Topics to subscribe
    topics = [ "Sensor/temperature/#" ]
  1. Now if i change, qos or update topics.
[[inputs.mqtt_consumer]]
#   ## MQTT broker URLs to be used. The format should be scheme://host:port,
#   ## schema can be tcp, ssl, or ws.
    servers = ["tcp://localhost:1883"]
#   ## MQTT QoS, must be 0, 1, or 2
    qos = 1
#   ## Topics to subscribe
    topics = [ "Sensor/pressure/#" ]

and restarts telegraf using
sudo systemctl restart telegraf
3. telegraf works correctly with new qos value 1 and new topic “Sensor/pressure/#”.
4. Now, if i restarts raspberry-pi, all these changes in telegraf.conf are lost. It looks like exactly as same as before, which is not expected:

[[inputs.mqtt_consumer]]
#   ## MQTT broker URLs to be used. The format should be scheme://host:port,
#   ## schema can be tcp, ssl, or ws.
    servers = ["tcp://localhost:1883"]
#   ## MQTT QoS, must be 0, 1, or 2
    qos = 2
#   ## Topics to subscribe
    topics = [ "Sensor/temperature/#" ]

There are no any other instances of telegraf.conf on rasp-pi.
Thanks in advance and Looking forward to hear from you.


#2

Do you have any config management running on this like Chef/Puppet? Telegraf doesn’t edit it’s own config files so it makes me believe that something else is updating it on reboot