Public | Automated Build

Last pushed: 4 days ago
Short Description
Nagios Core with Nagiosgraph, check_nrpe, custom checks & XMPP Notifications
Full Description

Docker-Nagios

Docker image for Nagios

Build Status:

Nagios Core 4.3.1 running on Ubuntu 16.04 LTS with NagiosGraph & NRPE

Configurations

Nagios Configuration lives in /opt/nagios/etc
NagiosGraph configuration lives in /opt/nagiosgraph/etc

Install

docker pull jasonrivers/nagios:latest

Running

Run with the example configuration with the following:

docker run --name nagios4 -p 0.0.0.0:8080:80 jasonrivers/nagios:latest

alternatively you can use external Nagios configuration & log data with the following:

docker run --name nagios4  \
  -v /path-to-nagios/etc/:/opt/nagios/etc/ \
  -v /path-to-nagios/var:/opt/nagios/var/ \
  -v /path-to-custom-plugins:/opt/Custom-Nagios-Plugins \
  -p 0.0.0.0:8080:80 jasonrivers/nagios:latest

Note: The path for the custom plugins will be /opt/Custom-Nagios-Plugins, you will need to reference this directory in your configuration scripts.

For best results your Nagios image should have access to both IPv4 & IPv6 networks

Credentials

The default credentials for the web interface is nagiosadmin / nagios

Extra Plugins

Docker Pull Command
Owner
jasonrivers
Source Repository

Comments (28)
raisiqueira
a month ago

@fbanespo Use -d to run in background.
Ex.: docker run -d ..........

jasonrivers
a month ago

@pocok
The latest build should now include check_dns and also check_dig

jasonrivers
a month ago

@pocok
I will look into why it's not being built. It should build everything it can from https://github.com/nagios-plugins/nagios-plugins

@ronycar
you can restart the Nagios service when you're logged in from the web panel under "Process Info" > "Restart the Nagios process"

@smdb21
I'm not sure I understand? you can use any text editor you want to configure Nagios cfg files.

@fbanespo
use -d on the docker run command: E.G:
docker run -d --name nagios4 -p 0.0.0.0:8080:80 jasonrivers/nagios:latest

pocok
a month ago

Does anyone know why the check_dns command is not available?

Its not compiled when I create the image by my own, neither when i download the image from hub.docker.com and run the image.

ronycar
2 months ago

How to restart service nagios in the container?

smdb21
2 months ago

Which text editor can I use with this image? thanks!

fbanespo
2 months ago

Hi Jason,
I have a problem when launch the docker the system still like in hangout but it works. To re-enable my terminal I have to do CTRL-C. I made something wrong?
Thanks
Tony

tony@jupiter:~$ docker run --name nagios4 -p 0.0.0.0:8080:80 jasonrivers/nagios:latest
Adding password for user nagiosadmin
Started runsvdir, PID is 10

Nagios Core 4.3.0
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 02-21-2017
License: GPL

Website: https://www.nagios.org
Nagios 4.3.0 starting... (PID=15)
Local time is Thu Feb 23 12:37:02 UTC 2017
nerd: Channel hostchecks registered successfully
nerd: Channel servicechecks registered successfully
nerd: Channel opathchecks registered successfully
nerd: Fully initialized and ready to rock!
wproc: Successfully registered manager as @wproc with query handler
wproc: Registry request: name=Core Worker 22;pid=22
wproc: Registry request: name=Core Worker 24;pid=24
wproc: Registry request: name=Core Worker 23;pid=23
wproc: Registry request: name=Core Worker 21;pid=21
WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
WARNING: The normal_check_interval attribute is deprecated and will be removed in future versions. Please use check_interval instead.
Successfully launched command file worker with pid 30

tgenc
2 months ago

running perfect!

gallaecio
3 months ago

Because the image defines a VOLUME line, it is not possible to write a Dockerfile that inherits from this image and performs additional changes on any path specified in the VOLUME line.

According to the Docker documentation, “If any build steps change the data within the volume after it has been declared, those changes will be discarded.” — https://docs.docker.com/engine/reference/builder/#/volume

This makes it impossible, for example, to serve Nagios with a different URL prefix, as described in https://www.mopar4life.com/nagios-4-0-2-change-default-url-linux-centos-6/

The only workaround is to copy & paste the Dockerfile contents and remove the VOLUME line.

I suggest that you remove that line and suggest in the documentation that users mount those paths in a volume.

lordmike
4 months ago

For anyone searching. Default username/password is:

nagiosadmin / nagios