Skip to content

devture/nagadmin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

326 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nagadmin

An all-in-one Nagios monitoring stack β€” a beautiful web UI to configure Nagios and watch your services, with Nagios itself built right in.

License: AGPL v3 PHP 8.5 Symfony 8.1 Nagios 4.5 Docker required

Editing Nagios .cfg files by hand is tedious, needs terminal access, and gives you no real overview of what's configured. Nagadmin replaces that with a friendly, mobile-friendly web interface β€” and, unlike most configurators, it doesn't expect you to bring your own Nagios. The Nagios engine is bundled and managed for you, so a single command brings up a complete, self-hosted monitoring system.

It deliberately optimizes for the common monitoring use-case rather than supporting every esoteric Nagios feature. That keeps the workflow simple β€” but if your needs are very advanced, you may prefer another solution or a fork. See 🚧 Limitations.

Nagadmin dashboard

🧩 One stack, batteries included

Nagadmin isn't a configurator that talks to a Nagios you have to install and babysit yourself β€” it ships Nagios too. A single just run brings the whole monitoring stack up in containers:

  • πŸ–₯️ Nagadmin web UI β€” the configurator and the status frontend (a Symfony app under app/)
  • πŸ“Ÿ Nagios β€” the monitoring engine itself, pre-wired and validated for you
  • πŸ—„οΈ MongoDB β€” stores your configuration
  • 🌐 nginx β€” serves the web UI
  • βœ‰οΈ exim mail relay β€” delivers notifications, with a persistent retry spool (production)

You configure everything through the web UI; Nagadmin generates and deploys validated Nagios configuration for you. No hand-editing .cfg files, no separate Nagios install to wire up.

🌟 Why Nagadmin?

  • βœ… Easier than SSHing in to edit raw config β€” point-and-click instead of vi nagios.cfg
  • 🎨 A pleasant, modern UI that also works on mobile devices
  • πŸ”„ Configurator and frontend in one β€” set things up and watch their status from the same place
  • πŸ“¦ Nagios included β€” no separate installation; it's part of the stack
  • πŸ” Advanced access control β€” many users can see and do different things
  • 🎯 Optimized for the common case β€” complex Nagios features are hidden to keep the workflow simple
  • πŸ‘€ A clear overview of both your current configuration and live status

πŸš€ Getting started

Prerequisites

  • Docker
  • Docker Compose (v1 or v2)
  • just (command runner)

1. Get the code

cd /srv/http
git clone <repository url> nagadmin
cd nagadmin

2. Configure

Nagadmin keeps its configuration in two files, each read natively by the tool that needs it:

cp .env.dist .env          # infrastructure: timezone, published ports, Nagios UI credentials
cp app/.env.dist app/.env  # the Symfony app: secrets, mailer DSN, SMS credentials, etc.

Edit both to taste. app/.env holds deployment-specific values and secrets such as the notification API secret (NAGADMIN_NOTIFICATION_API_SECRET), the mailer DSN (MAILER_DSN) and the Vonage SMS credentials.

3. First run

just run

just run starts the development environment, which includes a mailcrab mail-catcher so it never sends real e-mail β€” captured messages are viewable at http://127.0.0.1:20182. To run the production environment instead, use just run prod (see Running in production below).

ℹ️ Nagios won't be fully healthy yet β€” it can't find its configuration until the install step below.

4. Initialize the database

just init-database

Imports the initial data-set and creates the database indexes.

5. Install

just install

Sets up the Resource Variables and deploys the initial Nagios configuration. Nagios should now start cleanly.

6. Create your first user

./bin/container-console devture-user:add USERNAME_HERE EMAIL_ADDRESS_HERE

You'll be prompted for a password.

7. Open it up

What URL Credentials
πŸ–₯️ Nagadmin http://nagadmin.127.0.0.1.nip.io:20180 the user you just created
πŸ“Ÿ Nagios http://nagadmin.127.0.0.1.nip.io:20181 NAGIOSADMIN_USER / NAGIOSADMIN_PASS from .env

