Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 3547542

Browse files
author
suckatrash
committed
Update README
1 parent f0fac1c commit 3547542

File tree

1 file changed

+50
-20
lines changed

1 file changed

+50
-20
lines changed

README.md

+50-20
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,22 @@
1313

1414
## Description
1515

16-
This module is used to configure grafana, telegraf, and influxdb to consume metrics from Puppet service.
16+
This module is used to configure grafana, telegraf, and influxdb to consume metrics from Puppet services.
1717

1818
You have the option of getting metrics from any or all of three of these methods:
1919

20+
* Through telegraf, which polls several of Puppet's metrics endpoints (recommended)
2021
* Through Archive files from the [puppetlabs/puppet_metrics_collector](https://forge.puppet.com/puppetlabs/puppet_metrics_collector) module
2122
* Natively, via Puppetserver's [built-in graphite support](https://puppet.com/docs/pe/2019.0/getting_started_with_graphite.html#task-7933)
22-
* Through telegraf, which polls several of Puppet's metrics endpoints
2323

2424
## Setup
2525

2626
### Upgrade note
2727

2828
Previous versions of this module put several `[[inputs.httpjson]]` entries in
2929
`/etc/telegraf/telegraf.conf`. These entries should be removed now as all
30-
module-specific settings now reside in
31-
`/etc/telegraf/telegraf.d/puppet_metrics_dashboard.conf`. Telegraf will
32-
continue to work if you do not remove them, however, the old
30+
module-specific settings now reside in individual files within
31+
`/etc/telegraf/telegraf.d/`. Telegraf will continue to work if you do not remove them, however, the old
3332
`[[inputs.httpjson]]` will not be updated going forward.
3433

3534

@@ -45,12 +44,11 @@ include puppet_metrics_dashboard
4544

4645
## Usage
4746

48-
### To install example dashboards for all of the collection methods:
47+
### To install example dashboards and use the telegraf collection method (default):
4948

5049
```
5150
class { 'puppet_metrics_dashboard':
5251
add_dashboard_examples => true,
53-
influxdb_database_name => ['puppet_metrics','telegraf','graphite'],
5452
}
5553
```
5654

@@ -59,7 +57,6 @@ class { 'puppet_metrics_dashboard':
5957
```
6058
class { 'puppet_metrics_dashboard':
6159
add_dashboard_examples => true,
62-
influxdb_database_name => ['puppet_metrics','telegraf','graphite'],
6360
overwrite_dashboards => false,
6461
}
6562
```
@@ -68,8 +65,6 @@ class { 'puppet_metrics_dashboard':
6865

6966
```
7067
class { 'puppet_metrics_dashboard':
71-
configure_telegraf => true,
72-
enable_telegraf => true,
7368
master_list => ['master1.com',
7469
# Alternate ports may be configured using
7570
# a pair of: [hostname, port_number]
@@ -81,11 +76,11 @@ class { 'puppet_metrics_dashboard':
8176

8277
### Allow access to PE-managed postgres nodes with the following class:
8378

84-
This is required for collection of postgres metrics.
79+
This is required for collection of postgres metrics. The class should be applied to the master (or postgres server if using external postgres).
8580

8681
```
8782
class { 'puppet_metrics_dashboard::profile::postgres':
88-
grafana_host => 'postgres01',
83+
grafana_host => 'grafana-server.example.com',
8984
}
9085
```
9186

@@ -102,17 +97,15 @@ class { 'puppet_metrics_dashboard':
10297
}
10398
```
10499

105-
* This method requires enabling on the master side as described [here](https://puppet.com/docs/pe/2017.3/puppet_server_metrics/getting_started_with_graphite.html#enabling-puppet-server-graphite-support). The hostname(s) that you use in `master_list` should match the value(s) that you used for `metrics_server_id` in the `puppet_enterprise::profile::master` class.
100+
* This method requires enabling on the master side as described [here](https://puppet.com/docs/pe/2017.3/puppet_server_metrics/getting_started_with_graphite.html#enabling-puppet-server-graphite-support). The hostname(s) that you use in `master_list` should match the value(s) that you used for `metrics_server_id` in the `puppet_enterprise::profile::master` class.
106101

107-
### Enable Telegraf, Graphite, and Archive
102+
### Enable Telegraf, Graphite, and Archive (puppet_metrics)
108103

109104
```
110105
class { 'puppet_metrics_dashboard':
111106
add_dashboard_examples => true,
112107
influxdb_database_name => ['puppet_metrics','telegraf','graphite'],
113108
consume_graphite => true,
114-
configure_telegraf => true,
115-
enable_telegraf => true,
116109
}
117110
```
118111

@@ -130,14 +123,51 @@ By default, this will create a set of certificates in `/etc/grafana` that are ba
130123

131124
_Note:_ Enabling SSL on Grafana will not allow for running on privileged ports such as `443`. To enable this capability you can use the suggestions documented in [this Grafana documentation](http://docs.grafana.org/installation/configuration/#http-port)
132125

126+
### Profile defined types
127+
128+
The module includes defined types that you can use with an existing grafana implementation. For example:
129+
130+
#### Add telegraf to a master / compiler
131+
132+
```
133+
puppet_metrics_dashboard::profile::compiler{ $facts['networking']['fqdn']:
134+
timeout => '5s',
135+
}
136+
```
137+
138+
#### Add telegraf to a puppetdb node (see params.pp for `puppetdb_metrics` examples)
139+
140+
```
141+
puppet_metrics_dashboard::profile::puppetdb{ $facts['networking']['fqdn']:
142+
timeout => '5s',
143+
puppetdb_metrics => [
144+
{ 'name' => 'global_command-parse-time',
145+
'url' => 'puppetlabs.puppetdb.mq:name=global.command-parse-time' },
146+
{ 'name' => 'global_discarded',
147+
'url' => 'puppetlabs.puppetdb.mq:name=global.discarded' },
148+
]
149+
}
150+
```
151+
152+
#### Add telegraf to a postgres server
153+
154+
```
155+
puppet_metrics_dashboard::profile::master::postgres{ $facts['networking']['fqdn']:
156+
query_interval => '10m',
157+
}
158+
```
159+
160+
#### Note on using defined the types
161+
162+
Because of the way that the telegraf module works, these examples will overwrite any configuration in telegraf.config if it is *not* already puppet-managed. See the [puppet-telegraf documentation](https://forge.puppet.com/puppet/telegraf#usage) on how to manage this file and add important settings.
163+
133164
### Other possibilities
134165

135-
Configure the passwords for the InfluxDB and Grafana administrator users and enable additional [TICK Stack](https://www.influxdata.com/time-series-platform/) components.
166+
Configure the passwords for the InfluxDB and enable additional [TICK Stack](https://www.influxdata.com/time-series-platform/) components.
136167

137168
```
138169
class { 'puppet_metrics_dashboard':
139170
influx_db_password => 'secret',
140-
grafana_password => 'secret',
141171
grafana_http_port => 8080,
142172
grafana_version => '4.5.2',
143173
enable_chronograf => true,
@@ -147,7 +177,7 @@ class { 'puppet_metrics_dashboard':
147177

148178
## Reference
149179

150-
**Note** This section is no longer maintained. Please see the REFERENCE.MD file for current listings.
180+
**Note** This section is no longer maintained. Please see the REFERENCE.MD file for current listings.
151181

152182
## Limitations
153183

@@ -159,7 +189,7 @@ Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install telegraf' returned 1: Err
159189
Error: /Stage[main]/Pe_metrics_dashboard::Telegraf/Package[telegraf]/ensure: change from purged to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install telegraf' returned 1: Error: Cannot retrieve repository metadata (repomd.xml) for repository: influxdb. Please verify its path and try again
160190
```
161191

162-
To recify the issue, please update `nss` and `curl` on the affected system.
192+
To rectify the issue, please update `nss` and `curl` on the affected system.
163193

164194
```
165195
yum install curl nss --disablerepo influxdb

0 commit comments

Comments
 (0)