1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grafana_ynh.git synced 2024-09-03 20:36:29 +02:00

fix netdata and influxdb configuration

This commit is contained in:
Johan Grande 2021-03-11 23:34:50 +01:00 committed by GitHub
parent 8e3209f3e0
commit 178bcb94d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -100,8 +100,12 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Configuring Grafana and InfluxDB..." --weight=30
# If NetData is installed, configure it to feed InfluxDB
netdata_conf="/opt/netdata/etc/netdata/exporting.conf"
if [ -f "$netdata_conf" ] ; then
netdata_conf_dir="/opt/netdata/etc/netdata"
if [ -d "$netdata_conf_dir" ] ; then
netdata_conf="$netdata_conf_dir/exporting.conf"
if [ ! -f "$netdata_conf" ] ; then
env EDITOR=true "$netdata_conf_dir/edit-config" exporting.conf
fi
sed -i '/^\[exporting:global\]$/,/^\[/ {
s/enabled = no/enabled = yes/
s/# update every = 10/update every = 60/
@ -128,7 +132,7 @@ fi
# Configure InfluxDB
if [ -f /etc/influxdb/influxdb.conf ] ; then
sed -i '/^\[\[opentsdb\]\]$/,/^\[/ s/enabled = false/enabled = true/' /etc/influxdb/influxdb.conf
sed -i '/^\[\[opentsdb\]\]$/,/^\[/ s/^[#:space:]*enabled = \(true\|false\)/enabled = true/' /etc/influxdb/influxdb.conf
else
[ -d /etc/influxdb ] || mkdir /etc/influxdb
cp ../conf/influxdb.conf /etc/influxdb