bind to VIP reserved for Zabbix instead of management VIP
do not overwrite initscripts with the network namespace support version change compatible MOS version Change-Id: I991d21b07d416720cf2225871e297fd039fa0950
This commit is contained in:
parent
942a67d040
commit
1e6fe34139
|
@ -1,16 +0,0 @@
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
include plugin_zabbix_snmptrapd::primary_controller
|
|
|
@ -42,12 +42,14 @@ IP_BINARY="/sbin/ip"
|
||||||
|
|
||||||
SNMPD_BINARY="/usr/sbin/snmpd"
|
SNMPD_BINARY="/usr/sbin/snmpd"
|
||||||
SNMPD_PID="/run/snmpd.pid"
|
SNMPD_PID="/run/snmpd.pid"
|
||||||
|
#run snmpd process in the following namespace:
|
||||||
SNMPDNS="haproxy"
|
SNMPDNS="haproxy"
|
||||||
SNMPDRUN="yes"
|
SNMPDRUN="yes"
|
||||||
SNMPDOPTS="-Lsd -Lf /dev/null -p $SNMPD_PID"
|
SNMPDOPTS="-Lsd -Lf /dev/null -p $SNMPD_PID"
|
||||||
|
|
||||||
TRAPD_BINARY="/usr/sbin/snmptrapd"
|
TRAPD_BINARY="/usr/sbin/snmptrapd"
|
||||||
TRAPD_PID="/run/snmptrapd.pid"
|
TRAPD_PID="/run/snmptrapd.pid"
|
||||||
|
#run snmptrapd process in the following namespace:
|
||||||
TRAPDNS="haproxy"
|
TRAPDNS="haproxy"
|
||||||
TRAPDRUN="no"
|
TRAPDRUN="no"
|
||||||
TRAPDOPTS="-Lsd -p $TRAPD_PID"
|
TRAPDOPTS="-Lsd -p $TRAPD_PID"
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
# source function library
|
# source function library
|
||||||
. /etc/init.d/functions
|
. /etc/init.d/functions
|
||||||
|
|
||||||
|
#run service in the following network namespace:
|
||||||
NS="haproxy"
|
NS="haproxy"
|
||||||
OPTIONS="-Lsd -p /var/run/snmptrapd.pid"
|
OPTIONS="-Lsd -p /var/run/snmptrapd.pid"
|
||||||
if [ -e /etc/sysconfig/snmptrapd ]; then
|
if [ -e /etc/sysconfig/snmptrapd ]; then
|
||||||
|
|
|
@ -20,11 +20,14 @@ class plugin_zabbix_snmptrapd {
|
||||||
$service_name = $plugin_zabbix_snmptrapd::params::service_name
|
$service_name = $plugin_zabbix_snmptrapd::params::service_name
|
||||||
$package_name = $plugin_zabbix_snmptrapd::params::package_name
|
$package_name = $plugin_zabbix_snmptrapd::params::package_name
|
||||||
|
|
||||||
$server_ip = hiera('management_vip')
|
|
||||||
$plugin_settings = hiera('zabbix_snmptrapd')
|
$plugin_settings = hiera('zabbix_snmptrapd')
|
||||||
|
|
||||||
|
$network_metadata = hiera('network_metadata')
|
||||||
|
$server_ip = $network_metadata['vips']['zabbix_vip_management']['ipaddr']
|
||||||
|
$server_port = '162'
|
||||||
|
|
||||||
class { 'snmp':
|
class { 'snmp':
|
||||||
snmptrapdaddr => ["udp:${server_ip}:162"],
|
snmptrapdaddr => ["udp:${server_ip}:${server_port}"],
|
||||||
ro_community => $plugin_settings['community'],
|
ro_community => $plugin_settings['community'],
|
||||||
service_ensure => 'stopped',
|
service_ensure => 'stopped',
|
||||||
trap_service_ensure => 'running',
|
trap_service_ensure => 'running',
|
||||||
|
@ -32,16 +35,26 @@ class plugin_zabbix_snmptrapd {
|
||||||
trap_handlers => ['default /usr/sbin/snmptthandler'],
|
trap_handlers => ['default /usr/sbin/snmptthandler'],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "/etc/init.d/${service_name}":
|
firewall { '998 snmptrapd':
|
||||||
ensure => present,
|
proto => 'udp',
|
||||||
owner => 'root',
|
action => 'accept',
|
||||||
group => 'root',
|
port => $server_port,
|
||||||
mode => '0755',
|
|
||||||
source => "puppet:///modules/plugin_zabbix_snmptrapd/initscripts/${service_name}",
|
|
||||||
require => Package[$package_name],
|
|
||||||
notify => Service[$service_name],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# The following resource overwrites default initscript for snmptrapd.
|
||||||
|
# Version provided by the plugin supports namespaces.
|
||||||
|
# If there is a need to run snmptrad in a specific namespace,
|
||||||
|
# uncomment the following resource and put the correct namespace in the file.
|
||||||
|
#file { "/etc/init.d/${service_name}":
|
||||||
|
# ensure => present,
|
||||||
|
# owner => 'root',
|
||||||
|
# group => 'root',
|
||||||
|
# mode => '0755',
|
||||||
|
# source => "puppet:///modules/plugin_zabbix_snmptrapd/initscripts/${service_name}",
|
||||||
|
# require => Package[$package_name],
|
||||||
|
# notify => Service[$service_name],
|
||||||
|
#}
|
||||||
|
|
||||||
class { 'plugin_zabbix_snmptrapd::snmptt':
|
class { 'plugin_zabbix_snmptrapd::snmptt':
|
||||||
require => Class['snmp'],
|
require => Class['snmp'],
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,4 @@ class plugin_zabbix_snmptrapd::params {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$zabbix_cs_name = 'p_zabbix-server'
|
|
||||||
$vip_cs_name = 'vip__management'
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
class plugin_zabbix_snmptrapd::primary_controller {
|
|
||||||
|
|
||||||
include plugin_zabbix_snmptrapd::params
|
|
||||||
|
|
||||||
cs_group { 'g_zabbix':
|
|
||||||
primitives => [$plugin_zabbix_snmptrapd::params::vip_cs_name, $plugin_zabbix_snmptrapd::params::zabbix_cs_name],
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -6,9 +6,9 @@ version: 1.0.0
|
||||||
# Description
|
# Description
|
||||||
description: Gives ability to receive SNMP traps and pass them to Zabbix.
|
description: Gives ability to receive SNMP traps and pass them to Zabbix.
|
||||||
# Required fuel version
|
# Required fuel version
|
||||||
fuel_version: ['6.1']
|
fuel_version: ['7.0']
|
||||||
# Groups
|
# Groups
|
||||||
groups: []
|
groups: ['monitoring']
|
||||||
# Licenses
|
# Licenses
|
||||||
licenses: ['Apache License, Version 2.0']
|
licenses: ['Apache License, Version 2.0']
|
||||||
# Homepage
|
# Homepage
|
||||||
|
@ -19,12 +19,12 @@ authors: ['Dmitry Klenov <dklenov@mirantis.com>', 'Piotr Misiak <pmisiak@miranti
|
||||||
# The plugin is compatible with releases in the list
|
# The plugin is compatible with releases in the list
|
||||||
releases:
|
releases:
|
||||||
- os: ubuntu
|
- os: ubuntu
|
||||||
version: 2014.2-6.1
|
version: 2015.1.0-7.0
|
||||||
mode: ['ha']
|
mode: ['ha']
|
||||||
deployment_scripts_path: deployment_scripts/
|
deployment_scripts_path: deployment_scripts/
|
||||||
repository_path: repositories/ubuntu
|
repository_path: repositories/ubuntu
|
||||||
- os: centos
|
- os: centos
|
||||||
version: 2014.2-6.1
|
version: 2015.1.0-7.0
|
||||||
mode: ['ha']
|
mode: ['ha']
|
||||||
deployment_scripts_path: deployment_scripts/
|
deployment_scripts_path: deployment_scripts/
|
||||||
repository_path: repositories/centos
|
repository_path: repositories/centos
|
||||||
|
|
|
@ -25,9 +25,9 @@ function download {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
download rpm http://mirror.centos.org/centos/6/updates/x86_64/Packages/net-snmp-5.5-50.el6_6.1.x86_64.rpm \
|
download rpm http://mirror.centos.org/centos/6/os/x86_64/Packages/net-snmp-5.5-54.el6.x86_64.rpm \
|
||||||
http://mirror.centos.org/centos/6/updates/x86_64/Packages/net-snmp-libs-5.5-50.el6_6.1.x86_64.rpm \
|
http://mirror.centos.org/centos/6/os/x86_64/Packages/net-snmp-libs-5.5-54.el6.x86_64.rpm \
|
||||||
http://mirror.centos.org/centos/6/updates/x86_64/Packages/net-snmp-perl-5.5-50.el6_6.1.x86_64.rpm \
|
http://mirror.centos.org/centos/6/os/x86_64/Packages/net-snmp-perl-5.5-54.el6.x86_64.rpm \
|
||||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/perl-Digest-HMAC-1.01-22.el6.noarch.rpm \
|
http://mirror.centos.org/centos/6/os/x86_64/Packages/perl-Digest-HMAC-1.01-22.el6.noarch.rpm \
|
||||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/perl-Digest-SHA1-2.12-2.el6.x86_64.rpm \
|
http://mirror.centos.org/centos/6/os/x86_64/Packages/perl-Digest-SHA1-2.12-2.el6.x86_64.rpm \
|
||||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/perl-IO-stringy-2.110-10.1.el6.noarch.rpm \
|
http://mirror.centos.org/centos/6/os/x86_64/Packages/perl-IO-stringy-2.110-10.1.el6.noarch.rpm \
|
||||||
|
|
|
@ -5,10 +5,3 @@
|
||||||
puppet_manifest: puppet/manifests/controller.pp
|
puppet_manifest: puppet/manifests/controller.pp
|
||||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||||
timeout: 1200
|
timeout: 1200
|
||||||
- role: ['primary-controller']
|
|
||||||
stage: post_deployment/8115
|
|
||||||
type: puppet
|
|
||||||
parameters:
|
|
||||||
puppet_manifest: puppet/manifests/primary_controller.pp
|
|
||||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
|
||||||
timeout: 1200
|
|
||||||
|
|
Loading…
Reference in New Issue