#!/bin/bash # Retrieve arguments domain=$1 path=$2 sudo yunohost app checkurl $domain$path -a shinken if [[ ! $? -eq 0 ]]; then exit 1 fi # Create user id -u shinken &>/dev/null || sudo useradd -d /home/yunohost.app/shinken shinken # Install required packages sudo apt-get install -y -qq python-cherrypy3 python-pip python-pycurl nagios-plugins mongodb sudo bash -c "pip install shinken pymongo>=3.0.3 requests arrow bottle==0.12.8 passlib" # prepare shinken sudo su -c "shinken --init" -l shinken sudo su -c "shinken install webui2" -l shinken # Remove trailing "/" for next commands path=${path%/} # Monitor service sudo yunohost service add shinken # Configure Nginx sudo sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/shinken.conf # configure shinken sudo rm /etc/shinken/modules/webui2.cfg sudo cp ../conf/webui2.cfg /etc/shinken/modules/webui2.cfg sudo rm /etc/shinken/brokers/broker-master.cfg sudo cp ../conf/broker-master.cfg /etc/shinken/brokers/broker-master.cfg # Fix #407: 404 on Dashboard currently sed 's/routes/route/g' /var/lib/shinken/modules/webui2/plugins/dashboard/dashboard.py > /tmp/dashboard.py sudo mv /tmp/dashboard.py /var/lib/shinken/modules/webui2/plugins/dashboard/dashboard.py # Add new shinken service sudo update-rc.d shinken defaults # Generate SSOwat conf sudo service nginx restart echo $? sudo yunohost app ssowatconf sudo service shinken start