Sign inSign up

tronyx/nagios

By tronyx

Updated 8 days ago

Fork of JasonRivers image to incorporate various improvements.

Image
Monitoring & observability
1

50K+

tronyx/nagios repository overview

Docker-Nagios

GitHub Workflow Status CodeFactor Docker Pulls Docker Image Size with architecture (latest by date/latest semver) Docker Image Size with architecture (latest by date/latest semver) GitHub

Notes

Fork of JasonRivers Docker Nagios image to incorporate various improvements from the open PRs on his repo along with other updates and quality of life improvements.

Incorporated PRs

Listing these as I wish to give the original users credit for their work.

Changes That I've Made

Things that I have changed/updated/added to date:

  • Updated the image to Ubuntu 26.04 LTS
  • Updated Nagios Core to the current latest
  • Updated Nagios Plugins to current latest
  • Updated NRPE to current latest
  • Updated NCPA to current latest
  • Updated NSCA to current latest
  • Added NagiosTV
  • Built multi-arch images (amd64 & arm64)
  • Implemented multi-stage build to reduce the final image size by nearly 50%

Information

Nagios Core running on Ubuntu 26.04 LTS with NagiosGraph, NRPE, NCPA, NSCA, and NagiosTV.

ProductVersion
Nagios Core4.5.14
Nagios Plugins2.5
NRPE4.1.3
NCPA3.4.3
NSCA2.10.3
NagiosTV0.9.11

The images can be found on the Docker Hub Registry or the GitHub Registry.

Configurations
  • Nagios configuration is stored in the /opt/nagios/etc directory.
  • NagiosGraph configuration is stored in the /opt/nagiosgraph/etc directory.
  • NSCA configuration is stored in the /opt/nagios/etc directory.
Pull the Image
docker pull tronyx/nagios
docker pull ghcr.io/tronyx/nagios
Versions/Docker Tags
BranchImage TagNotes
MasterlatestMaster branch that is known to be stable.
DevelopdevelopMy testing/development branch for updates.

I may spawn other branches for testing from time to time, IE: new Ubuntu LTS or something similar, but for the most part these are the main branches.

Running

Run the container with the example configuration using the following docker commands:

docker run --name nagios -p 8080:80 tronyx/nagios
docker run --name nagios -p 8080:80 ghcr.io/tronyx/nagios

Alternatively you can use external Nagios configuration & log data with the following docker commands:

docker run --name nagios  \
  -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 8080:80 tronyx/nagios

docker run --name nagios  \
  -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 8080:80 ghcr.io/tronyx/nagios

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

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 the best results your Nagios container should have access to both IPv4 & IPv6 networks.

Credentials

The default credentials for the web interface are:

UsernamePassword
nagiosadminnagios

NAGIOSADMIN_USER/NAGIOSADMIN_PASS only seed /opt/nagios/etc/htpasswd.users the first time the container starts (i.e. when that file doesn't already exist, such as on a fresh named volume). Changing these env vars on a container that already has a populated etc volume has no effect on the stored password.

To change the password on an existing container:

docker exec -it nagios htpasswd -b /opt/nagios/etc/htpasswd.users nagiosadmin '<new-password>'
Health Check

The image defines a Docker HEALTHCHECK that reports unhealthy unless both of the following succeed:

  • Apache answers an HTTP request on http://localhost/ — any response counts, including a 401/403, since the check only cares that Apache itself is up and processing requests.
  • runit reports the nagios service as up (sv check /etc/service/nagios).
Extra Plugins
Name/LinkDescription
Nagios NRPERemotely execute Nagios plugins on other Linux/Unix machines
Nagios NCPACross-platform monitoring agent
Nagios NSCAIntegrate passive alerts and checks from remote machines and applications
NagiosgraphDisplays data in Nagios trends, as popups for hosts and services
JR-Nagios-PluginsCustom plugins from Jason Rivers
WL-Nagios-PluginsCustom plugins from William Leibzon
JE-Nagios-PluginsCustom plugins from Justin Ellison
DF-Nagios-PluginsCustom pluging for MSSQL monitoring from Dan Fruehauf
check-mqttCustom plugin for mqtt monitoring from Jan-Piet Mens
NagiosTVMonitor your Nagios server on a wall-mounted TV
check_apcCheck APC for status, health, and load

Tag summary

Content type

Image

Digest

sha256:4138bde77

Size

218.7 MB

Last updated

14 days ago

docker pull tronyx/nagios