Public | Automated Build

Last pushed: 2 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.2 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 (33)
hauru
8 days ago

Hello Everyone.
I know someone already asked, but how to restart nagios using command line? I restarted using Web Interface but i have errors so I can not use it anymore.

I already tried service nagios restart but it doesn't work, neither does /etc/rc.d/init.d/nagios restart and /etc/init.d/nagios restart

krisavi
9 days ago

@rzancoper

Probably your firewall rules started after docker service start. For me restarting docker service fixed it, but I have to do it after every restart or configure order of boot somehow.

checkmarxdevops
17 days ago

Hi,
When I mounting local volumes to container it is failed to run properly
it is failed on : nagios: Error: Unable to create temp file '/opt/nagios/var/nagios.tmpkZqPAY' for writing status data: Permission denied

sree421
a month ago

Dont know my question is correct or not . i want to moniter my internal infra with this docker image . if i give my docker host machine ip in nagios configuration file will it work ? do i need to install nrpe packge for this image ?

rzancoper
a month ago

I was able to pull the image, but when I tried to execute it, I got the following error:

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

c620e3f3d7adfd0f5105f2d9ccaa5d4bde6645c94e8a3e37850e44ff8b76953b
docker: Error response from daemon: driver failed programming external connectivity on endpoint nagios4 (27f0acdba7a420f89833b5f4ad89ca285f273c19eee5c570b98f98f0dd6d656b): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 8080 -j DNAT --to-destination 172.17.0.3:80 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1)).

(PS: I already have another container running ... not sure if something can be conflicting ... as i am new to docker, I really don't know how to identify the issue)

raisiqueira
3 months ago

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

jasonrivers
3 months ago

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

jasonrivers
3 months 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
3 months 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
4 months ago

How to restart service nagios in the container?