Update README.md

This commit is contained in:
gardouille 2015-02-17 15:12:25 +01:00
parent 27b5a9b61f
commit 89b228448c
1 changed files with 116 additions and 45 deletions

161
README.md
View File

@ -3,77 +3,148 @@
#### Table of Contents
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 xymon](#setup)
2. [Module Description](#module-description)
3. [Setup](#setup)
* [What xymon affects](#what-xymon-affects)
* [Setup requirements](#setup-requirements)
* [Beginning with xymon](#beginning-with-xymon)
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)
* [Beginning with Xymon](#beginning-with-xymon)
4. [Usage](#usage)
* [Client](#client)
5. [Reference](#reference)
* [Public classes](#public-classes)
* [Private classes](#private-classes)
* [Parameters](#parameters)
6. [Other notes](#other-notes)
7. [Limitations](#limitations)
8. [Development](#development)
9. [License](#license)
## Overview
A one-maybe-two sentence summary of what the module does/what problem it solves.
This is your 30 second elevator pitch for your module. Consider including
OS/Puppet version it works with.
The Xymon module provide a simple way to manage the last version of Xymon (client only right now) based on the packages provide by the Xymon project (deb files but could be rpm if passed as argument).
## Module Description
If applicable, this section should have a brief description of the technology
the module integrates with and what that integration enables. This section
should answer the questions: "What does this module *do*?" and "Why would I use
it?"
If your module has a range of functionality (installation, configuration,
management, etc.) this is the time to mention it.
The xymon module automates installing Xymon on systems.
## Setup
### What xymon affects
* A list of files, packages, services, or operations that the module will alter,
impact, or execute on the system it's installed on.
* This is a great place to stick any warnings.
* Can be in list or paragraph form.
### Setup Requirements **OPTIONAL**
If your module requires anything extra before setting up (pluginsync enabled,
etc.), mention it here.
* Package/service/configuration files for Xymon.
* Recommends and suggests packages for Xymon-plugins (aka hobbit-plugins).
### Beginning with xymon
The very basic steps needed for a user to get the module up and running.
To begin using xymon module with default parameters, declare the client class (server not yet available):
```
include xymon::client
```
If your most recent release breaks compatibility or requires particular steps
for upgrading, you may wish to include an additional section here: Upgrading
(For an example, see http://forge.puppetlabs.com/puppetlabs/firewall).
If you manage the sudoers with Puppet or a module (saz-sudo for example), you should add permissions for the Xymon user to be able to run some additional plugins:
```puppet
sudo::conf { 'xymon':
content => "xymon ALL=(root) NOPASSWD: /usr/bin/lsof -n -FpcLfn0
xymon ALL=(root) NOPASSWD: /usr/bin/debsums -ec
xymon ALL=(backuppc) SETENV:NOPASSWD: /usr/lib/xymon/client/ext/backuppc
xymon ALL=(list) SETENV:NOPASSWD: /usr/lib/xymon/client/ext/mailman",
}
```
## Usage
Put the classes, types, and resources for customizing, configuring, and doing
the fancy stuff with your module here.
### Client
#### Define the server
You should define the array of servers:
```
node 'first.toto' {
class { 'xymon::client':
list_server => [ '192.168.0.10' ],
}
}
node 'second.toto' {
class { 'xymon::client':
list_server => [ '127.0.0.1', '192.168.0.10' ],
}
}
```
**Note**: `list_server` must be an array even if you have only one Xymon server.
#### Disable additional plugins
Debian family comes with somes plugins for Xymon, but i don't know if it's available for other OS, so to disable it:
```
class {
plugin_pkg_ensure => 'absent',
}
```
## Reference
Here, list the classes, types, providers, facts, etc contained in your module.
This section should include all of the under-the-hood workings of your module so
people know what the module is touching on their system but don't need to mess
with things. (We are working on automating this section!)
### Public classes
## Limitations
* `xymon`: Main class, do nothing right now.
* `xymon::client`: Install and manage Xymon client.
### Private classes
* `xymon::client::preconfig`: Build the dl_url and pkg_name, with the parameters, to download the Xymon client package.
* `xymon::client::install`: Install the packages.
* `xymon::client::config`: Manage the configuration files.
* `xymon::client::service`: Manage the Xymon client service.
### Parameters
#### xymon::client
* `download_dir`: The directory to store Xymon packages. Defaults to '/opt/xymon/packages'.
* `download_url`: The URL to download Xymon client package. Should not be complete: **http://www.download/path/to/4.3.17/** will work but http://www.download/path/to/4.3.17/package.deb **will not work**. You must use the `package_name` variable. Defaults to 'undef'.
* `new_version`: The version of Xymon to download. Defaults to '4.3.17'.
* `package_name`: The Xymon client's package name to download and install. Defaults to undef.
* `pkg_ensure`: What to set the Xymon client package to. Can be 'present' or 'absent'. Defaults to 'present'.
* `pkg_provider`: The provider used to install Xymon client package. Defaults to 'dpkg'.
* `service_enabled`: If set to 'true', Puppet will ensure the Xymon client's service is running. Can be 'true' or 'false'. Defaults to 'true'.
* `service_managed`: If set to 'true', Puppet will manage the Xymon client's service. Can be 'true' or 'false'. Defaults to 'true'.
* `service_name`: Xymon client's service name. Defaults to 'xymon-client'.
* `service_default_path`: Path of the configuration file read by the Xymon client service. Defaults to '/etc/default/xymon-client'.
* `service_default_tpl`: Template file used to generate the system default file. Defaults to 'xymon/client/default.service.erb'.
* `service_path`: Path of the init script. Defaults to '/etc/init.d/xymon-client'.
* `service_tpl`: Template file used to generate the init script. Defaults to 'xymon/client/xymon-client.deb_service.erb'.
* `main_cfg_path`: Path to the main configuration file. Defaults to '/etc/xymon/xymonclient.cfg'.
* `main_cfg_tpl`: Template file used to generate the main configuration file. Defaults to 'xymon/client/xymonclient.cfg.erb'.
* `list_server`: List of IP-addresses of Xymon servers. Data will be sent to all of the servers listed here. Should be an array. Defaults to [ '127.0.0.1' ].
* `plugin_sug_pkg_name`: The list of suggests packages for Xymon-plugins (hobbit-plugins). Defaults to [ 'dctrl-tools', 'libsort-naturally-perl', 'libyaml-tiny-perl', 'lsb-release', 'lsof', 'debsums', 'fping', 'liblist-moreutils-perl', 'libsysadm-install-perl', 'libtimedate-perl', 'dphys-config' ].
* `plugin_download_url`:
* `plugin_pkg_name`: The Xymon-plugins package name. Defaults to 'hobbit-plugins'.
* `plugin_pkg_source`: The local source file to provide the plugin package. Defaults to 'puppet:///modules/xymon/client/hobbit-plugins_20141201_all_gardouille.deb'.
* `plugin_pkg_ensure`: What to set the Xymon plugins packages to. Can be 'present' or 'absent'. Defaults to 'present'.
* `plugin_pkg_provider`: The provider used to install Xymon plugins package. Defaults to 'dpkg'.
* `apt_accept_path`: Path of the accepted list of packages not installed from Debian repositories. Defaults to '/etc/xymon/apt_no_repo_accept'.
* `apt_accept_tpl`: Template used to generate the accepted packages. Defaults to 'xymon/client/apt_no_repo_accept.erb'.
Other notes
-----------
* The module does not compile the sources, it could be a feature in few times for more compatibility if enough people interested.
* I repack the hobbit-plugins package because the Debian's package depends on Xymon 4.3.17-2~ (**-2~** prevents the installation).
Limitations
-----------
This is where you list OS compatibility, version compatibility, etc.
## Development
Development
-----------
Since your module is awesome, other users will want to play with it. Let them
know what the ground rules for contributing are.
Free to send contributions, fork it, ...
## Release Notes/Contributors/Etc **Optional**
License
-------
WTFPL (http://wtfpl.org/)
If you aren't using changelog, put your release notes here (though you should
consider using changelog). You may also add any additional sections you feel are
necessary or important to include here. Please use the `## ` header.