I have installed the telegraf snap on mint 20.1 - I dont know how I am supposed to edit the telegraf.conf config file (usually installed in /etc/).
I have found an instance of it at /snap/telegraf/325/etc/telegraf.conf
…but that is readonly.
…is there some place where documentation pertaining to specific snaps is typically kept ?
ogra
October 20, 2021, 6:54am
2
try the file in
/var/snap/telegraf/current/etc/
striep
November 5, 2022, 7:56pm
3
Hi,
I know this thread is over a year old, but the title is exactly what I’m facing.
I installed the telegraf snap on Raspbian GNU/Linux 11 (bullseye) via
root@raspi # snap install telegraf --classic
I tried to edit the (only) configuration file at /snap/telegraf/468/etc/telegraf.conf, but that is read only.
root@raspi:~# find / -name telegraf.conf
/snap/telegraf/468/etc/telegraf.conf
There is no config file under the path mentioned by ‘ogra’.
Any suggestions apart from removing the snap?
ogra
November 5, 2022, 9:33pm
4
the configure hook (which runs at snap install time) seems to copy it in place:
#!/bin/sh # Copy the config file if needed, update permissions, and create telegraf.d cp -pn $SNAP/etc/telegraf.conf $SNAP_DATA/telegraf.conf mkdir -p $SNAP_DATA/telegraf.d chown --quiet snap_daemon: $SNAP_DATA/telegraf.conf $SNAP_DATA/telegraf.d $SNAP_DATA/telegraf.d/*.conf chmod --quiet 640 $SNAP_DATA/telegraf.conf $SNAP_DATA/telegraf.d/*.conf chmod 755 $SNAP_DATA/telegraf.d
are you sure there is nothing in /var/snap/telegraf/current/
?
striep
November 6, 2022, 8:37am
5
yes, as you can see here:
root@raspi:~# ls -l /var/snap/telegraf/current
lrwxrwxrwx 1 root root 3 Nov 5 20:37 /var/snap/telegraf/current -> 468
root@raspi:~# ls -l /var/snap/telegraf/current/
total 0
root@raspi:~# ls -l /var/snap/telegraf/468/
total 0