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:
Piotr Misiak 2015-08-12 11:40:02 +02:00
parent 942a67d040
commit 1e6fe34139
9 changed files with 36 additions and 70 deletions

View File

@ -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

View File

@ -42,12 +42,14 @@ IP_BINARY="/sbin/ip"
SNMPD_BINARY="/usr/sbin/snmpd"
SNMPD_PID="/run/snmpd.pid"
#run snmpd process in the following namespace:
SNMPDNS="haproxy"
SNMPDRUN="yes"
SNMPDOPTS="-Lsd -Lf /dev/null -p $SNMPD_PID"
TRAPD_BINARY="/usr/sbin/snmptrapd"
TRAPD_PID="/run/snmptrapd.pid"
#run snmptrapd process in the following namespace:
TRAPDNS="haproxy"
TRAPDRUN="no"
TRAPDOPTS="-Lsd -p $TRAPD_PID"

View File

@ -40,6 +40,7 @@
# source function library
. /etc/init.d/functions
#run service in the following network namespace:
NS="haproxy"
OPTIONS="-Lsd -p /var/run/snmptrapd.pid"
if [ -e /etc/sysconfig/snmptrapd ]; then

View File

@ -17,14 +17,17 @@ class plugin_zabbix_snmptrapd {
include plugin_zabbix_snmptrapd::params
$service_name = $plugin_zabbix_snmptrapd::params::service_name
$package_name = $plugin_zabbix_snmptrapd::params::package_name
$service_name = $plugin_zabbix_snmptrapd::params::service_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':
snmptrapdaddr => ["udp:${server_ip}:162"],
snmptrapdaddr => ["udp:${server_ip}:${server_port}"],
ro_community => $plugin_settings['community'],
service_ensure => 'stopped',
trap_service_ensure => 'running',
@ -32,16 +35,26 @@ class plugin_zabbix_snmptrapd {
trap_handlers => ['default /usr/sbin/snmptthandler'],
}
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],
firewall { '998 snmptrapd':
proto => 'udp',
action => 'accept',
port => $server_port,
}
# 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':
require => Class['snmp'],
}

View File

@ -29,7 +29,4 @@ class plugin_zabbix_snmptrapd::params {
}
}
$zabbix_cs_name = 'p_zabbix-server'
$vip_cs_name = 'vip__management'
}

View File

@ -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],
}
}

View File

@ -6,9 +6,9 @@ version: 1.0.0
# Description
description: Gives ability to receive SNMP traps and pass them to Zabbix.
# Required fuel version
fuel_version: ['6.1']
fuel_version: ['7.0']
# Groups
groups: []
groups: ['monitoring']
# Licenses
licenses: ['Apache License, Version 2.0']
# Homepage
@ -19,12 +19,12 @@ authors: ['Dmitry Klenov <dklenov@mirantis.com>', 'Piotr Misiak <pmisiak@miranti
# The plugin is compatible with releases in the list
releases:
- os: ubuntu
version: 2014.2-6.1
version: 2015.1.0-7.0
mode: ['ha']
deployment_scripts_path: deployment_scripts/
repository_path: repositories/ubuntu
- os: centos
version: 2014.2-6.1
version: 2015.1.0-7.0
mode: ['ha']
deployment_scripts_path: deployment_scripts/
repository_path: repositories/centos

View File

@ -25,9 +25,9 @@ function download {
done
}
download rpm http://mirror.centos.org/centos/6/updates/x86_64/Packages/net-snmp-5.5-50.el6_6.1.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/updates/x86_64/Packages/net-snmp-perl-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/os/x86_64/Packages/net-snmp-libs-5.5-54.el6.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-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 \

View File

@ -5,10 +5,3 @@
puppet_manifest: puppet/manifests/controller.pp
puppet_modules: puppet/modules:/etc/puppet/modules
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