Skip to content

Install on Fedora 17 with python2

T.J. Yang edited this page Jun 1, 2023 · 1 revision

tested on Fedora 17 x86_64

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

Install Django

sudo yum install python-simplejson
sudo yum install Django

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

pynag

Right now the fedora version does not contain the version needed, so we install from git clone

Install

git clone git://github.com/pynag/pynag.git
cd pynag
sudo ./setup.py install

Test

$ 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
service              localhost/Root Partition /etc/nagios/objects/localhost.cfg
service              localhost/Current Users /etc/nagios/objects/localhost.cfg
service              localhost/Swap Usage /etc/nagios/objects/localhost.cfg
service              localhost/Total Processes /etc/nagios/objects/localhost.cfg
service              localhost/Current Load /etc/nagios/objects/localhost.cfg
service              localhost/SSH        /etc/nagios/objects/localhost.cfg
service              localhost/HTTP       /etc/nagios/objects/localhost.cfg
----------10 objects matches search condition-----------------------------------

Adagios

Download

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

Install

sudo cp -r etc/adagios /etc/adagios
sudo chown -R nagios:nagios /etc/adagios
sudo chmod g+w -R /etc/adagios
sudo mkdir /var/lib/adagios
sudo chown nagios:nagios /var/lib/adagios
sudo mkdir /etc/nagios/adagios
# Add config directory to /etc/nagios/nagios.cfg
sudo pynag config --set cfg_dir=/etc/nagios/adagios

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

Enable git version control for nagios

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

Run the server

cd ~/adagios/adagios
./manage.py runserver

Test connecting

[http://localhost:8000]

Adjust settings

Go to Misc -> Settings Adjust "nagios url" appropriately, eg http://localhost/nagios

Start nagios and httpd

service httpd start
service nagios start