Forge Home

puppet_metrics_dashboard

pdk
supported
A module for managing the installation and configuration of metrics dashboards for Puppet Infrastructure.

Puppet

puppetlabs

137,237 downloads

856 latest version

5.0 quality score

Version information

  • 2.5.0 (latest)
  • 2.4.0
  • 2.3.1
  • 2.3.0
  • 2.2.0
  • 2.0.1
  • 2.0.0
  • 1.1.5
  • 1.1.0
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
released May 27th 2021
This version is compatible with:
  • Puppet Enterprise 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.7.0 < 8.0.0
  • CentOS
    ,
    Debian
    ,
    RedHat
    ,
    Ubuntu

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this declaration to your Puppetfile:

mod 'puppetlabs-puppet_metrics_dashboard', '2.5.0'
Learn more about managing modules with a Puppetfile

Add this module to a Bolt project:

bolt module add puppetlabs-puppet_metrics_dashboard
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppetlabs-puppet_metrics_dashboard --version 2.5.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

puppetlabs/puppet_metrics_dashboard — version 2.5.0 May 27th 2021

Reference

Table of Contents

Classes

Public Classes

Private Classes

  • puppet_metrics_dashboard::config: Configures dashboard components.
  • puppet_metrics_dashboard::dashboards: Configures Grafana dashboards.
  • puppet_metrics_dashboard::dashboards::graphite: Installs graphite example dashboards
  • puppet_metrics_dashboard::dashboards::puppet_metrics: Installs puppet_metrics example dashboards
  • puppet_metrics_dashboard::dashboards::telegraf: Installs telegraf example dashboards
  • puppet_metrics_dashboard::grafana: Install and configure Grafana
  • puppet_metrics_dashboard::install: Installs InfluxDB components.
  • puppet_metrics_dashboard::post_start_configs: InfluxDB post-start configs
  • puppet_metrics_dashboard::repos: Configures InfluxDB and Grafana repos
  • puppet_metrics_dashboard::service: Manages services
  • puppet_metrics_dashboard::telegraf: Install and configure Telegraf
  • puppet_metrics_dashboard::telegraf::config: Configures Telegraf
  • puppet_metrics_dashboard::telegraf::service: Manages the Telegraf service

Defined types

Functions

Data types

Classes

puppet_metrics_dashboard

Installs and configures a stack for collecting, storing, and displaying Puppet Infrastructure metrics. Refer to data/common.yaml for additional parameter defaults.

Examples

Grafana with no login
class { 'puppet_metrics_dashboard':
  grafana_config => {
    'users'          => {
      'allow_sign_up' => false,
    },
    'auth.anonymous' => {
      'enabled' => true,
    },
  },
}
Configure Telegraf to collect metrics from a list of Masters, PuppetDB, and PostgreSQL servers
class { 'puppet_metrics_dashboard':
  add_dashboard_examples => true,
  overwrite_dashboards   => false,
  configure_telegraf     => true,
  enable_telegraf        => true,
  master_list            => ['master.example.com', ['compiler01.example.com', 9140], ['compiler02.example.com', 9140]],
  puppetdb_list          => ['puppetdb01.example.com', 'puppetdb02.example.com'],
  postgres_host_list     => ['postgres01.example.com', 'postgres02.example.com'],
}
Configure Graphite to accept metrics from a list of Masters
class { 'puppet_metrics_dashboard':
  add_dashboard_examples => true,
  overwrite_dashboards   => false,
  consume_graphite       => true,
  influxdb_database_name => ['graphite'],
  master_list            => ['master', 'master02'],
}
Configure Telegraf, Graphite, and Archive
class { 'puppet_metrics_dashboard':
  add_dashboard_examples => true,
  overwrite_dashboards   => false,
  consume_graphite       => true,
  configure_telegraf     => true,
  enable_telegraf        => true,
  influxdb_database_name => ['telegraf', 'graphite', 'puppet_metrics'],
}

Parameters

The following parameters are available in the puppet_metrics_dashboard class:

manage_repos

Data type: Boolean

Whether to configure apt / yum repositories for required packages.

add_dashboard_examples

Data type: Boolean

Whether to add the example Grafana dashboards for the configured InfluxDB databases. Defaults to false. Note: These dashboards are managed and any changes will be overwritten unless the overwrite_dashboards is set to false.

