Sign inSign up

instantlinux/nagiosql

By instantlinux

Updated 18 days ago

Web GUI for managing Nagios monitoring service, in a lightweight multi-arch alpine container.

Image
Monitoring & observability
9

9.9K

instantlinux/nagiosql repository overview

nagiosql

Web GUI for managing Nagios monitoring service.

Usage

NagiosQL is a UI for managing host, service and related definitions for Nagios. In May 2018 it was finally updated to work with Nagios Core v4.x. Here in this codebase find an example docker-compose.yml which will launch 3 services: the instantlinux/nagios image, this NagiosQL image and an nginx server which provides SSL termination.

Steps:

  • Create a blank database (e.g. nagiosql) or a copy of your existing NagiosQL database on your MySQL server and assign its password in the docker secret identified in your docker-compose.yml (see example as noted above)
  • Copy the docker-compose.yml from this repo and define any environment-var overrides you might need (as defined below)
  • Specifically, check the environment variable NAGIOS_ETC to confirm it matches your nagios installation. The jasonrivers/nagios image used the Ubuntu location /opt/nagios/etc. The instantlinux/nagios alpine image needs NAGIOS_ETC=/etc/nagios.
  • Bring up Nagios4 and NagiosQL using docker-compose up
  • In a browser, connect to NagiosQL UI at the port number identified in docker-compose.yml, log in as nagiosadmin / nagios, enter the database install or update dialog
  • Define hosts, services and other objects
  • Under Tools -> Nagios control, invoke Write monitoring data, Write additional data, Check configuration files
  • If the config check didn't find binary, set it under Administration -> Config targets -> Local installation -> edit. Look for Nagios binary file and set the value to /usr/sbin/nagios; fill in any other missing values, then Save
  • Restart nagios server if the configuration check passed (using docker restart, the button doesn't work)
  • If nagios server won't start due to configuration-check failures, manually lean up extraneous files and cfg_file entries from nagios.cfg. Known problems include localhost.cfg and windows.cfg.

Tips:

  • (To secure nagios itself) use htpasswd, add your administrative user(s) to htpasswd.users at top level in /etc/nagios volume, and update cgi.cfg to include user name(s) in each of the authorized_xxx settings (see the AUTHORIZED_USERS setting if using instantlinux/nagios image)
  • Nagios v4 requires that each service be attached to at least one host or hostgroups. If you're migrating from an old installation, deactivate any service definitions that are no longer in use
Current Status

Stable -- with caveat that restart button doesn't work. You'll need to invoke restart from nagios itself, or from kubernetes/docker, after writing new configuration files.

Variables
VariableDefaultDescription
ADMIN_PATH/optPath on localhost to store etc files
DB_HOSTdb00MySQL database hostname
DB_NAMEnagiosqldatabase name
DB_PORT3306TCP port number
DB_USERnagiosqldatabase username
DB_SECRETNAMEnagiosql-db-passwordname of secret
DOMAINused in docker-compose.yml by the nagios server
NAGIOS_ETC/opt/nagios/etcvolume mountpoint for nagios.cfg
NAGIOS_MAIL_RELAYsmtpDNS name for nagios email sending
PORT_NAGIOSQL8080Port to use for NagiosQL UI
REGISTRY_URI(docker hub)Local image registry
SHARE_PATH/optPath on localhost to store SSL certs
TZUTClocal timezone
Secrets
SecretDescription
nagiosql-db-passworddatabase credential
<hostname>-server-key.pemSSL cert (if using docker-compose)
Contributing

If you want to make improvements to this image, see CONTRIBUTING.

Tag summary

Content type

Image

Digest

sha256:d2f511f2a

Size

37.3 MB

Last updated

18 days ago

docker pull instantlinux/nagiosql