Install guide

hakong edited this page Mar 1, 2016 · 30 revisions

This document explains how to install Adagios on different platforms. We recommend using redhat based platform because that is what the adagios developers use, so that one is tested the most.

The documentation assumes you want to use nagios as a monitoring engine. Adagios supports icinga and naemon equally well, but the documentation assumes nagios because that one is currently packaged by all the major distributions.

If you find any errors in these docs, please be so kind to either update the wiki or file an issue in the issue tracker.

Installing Naemon and Adagios on RHEL 7 or CentOS 7

https://github.com/opinkerfi/adagios/wiki/Naemon-and-Adagios-Install-Guide

The instructions below do not work properly for RHEL 7 or CentOS 7:

Installing on redhat based systems

This chapter shows how to install nagios and adagios from scratch on redhat, centos or fedora based machines.

# First install the opensource.is repositories
rpm -ihv http://opensource.is/repo/ok-release.rpm
yum update -y ok-release

# Redhat/Centos users need to install the epel repositories (fedora users skip this step)
yum install -y epel-release

# Install nagios, adagios and other needed packages
yum --enablerepo=ok-testing install -y pnp4nagios mk-livestatus nagios git adagios okconfig acl python-setuptools nagios-plugins-all

# If you don't know how to configure SElinux, put it in permissive mode:
sed -i "s/SELINUX=enforcing/SELINUX=permissive/" /etc/sysconfig/selinux
setenforce 0

# Now all the packages have been installed, and we need to do a little bit of
# configuration before we start doing awesome monitoring

# Lets make sure adagios can write to nagios configuration files, and that
# it is a valid git repo so we have audit trail
cd /etc/nagios/
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/nagios/* /etc/nagios/.git
setfacl -R -m group:nagios:rwx /etc/nagios/
setfacl -R -m d:group:nagios:rwx /etc/nagios/

# By default objects created by adagios will go to /etc/nagios/adagios so make sure that this directory exists and nagios.cfg contains a reference to this directory.
mkdir -p /etc/nagios/adagios
pynag config --append cfg_dir=/etc/nagios/adagios

# The status view relies on broker modules livestatus and pnp4nagios, so lets configure
# nagios.cfg to use those
pynag config --append "broker_module=/usr/lib64/nagios/brokers/npcdmod.o config_file=/etc/pnp4nagios/npcd.cfg"
pynag config --append "broker_module=/usr/lib64/mk-livestatus/livestatus.o /var/spool/nagios/cmd/livestatus"
pynag config --set "process_performance_data=1"

# Add nagios to apache group so it has permissions to pnp4nagios's session files
usermod -G apache nagios

# We need to restart both apache and nagios so new changes take effect
service nagios restart ; chkconfig nagios on
service httpd restart ; chkconfig httpd on
service npcd restart ; chkconfig npcd on

# We need to allow user nagios to restart nagios daemon

visudo 

# add the following three lines to the end of the file

# Nagios daemon control
Defaults:nagios !requiretty
nagios ALL = (root) NOPASSWD: /etc/init.d/nagios

Installing on debian based systems

This chapter shows how to install nagios, and adagios from scratch on debian based machines.

# Install the opensource.is repositories put a line like this into your apt sources
# If you do not have the file /etc/lsb-release on your system you have to know
# the codename for your distribution so you can add the right repositories
#
# For example: Ubuntu 12.04 is "precise" and Debian 7 is "wheezy"
source /etc/lsb-release
echo "deb http://opensource.is/repo/debian $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/opensource.is.list
apt-get update -y

# Install pre-requisits
apt-get install nagios3 git libapache2-mod-wsgi check-mk-livestatus pynag  -y

# Install adagios
apt-get install adagios --force-yes


# 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
cd /etc/nagios3/
git init
git add .
git commit -a -m "Initial commit"

# Make sure nagios group will always have write access to the configuration files:
chown -R nagios /etc/nagios3 /etc/adagios

# 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


# Restart nagios so new configuration changes are applied
service nagios3 restart

Installing from pip

If you are a python developer, or for some reasons the packages above do not work for you, adagios can be installed with pip by running the following command:

pip install django==1.4.15 pynag adagios

or

pip install --install-option="--prefix=/opt/adagios" django==1.4.15 pynag adagios

This assumes you already have a working monitoring environment and nagios, livestatus are already configured. Please consults the redhat or debian guides on how to configure everything.

Configuration on non-standard set ups

If you install adagios from packages, it will assume that you are running nagios from packages as well. If you have installed nagios in a different location, or if you are using another monitoring core (naemon, icinga, shinken, etc) there are a few things you need to configure.

Keep an eye our for the following, if you have non standard paths:

  • Adagios main config (/etc/adagios/adagios.conf) Make sure paths to nagios.cfg and the nagios binary are correct
  • Apache config file (/etc/httpd/conf.d/adagios.conf on rhel) - make sure adagios runs as a user that has access to the nagios.cfg file

Other resources