overwrite_dashboards

Data type: Boolean

Whether to overwrite the example Grafana dashboards. Defaults to true This parameter disables overwriting the example Grafana dashboards. It takes effect after the second Puppet run, and populates a overwrite_dashboards_disabled fact. Only used when add_dashboard_examples is true.

enable_chronograf

Data type: Boolean

Whether to install chronograf. Defaults to false No configuration of chronograf is included at this time.

enable_kapacitor

Data type: Boolean

Whether to install kapacitor. Defaults to false No configuration of kapacitor is included at this time.

enable_telegraf

Data type: Boolean

Whether to install telegraf. Defaults to true No configuration is done unless configure_telegraf is set to true.

configure_telegraf

Data type: Boolean

Whether to configure the Telegraf service. Defaults to true This parameter enables and configures Telegraf to query the *_list hosts for metrics. Metrics will be stored in the telegraf database in InfluxDb. Ensure that influxdb_database_name contains telegraf when using this parameter. Only used when enable_telegraf is true.

consume_graphite

Data type: Boolean

Whether to enable the InfluxDB Graphite plugin. Defaults to false This parameter enables the Graphite plugin for InfluxDB to allow for consuming Graphite metrics. Ensure influxdb_database_name contains graphite when using this parameter. Note: To consume metrics sent from Puppet Server, this must to be set to true.

influxdb_database_name

Data type: Array[String]

An Array of databases that should be created in InfluxDB. Valid values are telegraf, graphite, puppet_metrics, and any other string. Defaults to ["telegraf"] Each database in the array will be created in InfluxDB. telegraf, graphite, and puppet_metrics are specially named and will be used with their associated metric collection method. Any other database name will be created, but not associated with components in this module.

influxdb_urls

Data type: Array[String]

An Array containing urls defining InfluxDB instances for Telegraf.

influx_db_service_name

Data type: String

Name of the InfluxDB service used by the operating system.

influx_db_password

Data type: String

The password for the InfluxDB admin user. Defaults to puppet

telegraf_db_name

Data type: String

The InfluxDB database where Telegraf metrics are stored.

http_response_timeout

Data type: String[2]

Timeout for Telegraf HTTP requests. Defaults to 5s

telegraf_agent_interval

Data type: String[2]

Frequency of Telegraf HTTP queries for metrics. Defaults to 5s

pg_query_interval

Data type: String[2]

Frequency of Telegraf PostgreSQL queries for metrics. Defaults to 10m

use_dashboard_ssl

Data type: Boolean

Whether to enable SSL in Grafana. Valid values are true, false. Defaults to false

tidy_telegraf_configs

Data type: Boolean

Whether or not to remove unmanaged configuration files from /etc/telegraf/telegraf.d. Defaults to false

dashboard_cert_file

Data type: String

The location of the Grafana certficiate. Defaults to /etc/grafana/${clientcert}_cert.pem Only used when use_dashboard_ssl is true.

dashboard_cert_key

Data type: String

The location of the Grafana private key. Defaults to /etc/grafana/${clientcert}_key.pem Only used when use_dashboard_ssl is true.

enable_ldap_auth

Data type: Boolean

Whether to enable LDAP authentication in Grafana Valid values are true, false. Defaults to false

grafana_http_port

Data type: Integer

The port for the Grafana web interface. Valid values are Integers from 1024 to 65536. Defaults to 3000 This should be a nonprivileged port (above 1024).

grafana_password

Data type: String

The password for the Grafana admin user. Defaults to admin

grafana_version

Data type: String

The version of Grafana to install. Valid values are String versions of Grafana.

overwrite_dashboards_file

Data type: String

File used to populate the overwrite_dashboards fact.

grafana_config

Data type: Hash

Hash of arbitrary configuration settings to pass to Grafana. These are added to grafana.ini with top-level keys becoming sections and their key-value children becoming settings.

master_list

Data type: Puppet_metrics_dashboard::HostList

An Array of servers that Telegraf will collect Puppet Server metrics from. Entries may be:

  • A String that contains a hostname or IP address. (The module will use a default port number of 8140)
  • An Array where the first entry is a String that contains a hostname or IP address, and the second entry is an Integer that specifies the port number. Defaults to the result of a PuppetDB query, or [$trusted['certname']]

