Skip to content

Install Adagios on Ubuntu 14.04

cmschube edited this page Oct 21, 2015 · 17 revisions

THIS IS A WORK IN PROGRESS. Please be kind!

Adagios on Ubuntu 14.04 LTS (1.6.1!!!)

Made Because I spent the better part of 2 days getting it working...

Many, many, many thanks to https://github.com/derekcat for the post here: https://github.com/opinkerfi/adagios/issues/409 you were soooo close dude!

Install pre-reqs:

apt-get install nagios3 git libapache2-mod-wsgi check-mk-livestatus

Install pip:

wget https://bootstrap.pypa.io/get-pip.py
(sudo) python get-pip.py

Install django, pynag, adagios:

pip install django==1.5 pynag adagios
ln -s /usr/local/lib/python2.7/dist-packages/adagios/etc/adagios/ /etc/adagios

If you plan on using the built-in status view in adagios you need these:

pynag config --append "broker_module=/usr/lib/check_mk/livestatus.o /var/lib/nagios3/rw/livestatus"

New objects created with adagios go here, make sure nagios is reading that directory

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

Create git repo which adagios uses for version control (you might need to configure git first)

cd /etc/nagios3/
git init
git config user.name "yourname"
git config user.email "yourname@yourdomain.com"
git add *
git commit -m "Initial commit"

Make sure nagios group will always have write access to the configuration files:

chown -R nagios /etc/nagios3 /etc/adagios /usr/local/lib/python2.7/dist-packages/adagios/etc/adagios/adagios.conf

Install pnp4nagios and get graphs working

apt-get install pnp4nagios -y
pynag config --set "process_performance_data=1"
pynag config --append "broker_module=/usr/lib/pnp4nagios/npcdmod.o config_file=/etc/pnp4nagios/npcd.cfg"
usermod -G www-data nagios
sed -i 's/RUN.*/RUN="yes"/' /etc/default/npcd
service npcd start
service nagios3 restart

Create apache conf file:

vi /etc/apache2/conf-available/adagios.conf

WSGISocketPrefix /var/run/apache2/wsgi
WSGIDaemonProcess adagios user=nagios group=nagios processes=1 threads=25 python-path=/usr/local/lib/python2.7/dist-packages/adagios:/usr/local/lib/python2.7/dist-packages/adagios/adagios
WSGIProcessGroup adagios
WSGIScriptAlias /adagios /usr/local/lib/python2.7/dist-packages/adagios/apache/adagios.wsgi

Alias /adagios/media /usr/local/lib/python2.7/dist-packages/adagios/media

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

Create Link to conf in conf-enabled

cd /etc/apache2/conf-enabled
ln -s ../conf-available/adagios.conf ./

Install simplejson:

pip install simplejson

Adagios needs these created:

mkdir /var/lib/adagios
mkdir /var/lib/adagios/userdata

Create a link to nagios3 directory (or just get everything configured right in the appropriate conf files)

ln -s /etc/nagios3 /etc/nagios

Edit adagios.conf to see nagios3 directory (This might be a little wrong, manually check!)

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
sed -i 's|nagios_binary="/usr/sbin/nagios"|nagios_binary="/usr/sbin/nagios3"|;' adagios.conf
sed -i 's|destination_directory = "/etc/nagios/adagios/"|destination_directory = "/etc/nagios3/adagios/"|;' adagios.conf

Restart all the things!:

service nagios3 restart
service apache2 restart

Make all the things startup on boot!:

update-rc.d nagios3 enable
update-rc.d apache2 enable

Set a password for the nagiosadmin user

htpasswd -c -b  /etc/nagios/htpasswd.users nagiosadmin thisisagoodpassword

Set a password/create your Adagios user

htpasswd -b  /etc/nagios/htpasswd.users yourusername superultrapassword

Copy in the sudoers file

cp /usr/local/lib/python2.7/dist-packages/adagios/etc/sudoers.d/adagios /etc/sudoers.d/

Edit it to be correct

visudo -f /etc/sudoers.d/adagios

Change:

nagios             ALL = (root) NOPASSWD: /etc/init.d/nagios

To:

nagios             ALL = (root) NOPASSWD: /etc/init.d/nagios3

Adagios should be at http://serveraddress/adagios

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:

Pnp filepath: /usr/share/pnp4nagios/html/index.php