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

Fixes the netdata path in order to repair influxdb feeding

This commit is contained in:
Martin GRUDLER 2024-05-03 11:11:14 +02:00
parent 2e8bedf897
commit b0b0cc492d
No known key found for this signature in database
4 changed files with 9 additions and 9 deletions

View file

@ -5,7 +5,7 @@ name = "Grafana"
description.en = "Metric & analytic dashboards for monitoring"
description.fr = "Tableaux de bord de supervision"
version = "10.2.3~ynh1"
version = "10.2.3~ynh2"
maintainers = ["JimboJoe"]

View file

@ -25,10 +25,10 @@ ynh_add_nginx_config
ynh_script_progression --message="Configuring Grafana and InfluxDB..." --weight=30
# If NetData is installed, configure it to feed InfluxDB
if [ -d "/opt/netdata/etc/netdata" ] ; then
netdata_conf="/opt/netdata/etc/netdata/exporting.conf"
if [ -d "/var/www/netdata/etc/netdata" ] ; then
netdata_conf="/var/www/netdata/etc/netdata/exporting.conf"
if [ ! -f "$netdata_conf" ] ; then
cp "/opt/netdata/usr/lib/netdata/conf.d/exporting.conf" /opt/netdata/etc/netdata
cp "/var/www/netdata/usr/lib/netdata/conf.d/exporting.conf" /var/www/netdata/etc/netdata
fi
sed -i '/^\[exporting:global\]$/,/^\[/ {
s/enabled = no/enabled = yes/

View file

@ -39,7 +39,7 @@ ynh_remove_nginx_config
ynh_script_progression --message="Removing various files..."
# If NetData is installed, configure it not to feed InfluxDB any more
netdata_conf="/opt/netdata/etc/netdata/exporting.conf"
netdata_conf="/var/www/netdata/etc/netdata/exporting.conf"
if [[ -f "$netdata_conf" ]] ; then
sed -i '/^\[exporting:global\]$/,/^\[/ {
s/enabled = yes/enabled = no/

View file

@ -40,10 +40,10 @@ ynh_add_nginx_config
ynh_script_progression --message="Configuring Grafana and InfluxDB..." --weight=3
# If NetData is installed, configure it to feed InfluxDB
if [ -d "/opt/netdata" ] ; then
netdata_conf="/opt/netdata/etc/netdata/exporting.conf"
if [ -d "/var/www/netdata" ] ; then
netdata_conf="/var/www/netdata/etc/netdata/exporting.conf"
if [ ! -f $netdata_conf ] ; then
cp /opt/netdata/usr/lib/netdata/conf.d/exporting.conf $netdata_conf
cp /var/www/netdata/usr/lib/netdata/conf.d/exporting.conf $netdata_conf
fi
sed -i '/^\[exporting:global\]$/,/^\[/ {
s/enabled = no/enabled = yes/
@ -67,7 +67,7 @@ EOF
fi
# Remove obsolete NetData backend if in use
netdata_conf="/opt/netdata/etc/netdata/netdata.conf"
netdata_conf="/var/www/netdata/etc/netdata/netdata.conf"
if [ -f "$netdata_conf" ] ; then
# If there is already a [backend] section
if [ -n "$(cat $netdata_conf | grep '\[backend\]')" ] ; then