Default value: puppet_metrics_dashboard::localhost_or_hosts_with_pe_profile('master')

puppetdb_list

Data type: Puppet_metrics_dashboard::HostList

An Array of servers that Telegraf will collect PuppetDB metrics from. Entries may be:

  • A String that contains a hostname or IP address. (The module will use a default port number of 8081)
  • An Array where the first entry is a String that contains a hostname or IP address, and the second entry is an Integer that specifies the port number. Defaults to the result of a PuppetDB query, or [$trusted['certname']]

Default value: puppet_metrics_dashboard::localhost_or_hosts_with_pe_profile('puppetdb')

postgres_host_list

Data type: Puppet_metrics_dashboard::HostList

An Array of servers that Telegraf will collect PostgreSQL metrics from. Entries may be:

  • A String that contains a hostname or IP address. (The module will use a default port number of 5432)
  • An Array where the first entry is a String that contains a hostname or IP address, and the second entry is an Integer that specifies the port number. Defaults to the results of a PuppetDB query, or [$trusted['certname']]

Default value: puppet_metrics_dashboard::localhost_or_hosts_with_pe_profile('database')

puppetdb_metrics

Data type: Puppet_metrics_dashboard::Puppetdb_metric

An Array of Hashes containing name/url pairs for each PuppetDB metric. Refer to functions/puppetdb_metrics.pp for defaults.

Default value: puppet_metrics_dashboard::puppetdb_metrics()

puppet_metrics_dashboard::profile::dbcompiler::install

Apply this class to compilers running PuppetDB to configure Telegraf and collect puppetserver and puppetdb metrics

Parameters

The following parameters are available in the puppet_metrics_dashboard::profile::dbcompiler::install class:

influxdb_urls

Data type: Array[String]

An Array containing urls defining InfluxDB instances for Telegraf.

timeout

Data type: String[2]

Default timeout of http calls. Defaults to 5 seconds

Default value: lookup('puppet_metrics_dashboard::http_response_timeout')

compiler

Data type: Variant[String,Tuple[String, Integer]]

The FQDN of the compiler / master. Defaults to the FQDN of the server where the profile is applied

Default value: $facts['networking']['fqdn']

puppetdb_host

Data type: Variant[String,Tuple[String, Integer]]

Where to query the puppetdb host. Defaults to localhost.

Default value: 'localhost'

cm_port

Data type: Integer[1]

The port that the puppetserver service listens on on your compiler. Defaults to 8140

Default value: 8140

db_port

Data type: Integer[1]

The port that the puppetdb service listens on on your compiler. Defaults to 8081

Default value: 8081

interval

Data type: String[2]

The frequency that telegraf will poll puppetserver metrics. Defaults to '5s'

Default value: '5s'

tidy_telegraf_configs

Data type: Boolean

Whether or not to remove unmanaged configuration files from /etc/telegraf/telegraf.d. Defaults to false.

Default value: lookup('puppet_metrics_dashboard::tidy_telegraf_configs')

manage_repo

Data type: Optional[Boolean]

Boolean. Whether or not to manage Telegraf's repo. Defaults to true

Default value: true

puppetdb_metrics

Data type: Puppet_metrics_dashboard::Puppetdb_metric

Default value: puppet_metrics_dashboard::puppetdb_metrics()

puppet_metrics_dashboard::profile::ldap_auth

Server Parameters

If your LDAP server does not support the memberOf attribute add these options:

Server Attributes Parameters: Specify names of the LDAP attributes your LDAP uses.

Group Mapping Parameters

Parameters

The following parameters are available in the puppet_metrics_dashboard::profile::ldap_auth class:

ldap_host

Data type: String

FQDN or IP of the LDAP server (specify multiple hosts space separated).

ldap_port

Data type: Integer

The port the LDAP service is listening on. Defaults to non-secure port 389.

Default value: 389

ldap_ssl

Data type: Boolean

Enable the use of SSL. Defaults to the false :: Set to true if LDAP server supports TLS

Default value: false

ldap_tls

Data type: Boolean

Set to true to connect LDAP server with STARTTLS pattern. Defaults to false.

Default value: false

ldap_ssl_skip

Data type: Boolean

