Skip to content

Install Adagios from source using virtualenv

Garðar Þorsteinsson edited this page Oct 4, 2017 · 10 revisions

Install Adagios from source using virtualenv

De-activate SELinux

For now, Adagios on SELinux enabled machines does not work.

setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

Install nagios

sudo yum install nagios

Setup as a non-root user

Create user for Adagios with sudo access and access to nagios content

useradd -G nagios,wheel adagios

Become adagios user

su - adagios

Install/activate virtualenv for Python

sudo yum install git python-pip python-virtualenv
virtualenv adagios-virt
source adagios-virt/bin/activate

Install Django into virtualenv

pip install django==1.6
pip install simplejson

Pynag

Install

git clone git://github.com/pynag/pynag.git
cd pynag
pip install -e .

Test Pynag

$ pynag list where object_type=service
object_type          shortname            filename            
--------------------------------------------------------------------------------
service              None                 /etc/nagios/objects/templates.cfg
service              None                 /etc/nagios/objects/templates.cfg
service              localhost/PING       /etc/nagios/objects/localhost.cfg
----------x objects matches search condition-----------------------------------

Adagios

Download

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

Install

sudo cp -r adagios/etc/adagios /etc/adagios
sudo chown -R nagios:nagios /etc/adagios
sudo chmod g+w -R /etc/adagios
sudo mkdir -p /var/lib/adagios/userdata
sudo chown nagios:nagios /var/lib/adagios
sudo mkdir /etc/nagios/adagios
pip install -e .

Give nagios group rw access to everything (using acl for inheritance)

sudo setfacl -R -m d:g:nagios:rwx /etc/nagios
sudo setfacl -R -m g:nagios:rwx /etc/nagios
sudo chown -R nagios:nagios /etc/nagios

Add config directory to /etc/nagios/nagios.cfg

sudo pynag config --set cfg_dir=/etc/nagios/adagios

Add broker module for mk-livestatus if not already configured

# Nagios 3 with mk-livestatus module
pynag config --append "broker_module=/usr/lib64/mk-livestatus/livestatus.o /var/spool/nagios/cmd/livestatus"
# Nagios 4 with check-mk-livestatus
pynag config --append "broker_module=/usr/lib64/check_mk/livestatus.o /var/spool/nagios/cmd/livestatus"

Enable git version control for nagios

cd /etc/nagios
git init
git add .
git commit -a -m "Initial commit"

Start nagios and httpd

sudo service httpd restart
sudo service nagios restart

Start Adagios with Django developement server

cd ~/adagios/adagios
python manage.py runserver
or
python manage.py runserver host_ip_address:8000

Test connecting

[http://localhost:8000]

Clone this wiki locally