Skip to content

Latest commit

 

History

History
89 lines (71 loc) · 2.7 KB

README.md

File metadata and controls

89 lines (71 loc) · 2.7 KB

MagicMirror Module: MMM-Nagios

A MagicMirror Module for displaying the Nagios Network Monitoring.

Platform

Example

Installing the module

The module uses the JSON formatted Nagios status as formattted by php-nagios-json.
Copy the statusJson.php to you nagios/share folder.
Remember to changes this line $statusFile = "/opt/local/var/nagios/status.dat"; to yours status.dat folder.

Using the module

To use this module, add it to the modules array in the config/config.js file:

  {
    module: 'MMM-Nagios',
    position: 'bottom_right',
    header: 'Nagios - Server',
    config: {
      statusUrl: 'http://<YOUR URL>/nagios/statusJson.php',
      username:'YOUR USERNAME',
      password: 'YOUR PASSWORD',
      showDetails: true,
      showHosts: false,
    }
  },
  {
    module: 'MMM-Nagios',
    position: 'bottom_right',
    header: 'Nagios - Hosts',
    config: {
      statusUrl: 'http://<YOUR URL>/nagios/statusJson.php',
      username:'YOUR USERNAME',
      password: 'YOUR PASSWORD',
      showDetails: true,
      showHosts: true
    }
  }

Configuration options

The following properties can be configured:

Option Description
statusUrl The URL to get the status from. Must be a php-nagios-json page.
Required
username HTTP Basic Auth username, if need to access the page.
Optional
password HTTP Basic Auth password, should be specified if the username is.
Optional
showDetails Show the service and host for each nagios status (except OK).
Optional
showHosts Show information about hosts instead of services.
Default value: false
reloadInterval Number of milliseconds between refresh.
Default value: 5 * 60 * 1000 (5 minutes)
labels Defines the labels for each type of status.
Default value: See Default labels.

Notifications

This module supports the following notifications:

Notification   | Description
-------------- | -----------
`SHOW_DETAILS` | Payload is a `boolean` indicating if the details should be shown, just like (`showDetails` in the config).

Coloring

.nagios-critical {
    color: red;
}

.nagios-warning {
    color: yellow;
}

.nagios-unknown {
    color: orange;
}

.nagios-ok {
    color: green;
}

You can of course also use these CSS classes for differente styling MMM-Nagios/MMM-Nagios.css