Skip to content

arajczy/docker-nagios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Image Size (tag) Docker Pulls GitHub License GitHub last commit (branch) GitHub Workflow Status (with event) GitHub issues

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.

Components

Product / Latest Installed
Nagios Core 4.5.9
Nagios Plugins 2.4.12
NCPA 3.1.2
NRPE 4.1.3
NSCA 2.10.3
MongoSH 2.3.8
Check-MongoDB Plugins 1.0.0
NagiosTV 0.9.2
s6-overlay 3.2.0.2

Application Setup

  • Access the webui at http://<your-ip>:8080, for more information check out Nagios Core.
  • Access NagiosTV webui at http://<your-ip>:8080/nagiostv.

Nagios

Download image

docker pull ghcr.io/arajczy/nagios:latest

Usage

docker cli

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 cli

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

docker-compose

    ---
    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:

systemd container service

On Linux hosts with podman installed you can run this container as a systemd service, too.

steps to enable nagios container as a systemd service

  1. Copy below content and paste it to:

    $HOME/.config/containers/systemd/nagios.container
  2. Perform a systemd reload:

    systemctl --user daemon-reload
  3. Start service:

    systemctl --user start nagios.service

steps to disable nagios container service

  1. Enter commands:

    systemctl --user stop nagios.service
  2. Remove container file:

    $HOME/.config/containers/systemd/nagios.container
  3. 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

Parameters

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

Support Info

  • Shell access inside running container:

    docker exec -it nagios bash
  • monitor the logs of running container:

    docker logs -f nagios

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages