Docker image for Nagios
Nagios Core 4.4.6 running on Ubuntu 20.04 LTS with NagiosGraph & NRPE
Product | Version |
---|---|
Nagios Core | 4.4.6 |
Nagios Plugins | 2.3.3 |
NRPE | 4.0.3 |
NCPA | 2.3.1 |
NSCA | 2.10.0 |
Nagios Configuration lives in /opt/nagios/etc NagiosGraph configuration lives in /opt/nagiosgraph/etc
docker pull jasonrivers/nagios:latest
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 \
-v /path-to-nagiosgraph-var:/opt/nagiosgraph/var \
-v /path-to-nagiosgraph-etc:/opt/nagiosgraph/etc \
-p 0.0.0.0:8080:80 jasonrivers/nagios:latest
Run with a postfix setup for an externam authenticated mail relay server (such as Google mail SMTP server):
docker run --name nagios4 \
-e SYSTEM_TIMEZONE=Europe/Paris \
-e MAIL_RELAY_USERNAME=<my.username>@gmail.com \
-e MAIL_RELAY_PASSWORD=<my.password> \
-e MAIL_RELAY_HOST=[smtp.gmail.com]:587 \
-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.
There are a number of environment variables that you can use to adjust the behaviour of the container:
Environamne Variable | Description |
---|---|
MAIL_RELAY_HOST | set Postfix relayhost |
MAIL_RELAY_USERNAME | set Postfix relay username |
MAIL_RELAY_PASSWORD | set Postfix relay password |
MAIL_MYNETWORKS | set Postfix mynetworks value(s) |
MAIL_INET_PROTOCOLS | set the inet_protocols in postfix |
NAGIOS_FQDN | set the server Fully Qualified Domain Name in postfix |
NAGIOS_TIMEZONE | set the timezone of the server |
For best results your Nagios image should have access to both IPv4 & IPv6 networks
The default credentials for the web interface is nagiosadmin
/ nagios
- Nagios nrpe [http://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details]
- Nagiosgraph [http://exchange.nagios.org/directory/Addons/Graphing-and-Trending/nagiosgraph/details]
- JR-Nagios-Plugins - custom plugins I've created [https://github.com/JasonRivers/nagios-plugins]
- WL-Nagios-Plugins - custom plugins from William Leibzon [https://github.com/willixix/WL-NagiosPlugins]
- JE-Nagios-Plugins - custom plugins from Justin Ellison [https://github.com/justintime/nagios-plugins]
- DF-Nagios-Plugins - custom pluging for MSSQL monitoring from Dan Fruehauf [https://github.com/danfruehauf/nagios-plugins]
- check-mqtt - custom plugin for mqtt monitoring from Jan-Piet Mens [https://github.com/jpmens/check-mqtt.git]