Nagios Core serves as the basic event scheduler, event processor, and alert manager for elements that are monitored. It features several APIs that are used to extend its capabilities to perform additional tasks, is implemented as a daemon written in C for performance reasons, and is designed to run natively on Linux/*nix systems.
Product / Latest | Installed |
---|---|
4.5.9 | |
2.4.12 | |
3.1.2 | |
4.1.3 | |
2.10.3 | |
2.3.8 | |
1.0.0 | |
0.9.2 | |
3.2.0.2 |
- Access the webui at
http://<your-ip>:8080
, for more information check out Nagios Core. - Access NagiosTV webui at
http://<your-ip>:8080/nagiostv
.
docker pull ghcr.io/arajczy/nagios:latest
docker run \
-d \
--name=nagios \
--hostname= `#optional` \
--cap-add=NET_RAW \
--env MAIL_ADDRESS= `#optional` \
--env MAIL_PASS= `#optional` \
--env MAIL_RELAY_HOST= `#optional` \
--env NAGIOS_FQDN= `#optional` \
--env NAGIOSADMIN_USER= `#optional` \
--env NAGIOSADMIN_PASS= `#optional` \
--env NAGIOS_THEME= `#optional` \
--env NAGIOS_STARTPAGE= `#optional` \
--env TZ=Etc/UTC \
--publish=8080:80 \
--volume /path/to/config:/usr/local/nagios/etc \
--volume /path/to/log:/usr/local/nagios/var \
--volume /path/to/themes:/usr/local/nagios/themes \
ghcr.io/arajczy/nagios:latest
podman run \
-d \
--replace \
--name=nagios \
--hostname= `#optional` \
--cap-add=NET_RAW \
--env MAIL_ADDRESS= `#optional` \
--env MAIL_RELAY_HOST= `#optional` \
--env NAGIOS_FQDN= `#optional` \
--env NAGIOSADMIN_USER= `#optional` \
--env NAGIOS_THEME= `#optional` \
--env NAGIOS_STARTPAGE= `#optional` \
--tz=Etc/UTC \
--publish=8080:80 \
--secret mail-pass,type=env,target=MAIL_PASS \
--secret nagiosadmin-pass,type=env,target=NAGIOSADMIN_PASS \
--volume /path/to/config:/usr/local/nagios/etc \
--volume /path/to/log:/usr/local/nagios/var \
--volume /path/to/themes:/usr/local/nagios/themes \
ghcr.io/arajczy/nagios:latest
---
version: '3'
services:
nagios:
image: arajczy/nagios:latest
hostname: nagios.example.com
cap_add:
- NET_RAW
environment:
MAIL_ADDRESS: #optional
MAIL_PASS: #optional
MAIL_RELAY_HOST: #optional
NAGIOS_FQDN: #optional
NAGIOSADMIN_USER: #optional
NAGIOSADMIN_PASS: #optional
NAGIOS_THEME: #optional
NAGIOS_STARTPAGE: #optional
TZ: Etc/UTC
ports: 8080:80/tcp
volumes:
- nagios-etc:/opt/nagios/etc
- nagios-themes:/opt/nagios/themes
- nagios-var:/opt/nagios/var
volumes:
nagios-etc:
nagios:themes:
nagios-var:
On Linux hosts with podman installed you can run this container as a systemd service, too.
-
Copy below content and paste it to:
$HOME/.config/containers/systemd/nagios.container
-
Perform a systemd reload:
systemctl --user daemon-reload
-
Start service:
systemctl --user start nagios.service
-
Enter commands:
systemctl --user stop nagios.service
-
Remove container file:
$HOME/.config/containers/systemd/nagios.container
-
Perform a systemd reload:
systemctl --user daemon-reload
[Unit]
Description=Nagios Core monitoring container
Wants=network-online.target
After=network-online.target
[Container]
AddCapability=NET_RAW
ContainerName=nagios
Environment=MAIL_ADDRESS= #optional
Environment=MAIL_RELAY_HOST= #optional
Environment=NAGIOS_FQDN= #optional
Environment=NAGIOSADMIN_USER= #optional
Environment=NAGIOS_THEME= #optional
Environment=NAGIOS_STARTPAGE= #optional
HostName= #optional
Image=ghcr.io/arajczy/nagios:latest
Notify=common
PublishPort=8080:80/tcp
Secret=mail-pass,type=env,target=MAIL_PASS
Secret=nagiosadmin-pass,type=env,target=NAGIOSADMIN_PASS
Timezone=local
Volume=nagios-etc:/usr/local/nagios/etc
Volume=nagios-themes:/usr/local/nagios/themes
Volume=nagios-var:/usr/local/nagios/var
[Service]
Restart=on-failure
TimeoutStopSec=70
[Install]
WantedBy=default.target
Parameter | Function |
---|---|
-p 8080:80/tcp |
WebUI |
-e MAIL_ADDRESS= |
Specify your email address |
-e MAIL_PASS= |
Specify your email application password |
-e MAIL_RELAY_HOST= |
default: "[smtp.gmail.com]:587" |
-e NAGIOS_FQDN= |
Specify your server FQDN |
-e NAGIOSADMIN_USER= |
default: nagiosadmin |
-e NAGIOSADMIN_PASS= |
default: nagios |
-e NAGIOS_THEME= |
"default", "dark" |
-e NAGIOS_STARTPAGE= |
"default", "services", "hosts", "overview", "summary", "grid" |
-v /path/to/config:/usr/local/nagios/etc |
Persistent volume for nagios config |
-v /path/to/log:/opt/nagios/var |
Persistent volume for nagios logs |
-v /path/to/themes:/opt/nagios/themes |
Persistent volume for themes |
-
Shell access inside running container:
docker exec -it nagios bash
-
monitor the logs of running container:
docker logs -f nagios