Nagadmin's frontend doesn't replace the native Nagios CGI interface β€” both run side by side, so you're free to use either (or both).

8. Verify

./bin/container-console check:status

Set up a reverse proxy

See resources/webserver. You may also want to configure Symfony's trusted proxies via the SYMFONY_TRUSTED_PROXIES environment variable (e.g. in app/.env).

βš™οΈ Running in production

just run prod combines compose.yml with compose.prod.yml, which adds a bundled exim-relay mailer service for sending Nagios notifications. Point the application at it by setting MAILER_DSN=smtp://mailer:8025 in the production app/.env.

Configure outgoing delivery via the repository-root .env:

  • SMARTHOST β€” upstream SMTP relay as host::port (e.g. smtp.example.com::587). Leave empty to deliver directly to recipients' MX servers. The relay uses opportunistic STARTTLS, so use a STARTTLS port such as 587 (implicit TLS on port 465 is not supported by this image).
  • SMTP_USERNAME / SMTP_PASSWORD β€” credentials for the smarthost.

The relay keeps a persistent on-disk spool (var/container-data/exim-spool), so a transient SMTP outage does not lose notifications: queued mail is retried until it is delivered.

❓ FAQ

Does this support all kinds of esoteric Nagios features? No β€” Nagadmin optimizes for the common case. See 🚧 Limitations.

Does it provide a frontend to view the status of my services? Yes. Nagadmin is both a web configurator and a frontend β€” a simple alternative to the default Nagios CGI interface, which also remains available alongside it.

Can more than one person log into the Nagios UI? Yes. The stack seeds a single nagiosadmin user from .env, but htpasswd.users (under var/container-data/nagios/etc/) is a standard file you can add users to (htpasswd -b -s … alice <pw>), then authorize them in cgi.cfg. Such changes persist.

Can I import my existing Nagios configuration files? No. You'd need to start from scratch via the UI.

Can I install the web configurator on a machine separate from Nagios? No. Nagios runs as part of this all-in-one stack.

I'm running a Nagios-compatible system (Icinga, Shinken, Centreon). Can I use this? Nagadmin only works with Nagios. Some of these are similar, so you may be able to migrate to Nagios (powered by Nagadmin).

I need to monitor thousands of services. Can I use this? Not well β€” Nagadmin targets smaller installations and isn't optimized for that scale (yet).

What is it written in? PHP, using the Symfony framework (the application lives under app/).

What are the system requirements? A Linux server (amd64 or arm64) with Docker and Docker Compose, any distribution. Everything runs in containers.

What about Nagadmin's future? The source will always be available. The aim is not to keep growing features and complexity; community improvements are welcome.

🚧 Limitations

These are either features not implemented (yet) or conscious decisions to keep things simple.

  • Host checks and notifications β€” not supported; all hosts are internally forced to an OK state so service checks can run. The automatic service-dependency feature below makes up for it.
  • Service groups β€” not supported (more to enter, little value).
  • Templates (timeperiods/contacts/hosts/services) β€” not supported, to avoid a complex inheritance model.
  • Service dependencies β€” not supported manually, but automatic service dependencies are: a service named ping or host-alive (case-insensitive) automatically becomes the parent of every other service on the same host, so when that "important" service is down, notifications for its children are suppressed. (Configurable via nagadmin.auto_service_dependency.master_service_regexes in app/src/Devture/Bundle/NagiosBundle/Resources/config/services.yaml.)
  • Service escalations β€” not supported (advanced feature, out of scope for now).
  • Event handlers β€” not supported (advanced feature, out of scope for now).
  • Importing existing config files β€” not supported; reconfigure via the UI.
  • Very large installations β€” the code and UI don't currently scale to thousands of services.

πŸ› οΈ Development

Working on Nagadmin itself? See docs/development.md for the developer tooling β€” static analysis (PHPStan) and the pre-commit hooks.

πŸ“œ License

AGPL-3.0. The source code will always be available, and community contributions are welcome.

About

Web-configurator and frontend for Nagios

Topics

Resources

License

Stars

Watchers

Forks

Contributors