diff --git a/scripts/install b/scripts/install index aaa569d..8e7ad64 100644 --- a/scripts/install +++ b/scripts/install @@ -33,6 +33,10 @@ ynh_app_setting_set "$app" is_public "$is_public" # Install dependencies install_dependencies +# Declare services for YunoHost monitoring +sudo yunohost service add influxdb +sudo yunohost service add grafana-server --log "/var/log/grafana/grafana.log" + # If NetData is installed, configure it to feed InfluxDB netdata_conf="/opt/netdata/etc/netdata/netdata.conf" if [[ -f "$netdata_conf" ]] ; then diff --git a/scripts/remove b/scripts/remove index d7e69a4..455205e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -35,6 +35,10 @@ if [[ -n "$(dpkg-query --status influxdb | grep -E "Status|deinstall")" ]] ; the sudo rm /etc/apt/sources.list.d/influxdb.list fi +# Remove services from YunoHost monitoring +sudo yunohost service remove influxdb +sudo yunohost service remove grafana-server + # If NetData is installed, configure it not to feed InfluxDB any more netdata_conf="/opt/netdata/etc/netdata/netdata.conf" if [[ -f "$netdata_conf" ]] ; then diff --git a/scripts/restore b/scripts/restore index c9389b4..a29225d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -13,7 +13,7 @@ domain=$(ynh_app_setting_get "$app" domain) path=$(ynh_app_setting_get "$app" path) # Fix permissions -sudo chmod a+rx ./conf_grafana/_common.sh +sudo chmod a+r ./conf_grafana/_common.sh # Source local helpers source ./conf_grafana/_common.sh diff --git a/scripts/upgrade b/scripts/upgrade index e59be3f..3cd395e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,6 +25,10 @@ path=$(fix_path $path) # There's currently nothing else to upgrade than packaging files # as InfluxDB/Grafana updates are managed through APT +# Declare services for YunoHost monitoring +sudo yunohost service add influxdb +sudo yunohost service add grafana-server --log "/var/log/grafana/grafana.log" + # Modify Nginx configuration file and copy it to Nginx conf directory if [[ "$path" == "/" ]] ; then nginx_conf=$SRCPATH/../conf/nginx_root.conf