Set to false if you do not want to skip SSL cert validation. Defaults to true.

Default value: true

ldap_bind_dn

Data type: String

Search user bind dn. If you can provide a single bind expression that matches all possible users, you can skip specifying ldap_bind_password.

ldap_bind_password

Data type: Optional[String]

Search user bind password. If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""

Default value: null

ldap_search_filter

Data type: String

User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)"

ldap_search_base

Data type: String

An array of base dns to search through

ldap_groupsearch_filter

Data type: Optional[String]

Group search filter, to retrieve the groups of which the user is a member (only set if memberOf attribute is not available)

Default value: null

ldap_groupsearch_base

Data type: Optional[String]

An array of the base DNs to search through for groups.

Default value: null

ldap_groupsearch_user_attr

Data type: Optional[String]

The %s in ldap_groupsearch_filter will be replaced with the attribute defined here.

Default value: null

ldap_name

Data type: Optional[String]

Default value: name

ldap_surname

Data type: Optional[String]

Default value: surname

ldap_username

Data type: Optional[String]

Default value: username

ldap_member_of

Data type: Optional[String]

Default value: memberOf

ldap_email

Data type: Optional[String]

Default value: email

ldap_group_dn

Data type: String

Ldap DN of LDAP group. Will accept wildcard to match all groups "*".

ldap_grafana_role

Data type: String

Assign users one of the following roles: "Admin", "Editor" or "Viewer". Defaults to "Admin".

Default value: 'Admin'

puppet_metrics_dashboard::profile::master::install

Install requirements for the voxpupuli/puppet-telegraf module.

Examples

Apply this class to the Master and any/all Compilers
include puppet_metrics_dashboard::profile::master::install

puppet_metrics_dashboard::profile::master::postgres_access

Apply this class to a PE PostgreSQL node to allow access by Telegraf.

Examples

Apply this class to PE PostgreSQL nodes
class { 'puppet_metrics_dashboard::profile::master::postgres_access':
  telegraf_host => 'dashboard.example.com',
}

Parameters

The following parameters are available in the puppet_metrics_dashboard::profile::master::postgres_access class:

telegraf_host

Data type: Optional[String[1]]

The FQDN of the host running Telegraf. Defaults to an empty string. You can define this parameter, otherwise this class will query PuppetDB for a dashboard host.

Default value: undef

puppet_metrics_dashboard::profile::postgres

This class is deprecated. Please use the Puppet_metrics_dashboard::Profile::Master::Postgres_access class.

Parameters

The following parameters are available in the puppet_metrics_dashboard::profile::postgres class:

grafana_host

Data type: String

The FQDN of the host where telegraf runs. Defaults to an empty string. You can explicitly set this parameter or the class attempts to lookup which host has the puppet_metrics_dashboard class applied in PuppetDB. If the parameter is not set and the lookup does not return anything we issue a warning.

Default value: ''

Defined types

puppet_metrics_dashboard::certs

This class creates a set of certificates in /etc/${service}. These certificates are used when configuring Grafana to use SSL and to connect to PE Postgres. The certificates are based on the agent's own Puppet certificates.

Parameters

The following parameters are available in the puppet_metrics_dashboard::certs defined type:

service

Data type: Any

The service name associated with these certificates.

Default value: $name

puppet_metrics_dashboard::profile::compiler

Apply this class to a master or compiler to collect puppetserver metrics

Examples

Add telegraf to a master / compiler
puppet_metrics_dashboard::profile::compiler{ $facts['networking']['fqdn']:
  timeout => '5s',
}

Parameters

The following parameters are available in the puppet_metrics_dashboard::profile::compiler defined type:

timeout

Data type: String[2]

Default timeout of http calls. Defaults to 5 seconds

Default value: lookup('puppet_metrics_dashboard::http_response_timeout')

compiler

Data type: Variant[String,Tuple[String, Integer]]

The FQDN of the compiler / master. Defaults to the FQDN of the server where the profile is applied

Default value: $facts['networking']['fqdn']

port

Data type: Integer[1]

The port that the puppetserver service listens on on your compiler. Defaults to 8140

Default value: 8140

interval

Data type: String[2]

The frequency that telegraf will poll for metrics. Defaults to '5s'

Default value: '5s'

