Skip to content

Installing Adagios from source on Debian

Pall Sigurdsson edited this page Jul 18, 2013 · 37 revisions

Installing adagios

Install nagios3 and mk-livestatus if you don't already have it:

apt-get install nagios3 check-mk-livestatus

Install Dependencies:

apt-get install git apache2 libapache2-mod-wsgi python-django python-simplejson pnp4nagios libgmp-dev python-dev
apt-get install pynag python-paramiko

Get latest bleeding-edge source from github:

cd /opt/
git clone https://github.com/opinkerfi/adagios.git

Create a configuration directory for adagios and edit paths:

cp -r /opt/adagios/adagios/etc/adagios /etc/
chown -R nagios /etc/adagios/
cd /etc/adagios
sed -i 's|/etc/nagios/nagios.cfg|/etc/nagios3/nagios.cfg|;' adagios.conf
sed -i 's|sudo /etc/init.d/nagios|sudo /etc/init.d/nagios3|;' adagios.conf
sed -i 's|nagios_url = "/nagios"|nagios_url = "/nagios3"|;' adagios.conf

Enable mk-livestatus broker_module and restart nagios to load new configuration:

pynag config --append "broker_module=/usr/lib/check_mk/livestatus.o /var/lib/nagios3/rw/livestatus"
pynag config --append cfg_dir=/etc/adagios
service nagios3 reload

Configure Apache to load Adagios in wsgi:

cat << EOF > /etc/apache2/conf.d/adagios.conf
WSGISocketPrefix /var/run/apache2/wsgi
WSGIDaemonProcess adagios user=nagios group=nagios processes=1 threads=25 python-path=/opt/adagios:/opt/adagios/adagios
WSGIProcessGroup adagios
WSGIScriptAlias /adagios /opt/adagios/adagios/apache/adagios.wsgi

Alias /adagios/media /opt/adagios/adagios/media

<Location /adagios>
   AuthName "Adagios Access"
   AuthType Basic
   AuthUserFile /etc/nagios3/htpasswd.users
   Require valid-user
</Location>
EOF

Create your user, replace adagios with your username and securepassword with a randomly generated, secure password:

cd /etc/nagios3
htpasswd -b -c htpasswd.users adagios securepassword

Restart Apache:

service apache2 restart

Open your browser and go to http://127.0.0.1/adagios

Installing okconfig plugin

The okconfig plugin, which is required if you want to use adagios' REST API is installed as follows:

git clone git://github.com/opinkerfi/okconfig.git
cd okconfig
sudo python setup.py install
okconfig init
# Use this to verify installation
okconfig verify

Once installed restart Apache in order to load all the new modules:

service apache2 restart

Open your browser and go to http://127.0.0.1/adagios, you should see a new item named "Okconfig" in the top toolbar.

Final adjustments

Once you've opened your Adagios site, make sure that the binaries and configurations are correct as well. To go about this, head to the top-right area of your Adagios site, next to your Adagios username a white gear will appear, click said gear and then click Settings.

Once inside the Settings pane, replace the following fields for the provided values:

Destination directory: /etc/nagios3/adagios/
Nagios binary: /usr/sbin/nagios3
Pnp filepath: /usr/share/pnp4nagios/html/index.php

Once completed, click save and proceed to create the adagios folder for objects

mkdir /etc/nagios3/adagios
pynag config --append cfg_dir=/etc/nagios3/adagios

And to conclude, restart the Apache server as well as Nagios

service apache2 restart
service nagios3 restart