mirror of
https://github.com/YunoHost-Apps/grafana_ynh.git
synced 2024-09-03 20:36:29 +02:00
Add services to YunoHost monitoring
This commit is contained in:
parent
cc61abbecc
commit
5a5e633b2a
4 changed files with 13 additions and 1 deletions
|
@ -33,6 +33,10 @@ ynh_app_setting_set "$app" is_public "$is_public"
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
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
|
# If NetData is installed, configure it to feed InfluxDB
|
||||||
netdata_conf="/opt/netdata/etc/netdata/netdata.conf"
|
netdata_conf="/opt/netdata/etc/netdata/netdata.conf"
|
||||||
if [[ -f "$netdata_conf" ]] ; then
|
if [[ -f "$netdata_conf" ]] ; then
|
||||||
|
|
|
@ -35,6 +35,10 @@ if [[ -n "$(dpkg-query --status influxdb | grep -E "Status|deinstall")" ]] ; the
|
||||||
sudo rm /etc/apt/sources.list.d/influxdb.list
|
sudo rm /etc/apt/sources.list.d/influxdb.list
|
||||||
fi
|
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
|
# If NetData is installed, configure it not to feed InfluxDB any more
|
||||||
netdata_conf="/opt/netdata/etc/netdata/netdata.conf"
|
netdata_conf="/opt/netdata/etc/netdata/netdata.conf"
|
||||||
if [[ -f "$netdata_conf" ]] ; then
|
if [[ -f "$netdata_conf" ]] ; then
|
||||||
|
|
|
@ -13,7 +13,7 @@ domain=$(ynh_app_setting_get "$app" domain)
|
||||||
path=$(ynh_app_setting_get "$app" path)
|
path=$(ynh_app_setting_get "$app" path)
|
||||||
|
|
||||||
# Fix permissions
|
# Fix permissions
|
||||||
sudo chmod a+rx ./conf_grafana/_common.sh
|
sudo chmod a+r ./conf_grafana/_common.sh
|
||||||
|
|
||||||
# Source local helpers
|
# Source local helpers
|
||||||
source ./conf_grafana/_common.sh
|
source ./conf_grafana/_common.sh
|
||||||
|
|
|
@ -25,6 +25,10 @@ path=$(fix_path $path)
|
||||||
# There's currently nothing else to upgrade than packaging files
|
# There's currently nothing else to upgrade than packaging files
|
||||||
# as InfluxDB/Grafana updates are managed through APT
|
# 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
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||||
if [[ "$path" == "/" ]] ; then
|
if [[ "$path" == "/" ]] ; then
|
||||||
nginx_conf=$SRCPATH/../conf/nginx_root.conf
|
nginx_conf=$SRCPATH/../conf/nginx_root.conf
|
||||||
|
|
Loading…
Add table
Reference in a new issue