Skip to content

Install on RockyLinux 8 with python3

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

Tested on RL8

[me@rocky8t01d ~]$ cat /etc/redhat-release ;date
Rocky Linux release 8.8 (Green Obsidian)
Thu Jun  1 06:48:28 CDT 2023
[me@rocky8t01d ~]$

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

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-----------------------------------

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

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