Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Merfort committed Jun 22, 2015
2 parents 860381d + accc017 commit 35d6804
Show file tree
Hide file tree
Showing 11 changed files with 111 additions and 15 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ Below an overview of all changes in the releases.

Version (Release date)

1.5.0 (2015-06-08)

* Fix for: Inherting params #93
* Fix for: new postgresql instance #91; Also update metadata for postgresl module version
* Fix for: Need to overide php_values #89
* 2nd fix for: Zabbix-proxy install database population #62. Also for postgresql now.
* Added support to Amazon Linux with epel 6. #96 (By pull request: Wprosdocimo (Thanks!))
* import templates and create hostgroup if missing #95 (By pull request: 1n (Thanks!))
* Added Support For Zapache monitoring script #94 (By pull request: elricsfate (Thanks!))
* merge of hiera hashes from entire hierarchy #98 (By pull request: szemlyanoy (Thanks!))
* Added property script_ext for: File extensions of Userparameters scripts #97
* Updated documentation in README.md

1.4.0 (2015-05-18)

* Adding "apt" as dependency.
Expand Down
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@
* [zabbix-agent](#setup-zabbix-agent)
* [zabbix-proxy](#setup-zabbix-proxy)
* [zabbix-javagateway](#setup-zabbix-javagateway)
* [zabbix-userparameters](#setup-userparameters)
* [zabbix-userparameters](#setup-userparameters)
* [zabbix-template](#setup-template)
5. [Usage - Configuration options and additional functionality](#usage)
* [zabbix-server](#usage-zabbix-server)
* [zabbix-agent](#usage-zabbix-agent)
* [zabbix-proxy](#usage-zabbix-proxy)
* [zabbix-javagateway](#usage-zabbix-javagateway)
* [zabbix-userparameters](#usage-zabbix-userparameters)
* [zabbix-template](#usage-zabbix-template)
6. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
* [zabbix-server](#reference-zabbix-server)
* [zabbix-agent](#reference-zabbix-agent)
* [zabbix-proxy](#reference-zabbix-proxy)
* [zabbix-javagateway](#reference-zabbix-javagateway)
* [zabbix-userparameters](#reference-zabbix-userparameters)
* [zabbix-template](#reference-zabbix-template)
7. [Limitations - OS compatibility, etc.](#limitations)
8. [Development - Contributors](#contributors)
9. [Notes](#note)
Expand Down Expand Up @@ -111,6 +114,9 @@ When using zabbix::javagateway, you'll need to add the 'javagateway' parameter a
You can use userparameter files (or specific entries) to install it into the agent.
Also added with the 0.6.0 release is an class zabbix::userparameter. This class can be used with Hiera or The Foreman when you want to install userparameter files.

###Setup template
You can upload and install Zabbix Templates automatically via the Zabbix API. With this, you Zabbix templates are always up2date.

##Usage
The following will provide an basic usage of the zabbix components.
###Usage zabbix-server
Expand Down Expand Up @@ -339,6 +345,15 @@ zabbix::userparameter::data:
content: UserParameter=mysql.ping,mysqladmin -uroot ping | grep -c alive
```
###Usage zabbix-template
You can instal the MySQL template xml via the next example:
```ruby
zabbix::template { 'Template App MySQL':
templ_source => 'puppet:///modules/zabbix/MySQL.xml'
}
```

##Reference
There are some overall parameters which exists on all of the classes:
* `zabbix_version`: You can specify which zabbix release needs to be installed. Default is '2.4'.
Expand Down Expand Up @@ -382,6 +397,11 @@ This is the class for installing everything on a single host and thus all parame
* `apache_ssl_key`: The location of the ssl key file. You'll need to make sure this file is present on the system, this module will not install this file.
* `apache_ssl_cipher`: The ssl cipher used. Cipher is used from: https://wiki.mozilla.org/Security/Server_Side_TLS.
* `apache_ssl_chain`: The ssl_chain file. You'll need to make sure this file is present on the system, this module will not install this file.
* `apache_php_max_execution_time`: Max execution time for php.
* `apache_php_memory_limit`: PHP memory size limit.
* `apache_php_upload_max_filesize`: HP maximum upload filesize.
* `apache_php_max_input_time`: Max input time for php.
* `apache_php_always_populate_raw_post_data`: Default: -1
* `zabbix_api_user`: Username of user in Zabbix which is able to create hosts and edit hosts via the zabbix-api. Default: Admin
* `zabbix_api_pass`: Password for the user in Zabbix for zabbix-api usage. Default: zabbix

Expand Down Expand Up @@ -422,15 +442,22 @@ There are some zabbix specific parameters, please check them by opening the mani
* `source`: File which holds several userparameter entries.
* `content`: When you have 1 userparameter entry which you want to install.
* `script`: Low level discovery (LLD) script.
* `script_dir`: The script extention. Should be started with the dot. Like: .sh .bat .py
* `template`: When you use exported resources (when manage_resources on other components is set to true) you'll can add the name of the template which correspondents with the 'content' or 'source' which you add. The template will be added to the host.
* `script_dir`: When `script` is used, this parameter can provide the directly where this script needs to be placed. Default: '/usr/bin'

###Reference zabbix-template

* `templ_name`: The name of the template. This name will be found in the Web interface.
* `templ_source`: The location of the XML file wich needs to be imported.

##limitations
The module is only supported on the following operating systems:

Zabbix 2.4:

* CentOS 6.x, 7.x
* Amazon 6.x, 7.x
* RedHat 6.x, 7.x
* OracleLinux 6.x, 7.x
* Scientific Linux 6.x, 7.x
Expand Down Expand Up @@ -492,6 +519,10 @@ The following have contributed to this puppet module:
* altvnk
* rnelson0
* hkumarmk
* Wprosdocimo
* 1n
* szemlyanoy
* Wprosdocimo

Many thanks for this!
(If I have forgotten you, please let me know and put you in the list of fame. :-))
Expand Down
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
$apache_ssl_key = $zabbix::params::apache_ssl_key,
$apache_ssl_cipher = $zabbix::params::apache_ssl_cipher,
$apache_ssl_chain = $zabbix::params::apache_ssl_chain,
$apache_listen_ip = $zabbix::params::apache_listen_ip,
$apache_listenport = $zabbix::params::apache_listenport,
$apache_listenport_ssl = $zabbix::params::apache_listenport_ssl,
$apache_php_max_execution_time = $zabbix::params::apache_php_max_execution_time,
$apache_php_memory_limit = $zabbix::params::apache_php_memory_limit,
$apache_php_post_max_size = $zabbix::params::apache_php_post_max_size,
Expand Down Expand Up @@ -174,6 +177,9 @@
apache_ssl_key => $apache_ssl_key,
apache_ssl_cipher => $apache_ssl_cipher,
apache_ssl_chain => $apache_ssl_chain,
apache_listen_ip => $apache_listen_ip,
apache_listenport => $apache_listenport,
apache_listenport_ssl => $apache_listenport_ssl,
zabbix_api_user => $zabbix_api_user,
zabbix_api_pass => $zabbix_api_pass,
database_host => $database_host,
Expand Down
3 changes: 3 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
# This should be the most current and provide a higher level of security. (Security above everything else)
$apache_ssl_cipher = 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK'
$apache_ssl_chain = undef
$apache_listen_ip = undef
$apache_listenport = '80'
$apache_listenport_ssl = '443'
$server_api_user = 'Admin'
$server_api_pass = 'zabbix'

Expand Down
6 changes: 3 additions & 3 deletions manifests/resources/template.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#
#
define zabbix::resources::template (
$template_name = $title,
$template_source,
$template_name = $title,
$template_source = '',
) {

@@zabbix_template { "${template_name}":
@@zabbix_template { $template_name:
template_source => $template_source,
zabbix_url => '',
zabbix_user => '',
Expand Down
32 changes: 30 additions & 2 deletions manifests/template.pp
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
# == Define zabbix::template
#
# This will upload an Zabbix Template (XML format)
#
# === Requirements
#
# === Parameters
#
# [*templ_name*]
# The name of the template. This name will be found in the Web interface
#
# [*templ_source*]
# The location of the XML file wich needs to be imported.
#
# === Example
#
# zabbix::template { 'Template App MySQL':
# templ_source => 'puppet:///modules/zabbix/MySQL.xml'
# }
#
# === Authors
#
# Author Name: vlad.tkatchev@gmail.com
#
# === Copyright
#
# Copyright 2015 Vladislav Tkatchev
#
define zabbix::template (
$templ_name = $title,
$templ_source = '',
) {

zabbix::resources::template { "${templ_name}":
zabbix::resources::template { $templ_name:
template_name => $templ_name,
template_source => $templ_source,
}
}
}
5 changes: 2 additions & 3 deletions manifests/userparameter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
# Copyright 2014 Werner Dijkerman
#

class zabbix::userparameter (
$data = {},
) {
class zabbix::userparameter {
$data = hiera_hash('zabbix::userparameter::data', {})
validate_hash($data)
create_resources('zabbix::userparameters', $data)
}
6 changes: 5 additions & 1 deletion manifests/userparameters.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
# [*script*]
# Low level discovery (LLD) script.
#
# [*script_ext*]
# The script extention. Should be started with the dot. Like: .sh .bat .py
#
# [*template*]
# When you use exported resources (when manage_resources is set to true on other components)
# you'll can add the name of the template which correspondents with the 'content' or
Expand Down Expand Up @@ -53,6 +56,7 @@
$source = '',
$content = '',
$script = '',
$script_ext = '',
$template = '',
$script_dir = '/usr/bin',
) {
Expand Down Expand Up @@ -83,7 +87,7 @@
}

if $script != '' {
file { "${script_dir}/${name}":
file { "${script_dir}/${name}${script_ext}":
ensure => present,
owner => 'zabbix',
group => 'zabbix',
Expand Down
17 changes: 14 additions & 3 deletions manifests/web.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
# [*apache_ssl_chain*}
# The ssl chain file.
#
# [*apache_listenport*}
# The port for the apache vhost.
#
# [*apache_listenport_ssl*}
# The port for the apache SSL vhost.
#
# [*zabbix_api_user*]
# Name of the user which the api should connect to. Default: Admin
#
Expand Down Expand Up @@ -152,6 +158,9 @@
$apache_ssl_key = $zabbix::params::apache_ssl_key,
$apache_ssl_cipher = $zabbix::params::apache_ssl_cipher,
$apache_ssl_chain = $zabbix::params::apache_ssl_chain,
$apache_listen_ip = $zabbix::params::apache_listen_ip,
$apache_listenport = $zabbix::params::apache_listenport,
$apache_listenport_ssl = $zabbix::params::apache_listenport_ssl,
$zabbix_api_user = $zabbix::params::server_api_user,
$zabbix_api_pass = $zabbix::params::server_api_pass,
$database_host = $zabbix::params::server_database_host,
Expand Down Expand Up @@ -253,14 +262,14 @@
# vhost for redirect traffic from non ssl to ssl site.
if $apache_use_ssl {
# Listen port
$apache_listen_port = '443'
$apache_listen_port = $apache_listenport_ssl

# We create nonssl vhost for redirecting non ssl
# traffic to https.
apache::vhost { "${zabbix_url}_nonssl":
docroot => '/usr/share/zabbix',
manage_docroot => false,
port => '80',
port => $apache_listenport,
servername => $zabbix_url,
ssl => false,
rewrites => [
Expand All @@ -273,7 +282,7 @@
}
} else {
# So no ssl, so default port 80
$apache_listen_port = '80'
$apache_listen_port = $apache_listenport
}

# Check which version of Apache we're using
Expand All @@ -287,7 +296,9 @@

apache::vhost { $zabbix_url:
docroot => '/usr/share/zabbix',
ip => $apache_listen_ip,
port => $apache_listen_port,
add_listen => true,
directories => [
merge({
path => '/usr/share/zabbix',
Expand Down
2 changes: 1 addition & 1 deletion manifests/zapache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# Check if apache_status is true, installs Zapache scripts. Defaults to false.
class zabbix::zapache (
$apache_status = $zabbix::params::apache_status,
) inherits zabbix::params {
) inherits zabbix::params {
# Check if apache_status is boolean
validate_bool($apache_status)

Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wdijkerman-zabbix",
"version": "1.4.0",
"version": "1.5.0",
"summary": "Installing and maintaining zabbix. Will install server, proxy, java-gateway and agent on RedHat/Debian/Ubuntu (Incl. exported resources).",
"author": "Werner Dijkerman",
"dependencies": [
Expand All @@ -24,6 +24,7 @@
],
"operatingsystem_support": [
{ "operatingsystem":"RedHat", "operatingsystemrelease": [ "5.0", "6.0", "7.0" ] },
{ "operatingsystem":"Amazon", "operatingsystemrelease": [ "5.0", "6.0", "7.0" ] },
{ "operatingsystem":"OracleLinux", "operatingsystemrelease": [ "5.0", "6.0", "7.0" ] },
{ "operatingsystem":"Scientific", "operatingsystemrelease": [ "5.0", "6.0", "7.0" ] },
{ "operatingsystem":"CentOS", "operatingsystemrelease": [ "5.0", "6.0", "7.0" ] },
Expand Down

0 comments on commit 35d6804

Please sign in to comment.