Sign inSign up

toutzn/nagios

By toutzn

Updated 4 months ago

Nagios Core with Nagiosgraph, check_nrpe, custom checks

Image
0

1.8K

toutzn/nagios repository overview

Docker-Nagios

Docker image for Nagios

Build and Push to Docker Hub Docker Pulls Docker Image Version

Nagios Core running on Ubuntu 24.04 LTS with NagiosGraph & NRPE

ProductVersion
Nagios Core4.5.12
Nagios Plugins2.5
NRPE4.1.3
NCPA3.4.0
NSCA2.10.3
NagiosTV0.9.11
Configurations

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

Install
docker pull toutzn/nagios:latest
Running

Run with the example configuration with the following:

docker run --name nagios4 -p 0.0.0.0:8080:80 toutzn/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 \
  -v /path-to-nagiosgraph-var:/opt/nagiosgraph/var \
  -v /path-to-nagiosgraph-etc:/opt/nagiosgraph/etc \
  -p 0.0.0.0:8080:80 toutzn/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.

Docker Compose

Create a docker-compose.yml file:

services:
  nagios:
    image: toutzn/nagios:latest
    ports:
      - "8080:80"
    volumes:
      - nagiosetc:/opt/nagios/etc
      - nagiosvar:/opt/nagios/var
      - customplugins:/opt/Custom-Nagios-Plugins
      - nagiosgraphvar:/opt/nagiosgraph/var
      - nagiosgraphetc:/opt/nagiosgraph/etc
    environment:
      - NAGIOS_TIMEZONE=Europe/Berlin
      # - MAIL_RELAY_HOST=mail.example.com
      # - NAGIOS_FQDN=nagios.example.com

volumes:
  nagiosetc:
  nagiosvar:
  customplugins:
  nagiosgraphvar:
  nagiosgraphetc:

Then start with:

docker compose up -d

Nagios will be available at http://localhost:8080 with credentials nagiosadmin / nagios.

To upgrade to a newer image version without losing configuration:

docker compose pull
docker compose up -d

There are a number of environment variables that you can use to adjust the behaviour of the container:

Environment VariableDescription
MAIL_RELAY_HOSTSet Postfix relayhost
MAIL_INET_PROTOCOLSset the inet_protocols in postfix
NAGIOS_FQDNset the server Fully Qualified Domain Name in postfix
NAGIOS_TIMEZONEset the timezone of the server

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

Tag summary

Content type

Image

Digest

sha256:666b9e180

Size

312.9 MB

Last updated

4 months ago

docker pull toutzn/nagios