<commit_before>Puppet Monitoring
=================

[![Build Status](https://travis-ci.org/Yuav/puppet-monitoring.svg)](https://travis-ci.org/Yuav/puppet-monitoring)

1. [Overview](#overview)
2. [Module Description - What the module does and why it is useful](#module-description)
3. [Setup - The basics of getting started with monitoring](#setup)
4. [Usage - Configuration options and additional functionality](#usage)
5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
5. [Limitations - OS compatibility, etc.](#limitations)
6. [Development - Guide for contributing to the module](#development)

## Overview

Module to install monitoring for any detected service supported

## Module Description

Detects installed services by using custom facts. This enables complete decoupling of monitoring from deployment of services.
The module provides a highly opinionated monitoring client setup, and assumes the existence of server side components being available.

With the help of [yuav-refacter](https://github.com/Yuav/puppet-refacter), the services installed during the same run will cause facts refresh prior to installing monitoring tools

Decoupling monitoring module from other modules is useful in order to avoid adding monitoring code
into the modules themselves. The module will magically install monitoring of everything installed on a machine without any
hard dependencies between the module that install the service and the monitoring module.

## Setup

Install the module using:
```puppet
puppet module install yuav-monitoring
```

## Usage

```puppet
class { 'monitoring':
  collectd_network_server_hostname => 'influxdb',
  sensu_rabbitmq_hostname => 'sensu.server',
  sensu_rabbitmq_password => '<PASSWORD>',
}
```
This will install CollectD and Sensu, and report to 'influxdb' and 'sensu.server' respectively.

 * CollectD will get installed only if collectd_network_server_hostname is set
 * Sensu will get installed only if sensu_rabbitmq_hostname is set

## Reference

### CollectD plugins

Default:
 * cpu
 * disk
 * df
 * fhcount
 * interface
 * load
 * memory
 * uptime

If present:
 * apache (if statuspage is enabled)
 * ntpd
 * rabbitmq (if management interface enabled)
 * redis

### Sensu plugins

Default:
  * cpu
  * memory
  * disk
  * load
  * filesystem
  * process
  * network

If present:<commit_msg>Added documentation on enabling rabbitmq management<commit_after>Puppet Monitoring
=================

[![Build Status](https://travis-ci.org/Yuav/puppet-monitoring.svg)](https://travis-ci.org/Yuav/puppet-monitoring)

1. [Overview](#overview)
2. [Module Description - What the module does and why it is useful](#module-description)
3. [Setup - The basics of getting started with monitoring](#setup)
4. [Usage - Configuration options and additional functionality](#usage)
5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
5. [Limitations - OS compatibility, etc.](#limitations)
6. [Development - Guide for contributing to the module](#development)

## Overview

Module to install monitoring for any detected service supported

## Module Description

Detects installed services by using custom facts. This enables complete decoupling of monitoring from deployment of services.
The module provides a highly opinionated monitoring client setup, and assumes the existence of server side components being available.

With the help of [yuav-refacter](https://github.com/Yuav/puppet-refacter), the services installed during the same run will cause facts refresh prior to installing monitoring tools

Decoupling monitoring module from other modules is useful in order to avoid adding monitoring code
into the modules themselves. The module will magically install monitoring of everything installed on a machine without any
hard dependencies between the module that install the service and the monitoring module.

## Setup

Install the module using:
```puppet
puppet module install yuav-monitoring
```

## Usage

```puppet
class { 'monitoring':
  collectd_network_server_hostname => 'influxdb',
  sensu_rabbitmq_hostname => 'sensu.server',
  sensu_rabbitmq_password => '<PASSWORD>',
}
```
This will install CollectD and Sensu, and report to 'influxdb' and 'sensu.server' respectively.

 * CollectD will get installed only if collectd_network_server_hostname is set
 * Sensu will get installed only if sensu_rabbitmq_hostname is set

## Reference

### CollectD plugins

Default:
 * cpu
 * disk
 * df
 * fhcount
 * interface
 * load
 * memory
 * uptime

If present:
 * apache (if statuspage is enabled)
 * ntpd
 * rabbitmq (if management interface enabled)
 * redis

#### RabbitMQ plugin

To get metrics from RabbitMQ, the management module needs to be enabled. This can be done like so;

    rabbitmq-plugins enable rabbitmq_management

CollectD will use user "guest" by default. This user is available and only available from localhost on default installations.
On a non-default installation you might get 401 permission denied errors in CollectD plugin logs. You can fix this by;

    rabbitmqctl set_user_tags guest monitoring
    rabbitmqctl -q list_vhosts | xargs -n1 rabbitmqctl set_permissions guest ".*" ".*" ".*" -p

### Sensu plugins

Default:
  * cpu
  * memory
  * disk
  * load
  * filesystem
  * process
  * network

If present:
{'fraction_non_alphanumeric': 0.0833645560134882, 'fraction_numerical': 0.0033720494567253652, 'mean_word_length': 4.747039827771798, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1231652', 'n_tokens_mistral': 1497, 'n_tokens_neox': 1410, 'n_words': 607}