211 lines
9.3 KiB
Markdown
211 lines
9.3 KiB
Markdown
# xymon
|
|
|
|
#### Table of Contents
|
|
|
|
1. [Overview](#overview)
|
|
2. [Module Description](#module-description)
|
|
3. [Setup](#setup)
|
|
* [What xymon affects](#what-xymon-affects)
|
|
* [Beginning with Xymon](#beginning-with-xymon)
|
|
4. [Usage](#usage)
|
|
* [Server](#server)
|
|
* [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
|
|
|
|
The Xymon module provide a simple way to manage the last version of Xymon based on the packages provide by the Xymon project (packages could be rpm if passed as argument).
|
|
|
|
## Module Description
|
|
|
|
The xymon module automates installing Xymon on systems.
|
|
|
|
## Setup
|
|
|
|
### What xymon affects
|
|
|
|
* Package/service/configuration files for Xymon.
|
|
* Recommends and suggests packages for Xymon-plugins (aka hobbit-plugins).
|
|
* Default Apache2 configuration (puppetlabs-apache).
|
|
* Virtual host for Xymon server.
|
|
|
|
### Beginning with xymon
|
|
|
|
To begin using xymon module with default parameters, declare the server class:
|
|
```
|
|
include xymon::server
|
|
```
|
|
|
|
And on others nodes, the client:
|
|
```
|
|
class { 'xymon::client':
|
|
list_server => [ '192.168.0.10' ]
|
|
}
|
|
```
|
|
|
|
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
|
|
|
|
### Server
|
|
|
|
#### Default behaviour
|
|
|
|
By default, the server class will manage both server and client (ensure install but disable the service) for Xymon, the virtual host for Apache2 and somes configurations files for Xymon server:
|
|
```
|
|
class { 'xymon::server': }
|
|
```
|
|
|
|
If you choose a different version, it will also be applied to the `xymon::client` class.
|
|
|
|
#### Disable client management
|
|
|
|
If you prefer to manage the Xymon client separately:
|
|
```
|
|
class { 'xymon::server':
|
|
manage_client => false,
|
|
}
|
|
```
|
|
|
|
#### Disable Apache configuration and virtual host:
|
|
|
|
The virtual host for Apache2 look like the one provide by the project (http://sourceforge.net/p/xymon/code/HEAD/tree/branches/4.3.17/xymond/etcfiles/xymon-apache-secure.DIST), if you prefer a vhost and Apache2 managed by yourself:
|
|
```
|
|
class { 'xymon::server':
|
|
manage_apache_conf => false,
|
|
manage_apache_vhost => false,
|
|
}
|
|
```
|
|
|
|
### 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
|
|
|
|
### Public classes
|
|
|
|
* `xymon`: Main class, do nothing right now.
|
|
* `xymon::server`: Install and manage Xymon server.
|
|
* `xymon::client`: Install and manage Xymon client.
|
|
|
|
### Private classes
|
|
|
|
* `xymon::server::preconfig`: Ensure `xymon::client` class is defined and build dl_url and pkg_name variables with the parameters.
|
|
* `xymon::server::install`: Install the server packages.
|
|
* `xymon::server::config`: Provide some contribution files.
|
|
* `xymon::server::service`: Manage the Xymon server service.
|
|
* `xymon::server::apache`: Ensure the `::apache` class is defined (from puppetlabs-apache) and provide a virtual host.
|
|
* `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::server
|
|
* `dep_pkg_name`: The list of depends packages to install Xymon server. Could be an array. Defaults to [ 'debconf', 'libc-ares2', 'libc6', 'libldap-2.4-2', 'libpng12-0', 'librrd4', 'libssl1.0.0', 'perl' ].
|
|
* `download_dir`: The directory to store Xymon packages. Defaults to '/opt/xymon/packages'.
|
|
* `download_url`: The URL to download Xymon server 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 server's package name to download and install. Defaults to undef.
|
|
* `pkg_ensure`: What to set the Xymon server package to. Can be 'present' or 'absent'. Defaults to 'present'.
|
|
* `pkg_provider`: The provider used to install Xymon server package. Defaults to 'dpkg'.
|
|
* `service_enabled`: If set to 'true', Puppet will ensure the Xymon server's service is running. Can be 'true' or 'false'. Defaults to 'true'.
|
|
* `service_managed`: If set to 'true', Puppet will manage the Xymon server's service. Can be 'true' or 'false'. Defaults to 'true'.
|
|
* `service_name`: Xymon server's service name. Defaults to 'xymon'.
|
|
* `manage_client`: If set to 'true', the `xymon::server` class will also manage a default installation of the client with `xymon::client` class. Can be 'true' or 'false'. Defaults to 'true'.
|
|
* `manage_apache_conf`: If set to 'true', Puppet will ensure the `::apache` is defined otherwise it will defined a default one with 'mpm module'. Can be 'true' or 'false'. Defaults to 'true'.
|
|
* `manage_apache_vhost`: If set to 'true', Puppet will provide a virtual host for Apache. Can be 'true' or 'false'. Defaults to 'true'.
|
|
|
|
#### 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
|
|
-----------
|
|
|
|
Free to send contributions, fork it, ...
|
|
|
|
License
|
|
-------
|
|
|
|
WTFPL (http://wtfpl.org/)
|
|
|