https://github.com/tomohiro/puppet-mackerel_agent
Puppet module for mackerel-agent
https://github.com/tomohiro/puppet-mackerel_agent
mackerel mackerel-agent puppet
Last synced: 29 days ago
JSON representation
Puppet module for mackerel-agent
- Host: GitHub
- URL: https://github.com/tomohiro/puppet-mackerel_agent
- Owner: tomohiro
- License: other
- Created: 2014-12-07T09:38:20.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-11-06T04:43:01.000Z (over 4 years ago)
- Last Synced: 2025-04-11T17:27:47.622Z (about 1 month ago)
- Topics: mackerel, mackerel-agent, puppet
- Language: Puppet
- Homepage: https://forge.puppetlabs.com/tomohiro/mackerel_agent
- Size: 89.8 KB
- Stars: 4
- Watchers: 1
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
Puppet module for mackerel-agent
================================================================================[](https://forge.puppetlabs.com/tomohiro/mackerel_agent)
[](https://gemnasium.com/Tomohiro/puppet-mackerel_agent)
[](https://travis-ci.org/Tomohiro/puppet-mackerel_agent)Table of Contents
--------------------------------------------------------------------------------1. [Overview - What is the mackerel_agent module?](#overview)
2. [Setup - The basics of getting started](#setup)
3. [Usage - How to use the module](#usage)
4. [Limitations - OS compatibility, etc.](#limitations)
5. [Development - Guide for contributing to the module](#development)Overview
--------------------------------------------------------------------------------This Puppet module install and configure [mackerel-agent](https://github.com/mackerelio/mackerel-agent).
Setup
--------------------------------------------------------------------------------Install via Puppet Forge:
```sh
$ puppet module install tomohiro-mackerel_agent
```Usage
--------------------------------------------------------------------------------```puppet
class { 'mackerel_agent':
apikey => 'Your API Key',
roles => ['service:web', 'service:database'],
host_status => {
on_start => 'working',
on_stop => 'poweroff'
},
ignore_filesystems => '/dev/ram.*',
use_metrics_plugins => true,
use_check_plugins => true,
metrics_plugins => {
apache2 => '/usr/local/bin/mackerel-plugin-apache2',
php-opcache => '/usr/local/bin/mackerel-plugin-php-opcache'
},
check_plugins => {
access_log => '/usr/local/bin/check-log --file /var/log/access.log --pattern FATAL',
check_cron => '/usr/local/bin/check-procs -p crond'
check_ssh => {
command => 'ruby /path/to/check-ssh.rb',
notification_interval => '60',
max_check_attempts => '3',
check_interval => '5'
}
}
}
```### Hiera
```yaml
mackerel_agent::apikey: 'Your API Key'
mackerel_agent::roles:
- 'service:web'
- 'service:database'
mackerel_agent::host_status:
on_start: working
on_stop: poweroff
mackerel_agent::ignore_filesystems: '/dev/ram.*'
mackerel_agent::use_metrics_plugins: true
mackerel_agent::use_check_plugins: true
mackerel_agent::metrics_plugins:
apache2: '/usr/local/bin/mackerel-plugin-apache2'
php-opcache: '/usr/local/bin/mackerel-plugin-php-opcache'
mackerel_agent::check_plugins:
access_log: '/usr/local/bin/check-log --file /var/log/access.log --pattern FATAL'
check_cron: '/usr/local/bin/check-procs -p crond'
ssh:
command: 'ruby /path/to/check-ssh.rb'
notification_interval: '60'
max_check_attempts: '3'
check_interval: '5'
```Limitations
--------------------------------------------------------------------------------These operation systems are supported.
- RHEL 6
- CentOS 6
- Debian 7
- Ubuntu 14.04The person who want to add an operating system to supported list should implement it himself.
Development
--------------------------------------------------------------------------------### Requirements
- Puppet 3.7 or later
- librarian-puppet### Setup development environments
Install dependencies:
```sh
$ bundle install --path vendor/bundle
$ bundle exec librarian-puppet install
```You can run smoke tests:
```sh
$ export MACKEREL_API_KEY="your api key" # Export a your mackerel API key
$ vagrant up
$ vagrant provision
```### Testing
Unit tests:
```sh
$ bundle exec rake spec
```Acceptance tests:
```sh
$ export DOCKER_HOST=tcp://your-docker-host-ip:port
$ BEAKER_set=centos-6-x64 bundle exec rake beaker
```### Contributing
See [CONTRIBUTING](CONTRIBUTING.md) guideline.
LICENSE
--------------------------------------------------------------------------------© 2014 - 2016 Tomohiro TAIRA.
This project is licensed under the Apache License, Version 2.0.
See [LICENSE](LICENSE) for details.