Docker Installation Guide

This page details how to install nagrestonf using Docker, which is available for most operating systems.

Before installation

The instructions on this page are for installing Nagios and Nagrestconf on a computer that already has Docker installed. Please search the Internet for the best/easiest way to install Docker on your OS.

Overview

Installation consists of the following steps:

  • Install a compatible Nagios container from Docker Hub.
  • Set the password for the Nagios container.
  • Install the Nagrestconf container from Docker Hub.
  • Set the password for the Nagrestconf container.
  • Test Nagrestconf and Nagios.
  • Create an initial configuration.

SEE ALSO: mclarkson/nagrestconf-docker for alternative installation options.

Install a compatible Nagios container from Docker Hub.

Open a terminal window or ssh session on the target server then install Nagios using the following commands:

docker run -d --name nagios -v /usr/local/nagios -p 25 -p 8080:80 quantumobject/docker-nagios

Set the password for the Nagios container.

Change the password used to connect to the Nagios Web UI:

docker exec -it nagios /bin/bash

htpasswd /usr/local/nagios/etc/htpasswd.users nagiosadmin

exit

Install the Nagrestconf container from Docker Hub.

The following commands will get the custom configuration and start the nagrestconf container:

wget https://raw.githubusercontent.com/mclarkson/nagrestconf-docker/master/quantumobject_docker-nagios.env

docker run -d -p 8880:8080 --name nagrestconf -v /tmp \
    --volumes-from nagios --env-file quantumobject_docker-nagios.env \
    mclarkson/nagrestconf

Then start the nagrestconf-restarter container:

docker run -d --name nagrestconf-restarter --volumes-from nagrestconf mclarkson/nagrestconf-restarter

Set the password for the Nagrestconf container.

Change the password used to connect to the Nagios Web UI:

docker exec -it nagrestconf /bin/bash

htpasswd /usr/local/nagios/etc/htpasswd.users nagrestconfadmin

exit

Test Nagrestconf and Nagios

The nagrestsconf and nagios web interfaces should be accessible now.

Log into nagrestconf with user 'nagrestconfadmin', and the password that was set above.

The nagrestconf interface, at 'http://server:8880/nagrestconf', will look like the following screen shot.

Log into nagios with user 'nagiosadmin', and the password that was set above.

The nagios interface, at 'http://server/nagios3', will look like the following screen shot.

Create an initial configuration

To create a simple test configuration use a script that makes REST calls, or use the 'Backup/Restore' button in the nagrestconf GUI. The latter method will be used in this guide.

Create an initial configuration using 'Backup/Restore'

An example configuration can be downloaded from this link, then log into nagrestconf and use the 'Backup/Restore' button.

Click 'Close' in the 'Backup/Restore' dialog then refresh the page.

The new configuration will not appear in the Nagios Web interface until the 'Apply Changes' button is clicked, and then applied.

That's it!

 

comments powered by Disqus