Configures tox environments
This tests are performed:
* puppet-lint and puppet-syntax for manifests and plugin_zabbix module
* run spec test for plugin_zabbix module
The patch fixes puppet lint warnings in the same time
Change-Id: I060f59f724ec9325db8bc5f5718479ff42501686
(cherry picked from commit 55cbcb8cd0
)
This commit is contained in:
parent
2e15045c9c
commit
a2762c74a3
|
@ -2,3 +2,7 @@
|
|||
zabbix_monitoring*.noarch.rpm
|
||||
repositories/centos/*.rpm
|
||||
repositories/ubuntu/*.deb
|
||||
.bundled_gems/
|
||||
.bundle/
|
||||
Gemfile.lock
|
||||
.tox/
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
# Copyright 2015 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'rake'
|
||||
gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.4.0'
|
||||
gem 'puppetlabs_spec_helper'
|
||||
# Need to use master branch of puppet-lint because of
|
||||
# https://github.com/rodjek/puppet-lint/issues/355
|
||||
gem 'puppet-lint', :git => 'https://github.com/rodjek/puppet-lint.git'
|
||||
end
|
|
@ -0,0 +1,13 @@
|
|||
require 'puppet-lint/tasks/puppet-lint'
|
||||
require 'puppet-syntax/tasks/puppet-syntax'
|
||||
|
||||
PuppetLint.configuration.fail_on_warnings = true
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
|
||||
PuppetLint.configuration.send('disable_class_parameter_defaults')
|
||||
|
||||
desc "Run lint, and syntax tests."
|
||||
task :test => [
|
||||
:lint,
|
||||
:syntax,
|
||||
]
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright 2015 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'rake'
|
||||
gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.4.0'
|
||||
gem 'puppetlabs_spec_helper'
|
||||
# Need to use master branch of puppet-lint because of
|
||||
# https://github.com/rodjek/puppet-lint/issues/355
|
||||
gem 'puppet-lint', :git => 'https://github.com/rodjek/puppet-lint.git'
|
||||
end
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
require 'puppetlabs_spec_helper/rake_tasks'
|
||||
require 'puppet-lint/tasks/puppet-lint'
|
||||
require 'puppet-syntax/tasks/puppet-syntax'
|
||||
|
||||
PuppetLint.configuration.fail_on_warnings = true
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
|
||||
PuppetLint.configuration.send('disable_class_parameter_defaults')
|
||||
PuppetLint.configuration.send('disable_autoloader_layout')
|
||||
|
||||
desc "Run lint, and syntax and spec tests."
|
||||
task :test => [
|
||||
:lint,
|
||||
:syntax,
|
||||
:spec,
|
||||
]
|
||||
|
|
@ -18,27 +18,27 @@ class plugin_zabbix::agent::scripts {
|
|||
include plugin_zabbix::params
|
||||
|
||||
file { $plugin_zabbix::params::agent_scripts:
|
||||
ensure => directory,
|
||||
recurse => true,
|
||||
purge => true,
|
||||
force => true,
|
||||
mode => '0755',
|
||||
source => 'puppet:///modules/plugin_zabbix/scripts',
|
||||
ensure => directory,
|
||||
recurse => true,
|
||||
purge => true,
|
||||
force => true,
|
||||
mode => '0755',
|
||||
source => 'puppet:///modules/plugin_zabbix/scripts',
|
||||
}
|
||||
|
||||
file { '/etc/zabbix/check_api.conf':
|
||||
ensure => present,
|
||||
content => template('plugin_zabbix/check_api.conf.erb'),
|
||||
ensure => present,
|
||||
content => template('plugin_zabbix/check_api.conf.erb'),
|
||||
}
|
||||
|
||||
file { '/etc/zabbix/check_rabbit.conf':
|
||||
ensure => present,
|
||||
content => template('plugin_zabbix/check_rabbit.conf.erb'),
|
||||
ensure => present,
|
||||
content => template('plugin_zabbix/check_rabbit.conf.erb'),
|
||||
}
|
||||
|
||||
file { '/etc/zabbix/check_db.conf':
|
||||
ensure => present,
|
||||
content => template('plugin_zabbix/check_db.conf.erb'),
|
||||
ensure => present,
|
||||
content => template('plugin_zabbix/check_db.conf.erb'),
|
||||
}
|
||||
|
||||
if ! defined(Package['sudo']) {
|
||||
|
@ -55,5 +55,4 @@ class plugin_zabbix::agent::scripts {
|
|||
source => 'puppet:///modules/plugin_zabbix/zabbix-sudo',
|
||||
require => Package['sudo'],
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,28 +21,28 @@ class plugin_zabbix::controller {
|
|||
$host = regsubst($plugin_zabbix::params::db_ip,'^(\d+\.\d+\.\d+\.)\d+','\1%')
|
||||
|
||||
file { '/etc/dbconfig-common':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
file { '/etc/dbconfig-common/zabbix-server-mysql.conf':
|
||||
ensure => present,
|
||||
require => File['/etc/dbconfig-common'],
|
||||
mode => '0600',
|
||||
source => 'puppet:///modules/plugin_zabbix/zabbix-server-mysql.conf',
|
||||
ensure => present,
|
||||
require => File['/etc/dbconfig-common'],
|
||||
mode => '0600',
|
||||
source => 'puppet:///modules/plugin_zabbix/zabbix-server-mysql.conf',
|
||||
}
|
||||
|
||||
package { $plugin_zabbix::params::server_pkg:
|
||||
ensure => present,
|
||||
require => File['/etc/dbconfig-common/zabbix-server-mysql.conf'],
|
||||
ensure => present,
|
||||
require => File['/etc/dbconfig-common/zabbix-server-mysql.conf'],
|
||||
}
|
||||
|
||||
file { $plugin_zabbix::params::server_config:
|
||||
ensure => present,
|
||||
require => Package[$plugin_zabbix::params::server_pkg],
|
||||
content => template($plugin_zabbix::params::server_config_template),
|
||||
ensure => present,
|
||||
require => Package[$plugin_zabbix::params::server_pkg],
|
||||
content => template($plugin_zabbix::params::server_config_template),
|
||||
}
|
||||
|
||||
file { $plugin_zabbix::params::zabbix_extra_conf_dir:
|
||||
|
@ -54,12 +54,12 @@ class plugin_zabbix::controller {
|
|||
}
|
||||
|
||||
file { 'zabbix-server-ocf' :
|
||||
ensure => present,
|
||||
path => "${plugin_zabbix::params::ocf_scripts_dir}/${plugin_zabbix::params::ocf_scripts_provider}/${plugin_zabbix::params::server_service}",
|
||||
mode => '0755',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
source => 'puppet:///modules/plugin_zabbix/zabbix-server.ocf',
|
||||
ensure => present,
|
||||
path => "${plugin_zabbix::params::ocf_scripts_dir}/${plugin_zabbix::params::ocf_scripts_provider}/${plugin_zabbix::params::server_service}",
|
||||
mode => '0755',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
source => 'puppet:///modules/plugin_zabbix/zabbix-server.ocf',
|
||||
}
|
||||
if $zabbix_pcmk_managed == '' {
|
||||
service { "${plugin_zabbix::params::server_service}-init-stopped":
|
||||
|
@ -70,10 +70,10 @@ class plugin_zabbix::controller {
|
|||
}
|
||||
}
|
||||
service { "${plugin_zabbix::params::server_service}-started":
|
||||
ensure => running,
|
||||
name => "p_${plugin_zabbix::params::server_service}",
|
||||
enable => true,
|
||||
provider => 'pacemaker',
|
||||
ensure => running,
|
||||
name => "p_${plugin_zabbix::params::server_service}",
|
||||
enable => true,
|
||||
provider => 'pacemaker',
|
||||
}
|
||||
|
||||
if $zabbix_pcmk_managed == '' {
|
||||
|
@ -94,23 +94,22 @@ class plugin_zabbix::controller {
|
|||
|
||||
if $plugin_zabbix::params::frontend {
|
||||
class { 'plugin_zabbix::frontend':
|
||||
require => File[$plugin_zabbix::params::server_config],
|
||||
before => Class['plugin_zabbix::ha::haproxy'],
|
||||
require => File[$plugin_zabbix::params::server_config],
|
||||
before => Class['plugin_zabbix::ha::haproxy'],
|
||||
}
|
||||
}
|
||||
|
||||
include plugin_zabbix::ha::haproxy
|
||||
|
||||
firewall { '998 zabbix agent vip':
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
port => $plugin_zabbix::params::zabbix_ports['agent'],
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
port => $plugin_zabbix::params::zabbix_ports['agent'],
|
||||
}
|
||||
|
||||
firewall { '998 zabbix server vip':
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
port => $plugin_zabbix::params::zabbix_ports['server'],
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
port => $plugin_zabbix::params::zabbix_ports['server'],
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,9 +36,9 @@ class plugin_zabbix::db::mysql(
|
|||
}
|
||||
|
||||
file { '/tmp/zabbix/parts/data_clean.sql':
|
||||
ensure => present,
|
||||
require => File['/tmp/zabbix/parts'],
|
||||
content => template('plugin_zabbix/data_clean.erb'),
|
||||
ensure => present,
|
||||
require => File['/tmp/zabbix/parts'],
|
||||
content => template('plugin_zabbix/data_clean.erb'),
|
||||
}
|
||||
|
||||
exec { 'prepare-schema-1':
|
||||
|
|
|
@ -25,46 +25,46 @@ class plugin_zabbix::frontend {
|
|||
}
|
||||
|
||||
package { $plugin_zabbix::params::frontend_pkg:
|
||||
ensure => present,
|
||||
require => [
|
||||
ensure => present,
|
||||
require => [
|
||||
File['/etc/dbconfig-common/zabbix-server-mysql.conf'],
|
||||
Package[$plugin_zabbix::params::php_mysql_pkg]
|
||||
],
|
||||
}
|
||||
|
||||
package { $plugin_zabbix::params::php_mysql_pkg:
|
||||
ensure => present
|
||||
ensure => present
|
||||
}
|
||||
|
||||
file { $plugin_zabbix::params::frontend_config:
|
||||
ensure => present,
|
||||
content => template($plugin_zabbix::params::frontend_config_template),
|
||||
notify => Service[$plugin_zabbix::params::frontend_service],
|
||||
require => Package[$plugin_zabbix::params::frontend_pkg],
|
||||
ensure => present,
|
||||
content => template($plugin_zabbix::params::frontend_config_template),
|
||||
notify => Service[$plugin_zabbix::params::frontend_service],
|
||||
require => Package[$plugin_zabbix::params::frontend_pkg],
|
||||
}
|
||||
|
||||
file_line { 'php timezone':
|
||||
path => $plugin_zabbix::params::frontend_service_config,
|
||||
line => ' php_value date.timezone UTC',
|
||||
match => 'php_value date.timezone',
|
||||
notify => Service[$plugin_zabbix::params::frontend_service],
|
||||
require => Package[$plugin_zabbix::params::frontend_pkg],
|
||||
path => $plugin_zabbix::params::frontend_service_config,
|
||||
line => ' php_value date.timezone UTC',
|
||||
match => 'php_value date.timezone',
|
||||
notify => Service[$plugin_zabbix::params::frontend_service],
|
||||
require => Package[$plugin_zabbix::params::frontend_pkg],
|
||||
}
|
||||
|
||||
file_line { 'php memory_limit':
|
||||
path => $plugin_zabbix::params::frontend_service_config,
|
||||
line => ' php_value memory_limit 256M',
|
||||
match => 'php_value memory_limit',
|
||||
notify => Service[$plugin_zabbix::params::frontend_service],
|
||||
require => Package[$plugin_zabbix::params::frontend_pkg],
|
||||
path => $plugin_zabbix::params::frontend_service_config,
|
||||
line => ' php_value memory_limit 256M',
|
||||
match => 'php_value memory_limit',
|
||||
notify => Service[$plugin_zabbix::params::frontend_service],
|
||||
require => Package[$plugin_zabbix::params::frontend_pkg],
|
||||
}
|
||||
|
||||
file_line { 'set expose_php to off':
|
||||
path => $plugin_zabbix::params::php_config,
|
||||
match => 'expose_php =',
|
||||
line => 'expose_php = Off',
|
||||
notify => Service[$plugin_zabbix::params::frontend_service],
|
||||
require => Package[$plugin_zabbix::params::frontend_pkg],
|
||||
path => $plugin_zabbix::params::php_config,
|
||||
match => 'expose_php =',
|
||||
line => 'expose_php = Off',
|
||||
notify => Service[$plugin_zabbix::params::frontend_service],
|
||||
require => Package[$plugin_zabbix::params::frontend_pkg],
|
||||
}
|
||||
|
||||
# disable worker MPM, use prefork MPM which is required by mod_php:
|
||||
|
@ -119,10 +119,10 @@ class plugin_zabbix::frontend {
|
|||
before => Package[$plugin_zabbix::params::frontend_pkg],
|
||||
}
|
||||
file { '/etc/apache2/conf.d/zabbix.conf':
|
||||
ensure => link,
|
||||
target => $plugin_zabbix::params::frontend_service_config,
|
||||
notify => Service[$plugin_zabbix::params::frontend_service],
|
||||
require => Package[$plugin_zabbix::params::frontend_pkg],
|
||||
ensure => link,
|
||||
target => $plugin_zabbix::params::frontend_service_config,
|
||||
notify => Service[$plugin_zabbix::params::frontend_service],
|
||||
require => Package[$plugin_zabbix::params::frontend_pkg],
|
||||
}
|
||||
}
|
||||
default: {}
|
||||
|
|
|
@ -20,9 +20,9 @@ class plugin_zabbix::monitoring::ceilometer_mon {
|
|||
#Ceilometer
|
||||
if defined_in_state(Class['Openstack::Ceilometer']) and defined_in_state(Class['Openstack::Controller']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Ceilometer":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Ceilometer',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,14 +20,14 @@ class plugin_zabbix::monitoring::cinder_mon {
|
|||
#Cinder
|
||||
if defined_in_state(Class['cinder::api']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Cinder API":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Cinder API',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Cinder API check":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Cinder API check',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
plugin_zabbix::agent::userparameter {
|
||||
'cinder.api.status':
|
||||
|
@ -37,17 +37,17 @@ class plugin_zabbix::monitoring::cinder_mon {
|
|||
|
||||
if defined_in_state(Class['cinder::scheduler']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Cinder Scheduler":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Cinder Scheduler',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
|
||||
if defined_in_state(Class['cinder::volume']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Cinder Volume":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Cinder Volume',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,12 +20,12 @@ class plugin_zabbix::monitoring::firewall_mon {
|
|||
#Iptables stats
|
||||
if defined_in_state(Class['firewall']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App Iptables Stats":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App Iptables Stats',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App Iptables Stats',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
package { 'iptstate':
|
||||
ensure => present;
|
||||
ensure => present;
|
||||
}
|
||||
plugin_zabbix::agent::userparameter {
|
||||
'iptstate.tcp':
|
||||
|
|
|
@ -20,14 +20,14 @@ class plugin_zabbix::monitoring::glance_mon {
|
|||
#Glance
|
||||
if defined_in_state(Class['glance::api']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Glance API":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Glance API',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Glance API check":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Glance API check',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
plugin_zabbix::agent::userparameter {
|
||||
'glance.api.status':
|
||||
|
@ -37,9 +37,9 @@ class plugin_zabbix::monitoring::glance_mon {
|
|||
|
||||
if defined_in_state(Class['glance::registry']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Glance Registry":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Glance Registry',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,9 +19,9 @@ class plugin_zabbix::monitoring::haproxy_mon {
|
|||
|
||||
if defined_in_state(Class[Cluster::Haproxy]) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App HAProxy":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App HAProxy',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
plugin_zabbix::agent::userparameter {
|
||||
'haproxy.be.discovery':
|
||||
|
|
|
@ -20,14 +20,14 @@ class plugin_zabbix::monitoring::keystone_mon {
|
|||
#Keystone
|
||||
if defined_in_state(Class['keystone']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Keystone":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Keystone',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Keystone API check":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Keystone API check',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
plugin_zabbix::agent::userparameter {
|
||||
'keystone.api.status':
|
||||
|
|
|
@ -19,9 +19,9 @@ class plugin_zabbix::monitoring::memcached_mon {
|
|||
|
||||
if defined_in_state(Class['memcached']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App Memcache":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App Memcache',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
plugin_zabbix::agent::userparameter {
|
||||
'memcache':
|
||||
|
|
|
@ -20,9 +20,9 @@ class plugin_zabbix::monitoring::mysql_mon {
|
|||
if defined_in_state(Class['mysql::server']) {
|
||||
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App MySQL":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App MySQL',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
|
||||
plugin_zabbix::agent::userparameter {
|
||||
|
|
|
@ -21,15 +21,15 @@ class plugin_zabbix::monitoring::neutron_mon {
|
|||
if defined_in_state(Class['::neutron']) and !defined_in_state(Class['openstack::compute']) {
|
||||
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Neutron Server":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Neutron Server',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Neutron API check":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Neutron API check',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
|
||||
plugin_zabbix::agent::userparameter {
|
||||
|
@ -41,36 +41,36 @@ class plugin_zabbix::monitoring::neutron_mon {
|
|||
# Neutron OVS agent
|
||||
if defined_in_state(Class[Neutron::Agents::Ml2::Ovs]) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Neutron OVS Agent":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Neutron OVS Agent',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
|
||||
# Neutron Metadata agent
|
||||
if defined_in_state(Class['::neutron::agents::metadata']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Neutron Metadata Agent":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Neutron Metadata Agent',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
|
||||
# Neutron L3 agent
|
||||
if defined_in_state(Class['::neutron::agents::l3']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Neutron L3 Agent":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Neutron L3 Agent',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
|
||||
# Neutron DHCP agent
|
||||
if defined_in_state(Class['::neutron::agents::dhcp']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Neutron DHCP Agent":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Neutron DHCP Agent',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,38 +21,38 @@ class plugin_zabbix::monitoring::nova_mon {
|
|||
if defined_in_state(Class['openstack::controller']) {
|
||||
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Nova API":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova API',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova API',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Nova API OSAPI":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova API OSAPI',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova API OSAPI',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Nova API OSAPI check":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova API OSAPI check',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova API OSAPI check',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Nova API EC2":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova API EC2',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova API EC2',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Nova Cert":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova Cert',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova Cert',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
|
||||
plugin_zabbix::agent::userparameter {
|
||||
'nova.api.status':
|
||||
command => "/etc/zabbix/scripts/check_api.py nova_os http ${::internal_address} 8774";
|
||||
command => "/etc/zabbix/scripts/check_api.py nova_os http ${::internal_address} 8774";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,51 +75,51 @@ class plugin_zabbix::monitoring::nova_mon {
|
|||
|
||||
if defined_in_state(Class['nova::consoleauth']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Nova ConsoleAuth":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova ConsoleAuth',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova ConsoleAuth',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
|
||||
if defined_in_state(Class['nova::scheduler']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Nova Scheduler":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova Scheduler',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova Scheduler',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
|
||||
if defined_in_state(Class['nova::conductor']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Nova Conductor":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova Conductor',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova Conductor',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
|
||||
if defined_in_state(Class['nova::vncproxy']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Nova novncproxy":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova novncproxy',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova novncproxy',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
|
||||
#Nova compute
|
||||
if defined_in_state(Class['nova::compute']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Nova Compute":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova Compute',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Nova Compute',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
|
||||
#Libvirt
|
||||
if defined_in_state(Class['nova::compute::libvirt']) {
|
||||
plugin_zabbix_template_link { "${::fqdn} Template App OpenStack Libvirt":
|
||||
host => $::fqdn,
|
||||
template => 'Template App OpenStack Libvirt',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $::fqdn,
|
||||
template => 'Template App OpenStack Libvirt',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@ class plugin_zabbix::monitoring::openvswitch_mon {
|
|||
# Open vSwitch
|
||||
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Open vSwitch":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Open vSwitch',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,9 +22,9 @@ class plugin_zabbix::monitoring::rabbitmq_mon {
|
|||
if defined_in_state(Class['Rabbitmq']) {
|
||||
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack RabbitMQ":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack HA RabbitMQ',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack HA RabbitMQ',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
|
||||
exec { 'enable rabbitmq management plugin':
|
||||
|
@ -43,9 +43,9 @@ class plugin_zabbix::monitoring::rabbitmq_mon {
|
|||
}
|
||||
|
||||
firewall {'992 rabbitmq management':
|
||||
port => '15672',
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
port => '15672',
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
}
|
||||
|
||||
plugin_zabbix::agent::userparameter {
|
||||
|
|
|
@ -20,27 +20,27 @@ class plugin_zabbix::monitoring::swift_mon {
|
|||
#Swift
|
||||
if defined_in_state(Class['openstack::swift::storage_node']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Swift Account":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Swift Account',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Swift Container":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Swift Container',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Swift Object":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Swift Object',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
|
||||
if defined_in_state(Class['swift::proxy']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App OpenStack Swift Proxy":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App OpenStack Swift Proxy',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@ class plugin_zabbix::monitoring::zabbixserver_mon {
|
|||
|
||||
if defined_in_state(Class['plugin_zabbix::controller']) {
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::host_name} Template App Zabbix Server":
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
host => $plugin_zabbix::params::host_name,
|
||||
template => 'Template App Zabbix Server',
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
api => $plugin_zabbix::monitoring::api_hash,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,15 +35,17 @@ class plugin_zabbix::primary_controller {
|
|||
before => [ Class['plugin_zabbix::frontend'], Cs_resource["p_${plugin_zabbix::params::server_service}"] ],
|
||||
}
|
||||
|
||||
$operations = {
|
||||
'monitor' => {'interval' => '5s', 'timeout' => '30s' },
|
||||
'start' => {'interval' => '0', 'timeout' => '30s' }
|
||||
}
|
||||
|
||||
cs_resource { "p_${plugin_zabbix::params::server_service}":
|
||||
before => Cs_rsc_colocation['vip-with-zabbix'],
|
||||
primitive_class => 'ocf',
|
||||
provided_by => $plugin_zabbix::params::ocf_scripts_provider,
|
||||
primitive_type => $plugin_zabbix::params::server_service,
|
||||
operations => {
|
||||
'monitor' => { 'interval' => '5s', 'timeout' => '30s' },
|
||||
'start' => { 'interval' => '0', 'timeout' => '30s' }
|
||||
},
|
||||
operations => $operations,
|
||||
metadata => {
|
||||
'migration-threshold' => '3',
|
||||
'failure-timeout' => '120',
|
||||
|
|
|
@ -22,20 +22,20 @@ class plugin_zabbix::server::config {
|
|||
$api_hash = $plugin_zabbix::params::api_hash
|
||||
|
||||
plugin_zabbix_hostgroup { $plugin_zabbix::params::host_groups:
|
||||
ensure => present,
|
||||
api => $api_hash,
|
||||
ensure => present,
|
||||
api => $api_hash,
|
||||
}
|
||||
|
||||
file { '/etc/zabbix/import':
|
||||
ensure => directory,
|
||||
recurse => true,
|
||||
purge => true,
|
||||
force => true,
|
||||
source => 'puppet:///modules/plugin_zabbix/import'
|
||||
ensure => directory,
|
||||
recurse => true,
|
||||
purge => true,
|
||||
force => true,
|
||||
source => 'puppet:///modules/plugin_zabbix/import'
|
||||
}
|
||||
|
||||
Plugin_zabbix_configuration_import {
|
||||
require => File['/etc/zabbix/import'],
|
||||
require => File['/etc/zabbix/import'],
|
||||
}
|
||||
|
||||
plugin_zabbix_configuration_import { 'Template_App_Zabbix_Agent.xml Import':
|
||||
|
@ -230,11 +230,11 @@ class plugin_zabbix::server::config {
|
|||
}
|
||||
->
|
||||
plugin_zabbix_host { $plugin_zabbix::params::openstack::ceph_virtual_cluster_name:
|
||||
host => $plugin_zabbix::params::openstack::ceph_virtual_cluster_name,
|
||||
ip => $plugin_zabbix::params::server_ip,
|
||||
port => $plugin_zabbix::params::zabbix_ports['agent'],
|
||||
groups => concat($plugin_zabbix::params::host_groups_ceph_cluster, $plugin_zabbix::params::host_groups_base),
|
||||
api => $plugin_zabbix::params::api_hash,
|
||||
host => $plugin_zabbix::params::openstack::ceph_virtual_cluster_name,
|
||||
ip => $plugin_zabbix::params::server_ip,
|
||||
port => $plugin_zabbix::params::zabbix_ports['agent'],
|
||||
groups => concat($plugin_zabbix::params::host_groups_ceph_cluster, $plugin_zabbix::params::host_groups_base),
|
||||
api => $plugin_zabbix::params::api_hash,
|
||||
}
|
||||
->
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::openstack::ceph_virtual_cluster_name} Template Ceph Cluster":
|
||||
|
@ -359,11 +359,11 @@ class plugin_zabbix::server::config {
|
|||
}
|
||||
->
|
||||
plugin_zabbix_host { $plugin_zabbix::params::openstack::virtual_cluster_name:
|
||||
host => $plugin_zabbix::params::openstack::virtual_cluster_name,
|
||||
ip => $plugin_zabbix::params::server_ip,
|
||||
port => $plugin_zabbix::params::zabbix_ports['agent'],
|
||||
groups => $plugin_zabbix::params::host_groups_base,
|
||||
api => $plugin_zabbix::params::api_hash,
|
||||
host => $plugin_zabbix::params::openstack::virtual_cluster_name,
|
||||
ip => $plugin_zabbix::params::server_ip,
|
||||
port => $plugin_zabbix::params::zabbix_ports['agent'],
|
||||
groups => $plugin_zabbix::params::host_groups_base,
|
||||
api => $plugin_zabbix::params::api_hash,
|
||||
}
|
||||
->
|
||||
plugin_zabbix_template_link { "${plugin_zabbix::params::openstack::virtual_cluster_name} Template OpenStack Cluster":
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
[tox]
|
||||
envlist = manifests,plugin_zabbix
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
#deps = -r{toxinidir}/test-requirements.txt
|
||||
passenv = HOME
|
||||
|
||||
[testenv:manifests]
|
||||
changedir = {toxinidir}/deployment_scripts/puppet/manifests
|
||||
whitelist_externals =
|
||||
bundle
|
||||
mkdir
|
||||
commands =
|
||||
mkdir -p {toxinidir}/.bundled_gems
|
||||
bundle install --path {toxinidir}/.bundled_gems
|
||||
bundle exec rake test
|
||||
|
||||
[testenv:plugin_zabbix]
|
||||
changedir = {toxinidir}/deployment_scripts/puppet/modules/{envname}
|
||||
whitelist_externals =
|
||||
bundle
|
||||
mkdir
|
||||
commands =
|
||||
mkdir -p {toxinidir}/.bundled_gems
|
||||
bundle install --path {toxinidir}/.bundled_gems
|
||||
bundle exec rake test
|
Loading…
Reference in New Issue