``profile::ganglia_server``
===========================

This module configures the following Ganglia server components:

- the web interface (using Apache)
- one gmond for each cluster to be monitored by this server

The latter is a little unusual. Normally, the gmonds collecting the data for
each cluster, which are then queried by gmetad, are part of the cluster. The
implementation chosen by this module makes it easier to deal with firewalls.


Parameters
----------

===============================  ========  ================================================
**Name**                         **Type**  **Default**
-------------------------------  --------  ------------------------------------------------
grid                             string    hiera('ganglia::grid')
grid_${GRID}                     hash      hiera('ganglia::grid_${GRID}')
===============================  ========  ================================================


``grid``
~~~~~~~~

This string identifies the grid (ie the collection of clusters) this server
monitors. The definition of the grid is taken from the Hiera value
``grid_${GRID}``.


``grid_${GRID}``
~~~~~~~~~~~~~~~~

The definition of the Ganglia grid this server is responsible for. It is a hash
containing the following keys:


``name``
,,,,,,,,

The name of the grid as used in the web interface.


``ui``
,,,,,,

The FQDN of the server hosting the web UI and collecting the data for the grid.
A system with role ``ganglia_server`` will compare its own FQDN to this value
and fail if they are not equal. Clients will need this value to know where they
they should send their metrics.


``clusters``
,,,,,,,,,,,,

A hash of cluster definitions. The keys are the IDs of the clusters, ie. what a
client expects to find in ``ganglia::cluster``. The values are hashes containing
the following attributes:

``name``
........

The user-friendly name of the cluster to be used in the web UI.

``port``
........

The port used within the cluster. The first cluster should use 8649 (the Ganglia
standard port), the next cluster should use 8650, and so on.


Examples
--------

Suppose we have a Ganglia grid for Swissfel (sysdb_env == swissfel).
The we could put the following in Hiera.

In ``swissfel.yaml`` we would define grid, say ``sfel``, and set the grid for
all systems in the ``swissfel`` environment to ``sfel``::


  ganglia::grid: 'sfel'

  ganglia::grid_sfel:
    name: 'SwissFEL'
    ui: 'gmeta00.psi.ch'
    clusters:
      'sf-daqbuf':
        name: 'DAQ Buffers'
        port: 8649
      'sf-athos'
        name: 'Athos Beamline Systems'
        port: 8650

In the ``swissfel/daqbuf.yaml`` we would then set the cluster to ``sf-daqbuf``::

  ganglia::cluster: 'sf-daqbuf'

In ``swissfel/athos.yaml`` on the other hand, we would set the cluster to
``sf-athos``::

  ganglia::cluster: 'sf-athos'
