Showing with 17 additions and 14 deletions.
  1. +8 −0 CHANGELOG.md
  2. +4 −4 README.md
  3. +1 −1 functions/hosts_with_pe_profile.pp
  4. +3 −5 manifests/system.pp
  5. +1 −1 metadata.json
  6. +0 −3 spec/classes/puppet_metrics_collector_system_spec.rb
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [v7.0.1](https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/tree/v7.0.1) (2021-07-16)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/compare/v7.0.0...v7.0.1)

### Fixed

- Change system notify to warning function [\#131](https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/pull/131) ([m0dular](https://github.com/m0dular))

## [v7.0.0](https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/tree/v7.0.0) (2021-07-02)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/compare/v6.6.0...v7.0.0)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ It takes an optional `-m` or `--metrics-directory` parameter (default `/opt/pupp
It takes an optional `-r` or `--retention-days` parameter (default: `30`) to limit the number of days to include in the archive.

```bash
[root@master ~]# /opt/puppetlabs/puppet-metrics-collector/scripts/create-metrics-archive
[root@primary ~]# /opt/puppetlabs/puppet-metrics-collector/scripts/create-metrics-archive
Created metrics archive: /root/puppet-metrics-collector-20200203T123456Z.tar.gz
```

Expand Down Expand Up @@ -253,7 +253,7 @@ puppet apply -e "class { 'puppet_metrics_collector': }" --modulepath /tmp;

If necessary, you can manually configure this module by specifying parameters via the class declaration or via Hiera data.
The preferred method is via Hiera data.
The following examples show you how to specify those parameters for different infrastructures, and assumes you declare this module on the Primary Master.
The following examples show you how to specify those parameters for different infrastructures, and assumes you declare this module on the Primary Server.


#### Monolithic Infrastructure with Compilers
Expand Down Expand Up @@ -286,10 +286,10 @@ class { 'puppet_metrics_collector':
### Configuration for Distributed Metrics Collection

This option collect metrics on each PE Infrastructure Host instead of collecting metrics centrally on the Primary Server.
This option is discouraged, but allows for the collection of metrics when the Primary Master cannot access the API endpoints of the other PE Infrastructure Hosts.
This option is discouraged, but allows for the collection of metrics when the Primary Server cannot access the API endpoints of the other PE Infrastructure Hosts.
Classify each PE Infrastructure Host with this module, specifying the following parameters.

When classifying a Compile Master, specify these additional parameters:
When classifying a Compiler, specify these additional parameters:

```puppet
class { 'puppet_metrics_collector':
Expand Down
2 changes: 1 addition & 1 deletion functions/hosts_with_pe_profile.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

function puppet_metrics_collector::hosts_with_pe_profile($profile) {
# storeconfigs is used here to determine if PuppetDB is available to query.
# See: https://github.com/puppetlabs/puppet-enterprise-modules/blob/master/docs/pe-modules-next-discussion-outline.txt
# See: https://github.com/puppetlabs/puppet-enterprise-modules/blob/main/docs/pe-modules-next-discussion-outline.txt
if $settings::storeconfigs {
$_profile = capitalize($profile)
$hosts = puppetdb_query("resources[certname] {
Expand Down
8 changes: 3 additions & 5 deletions manifests/system.pp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,9 @@
contain puppet_metrics_collector::system::cpu
contain puppet_metrics_collector::system::memory
contain puppet_metrics_collector::system::processes
} else {
notify { 'sysstat_missing_warning':
message => 'System collection disabled. Set `puppet_metrics_collector::system::manage_sysstat: true` to enable system metrics',
loglevel => warning,
}
}
else {
warning('System collection disabled. Set `puppet_metrics_collector::system::manage_sysstat: true` to enable system metrics')
}

if $facts['virtual'] == 'vmware' {
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-puppet_metrics_collector",
"version": "7.0.0",
"version": "7.0.1",
"author": "puppetlabs",
"summary": "A Puppet module for gathering metrics from PE components",
"license": "Apache-2.0",
Expand Down
3 changes: 0 additions & 3 deletions spec/classes/puppet_metrics_collector_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
let(:pre_condition) { 'package{"sysstat": }' }
let(:facts) { { puppet_metrics_collector: { have_sysstat: true, have_systemd: true } } }

it { is_expected.not_to contain_notify('sysstat_missing_warning') }
it { is_expected.to contain_class('puppet_metrics_collector::system::cpu') }
it { is_expected.to contain_class('puppet_metrics_collector::system::memory') }
it { is_expected.to contain_class('puppet_metrics_collector::system::processes') }
Expand All @@ -21,15 +20,13 @@
let(:params) { { manage_sysstat: true } }
let(:facts) { { puppet_metrics_collector: { have_sysstat: false, have_systemd: true } } }

it { is_expected.not_to contain_notify('sysstat_missing_warning') }
it { is_expected.to contain_package('sysstat') }
it { is_expected.to contain_class('puppet_metrics_collector::system::cpu') }
it { is_expected.to contain_class('puppet_metrics_collector::system::memory') }
it { is_expected.to contain_class('puppet_metrics_collector::system::processes') }
end

context 'not installed and not managed' do
it { is_expected.to contain_notify('sysstat_missing_warning') }
it { is_expected.not_to contain_package('sysstat') }
it { is_expected.not_to contain_class('puppet_metrics_collector::system::cpu') }
it { is_expected.not_to contain_class('puppet_metrics_collector::system::memory') }
Expand Down