Skip to main content
Warning This document has not been updated for a while now. It may be out of date.
Last updated: 3 Mar 2022

Use Nagstamon for monitoring Icinga

nagstamon

Nagstamon can access multiple Icinga instances, display the alerts, and allow you to easily act on them.

Installation

Download the relevant release from the Nagstamon website.

Mac users

You can install using Homebrew. After install, open Nagstamon.app in your Applications folder.

On first run, it may be blocked as an unverified app. Go to “Security & Privacy”, and under the “General” tab there should be a message relating to your attempt to open Nagstamon. Click “Open anyway”.

Connecting to Icinga

To connect Nagstamon to an Icinga instance:

  • Go in to the Settings.
  • Select “New server…”.
  • Choose “Monitor Type” of “Icinga”.
  • Enter an appropriate “Monitor name”, “GOV.UK Integration” for example.
  • Enter the URL for the Icinga instance to the Monitor URL and Monitor CGI URL fields (i.e. https://alert.integration.publishing.service.gov.uk/ should be entered in both fields for integration).
  • Set the Username and Password to blank, and tick “Save password”.
  • Click “OK”.

Repeat for each environment. Note that each Icinga instance is displayed in alphabetical order according to its ‘Monitor name’ value, so if you want Production to come before Integration, you’ll have to get creative by prefixing the monitor name with a number.

Actions

Nagstamon supports performing actions, you can configure it to connect to the relevant host via SSH, which can make it easier to investigate and resolve issues.

Both these commands assume that you have the gds-cli and govuk-connect set up.

To configure an SSH action:

  • Go in to the Settings
  • Select the “Actions” tab
  • Delete all the existing actions (SSH, RDP, …)
  • Click “New action…”
  • Select “Command” as the Action type.
  • Put “SSH ” as the Name
  • The command depends on what operating system you’re using:
    • For macOS, enter the following command in the “String” field:
    • osascript -e 'tell app "Terminal" to do script "gds govuk connect ssh --hosting-and-environment-from-alert-url $MONITOR$ $ADDRESS$"'
    • For GNU/Linux, with the Gnome Terminal installed (which includes Ubuntu), use the following command:
      • /usr/bin/gnome-terminal -x gds govuk connect ssh --hosting-and-environment-from-alert-url $MONITOR$ $ADDRESS$
  • Click “OK”