puppet_metrics_dashboard::profile::master::postgres

Apply this class to an agent running pe-postgresql to collect postgres metrics

Examples

Add telegraf to a postgres server
puppet_metrics_dashboard::profile::master::postgres{ $facts['networking']['fqdn']:
  query_interval => '10m',
}

Parameters

The following parameters are available in the puppet_metrics_dashboard::profile::master::postgres defined type:

query_interval

Data type: String[2]

How often to run the queries in minutes. Defaults to 10 minutes.

Default value: lookup('puppet_metrics_dashboard::pg_query_interval')

postgres_host

Data type: Variant[String,Tuple[String, Integer]]

The FQDN of the postgres host. Defaults to the FQDN of the server where the profile is applied

Default value: $facts['networking']['fqdn']

port

Data type: Integer[1]

The port that the postgres service listens on. Defaults to 5432

Default value: 5432

databases

Data type: Array[String[1]]

An Array of databases to query on. Defaults to ['pe-puppetdb','pe-rbac','pe-activity','pe-classifier']

Default value: ['pe-puppetdb','pe-rbac','pe-activity','pe-classifier']

puppet_metrics_dashboard::profile::puppetdb

Apply this class to a node running puppetdb to collect puppetdb metrics

Examples

Add telegraf to a puppetdb node
puppet_metrics_dashboard::profile::puppetdb{ $facts['networking']['fqdn']:
  timeout          => '5s',
  puppetdb_metrics => puppet_metrics_dashboard::puppetdb_metrics(), # this is the default value
}

Parameters

The following parameters are available in the puppet_metrics_dashboard::profile::puppetdb defined type:

timeout

Data type: String[2]

Default timeout of http calls. Defaults to 5 seconds

Default value: lookup('puppet_metrics_dashboard::http_response_timeout')

puppetdb_metrics

Data type: Puppet_metrics_dashboard::Puppetdb_metric

An array of hashes containing name / url pairs for each puppetdb metric. See functions/puppetdb_metrics.pp for defaults.

Default value: puppet_metrics_dashboard::puppetdb_metrics()

puppetdb_host

Data type: Variant[String,Tuple[String, Integer]]

Where to query the puppetdb host. Defaults to localhost.

Default value: 'localhost'

port

Data type: Integer[1]

The port that the puppetdb service listens on on your compiler. Defaults to 8081

Default value: 8081

interval

Data type: String[2]

The frequency that telegraf will poll for metrics. Defaults to '5s'

Default value: '5s'

enable_client_cert

Data type: Boolean

A boolean to enable using the client certificate for the PuppetDB queries. Defaults to true

Default value: true

Functions

puppet_metrics_dashboard::localhost_or_hosts_with_pe_profile

Type: Puppet Language

The puppet_metrics_dashboard::localhost_or_hosts_with_pe_profile function.

puppet_metrics_dashboard::localhost_or_hosts_with_pe_profile(String $profile)

The puppet_metrics_dashboard::localhost_or_hosts_with_pe_profile function.

Returns: Array

profile

Data type: String

puppet_metrics_dashboard::puppetdb_metrics

Type: Puppet Language

The list of metrics to pull from PuppetDB depends on the PE version. To avoid having a data file for each version we utilize this function to build the needed array of hashes.

puppet_metrics_dashboard::puppetdb_metrics()

The list of metrics to pull from PuppetDB depends on the PE version. To avoid having a data file for each version we utilize this function to build the needed array of hashes.

Returns: Array[Hash] An array of hashes containing name / url pairs for each puppetdb metric.

puppet_metrics_dashboard::puppetdb_v2_metrics

Type: Puppet Language

The puppet_metrics_dashboard::puppetdb_v2_metrics function.

puppet_metrics_dashboard::puppetdb_v2_metrics()

The puppet_metrics_dashboard::puppetdb_v2_metrics function.

Returns: Boolean

Data types

Puppet_metrics_dashboard::HostList

A list of hostnames, or pairs of hostname and port.

Alias of

Array[Variant[
    String,
    Tuple[String, Integer]
  ]]

Puppet_metrics_dashboard::Puppetdb_metric

A metric name corresponding to an endpoint (url)

Alias of

Tuple[Struct[{
    name => String[1],
    url  => String[1]
  }], 1, default]