Merge "initial version of EMC hardware monitoring extension for Zabbix plugin"

This commit is contained in:
Jenkins 2015-06-19 12:40:23 +00:00 committed by Gerrit Code Review
commit dea6b0e1f0
13 changed files with 2021 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
.build/
*.noarch.rpm
repositories/centos/*.rpm
repositories/ubuntu/*.deb
deployment_scripts/puppet/modules/snmp

View File

@ -0,0 +1,16 @@
#
# 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_monitoring_emc::snmptt_config

View File

@ -0,0 +1,16 @@
#
# 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_monitoring_emc

View File

@ -0,0 +1,242 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2014-07-25T09:26:35Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
<template>
<template>Template EMC VNX</template>
<name>Template EMC VNX</name>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<applications>
<application>
<name>EMC VNX</name>
</application>
</applications>
<items>
<item>
<name>SNMPtrap Critical</name>
<type>17</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>snmptrap[&quot;.1.3.6.1.4.1.1981.0.6&quot;]</key>
<delay>0</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>2</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>EMC VNX</name>
</application>
</applications>
<valuemap/>
</item>
<item>
<name>SNMPtrap Error</name>
<type>17</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>snmptrap[&quot;.1.3.6.1.4.1.1981.0.5&quot;]</key>
<delay>0</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>2</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>EMC VNX</name>
</application>
</applications>
<valuemap/>
</item>
<item>
<name>SNMPtrap Information</name>
<type>17</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>snmptrap[&quot;.1.3.6.1.4.1.1981.0.3&quot;]</key>
<delay>0</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>2</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>EMC VNX</name>
</application>
</applications>
<valuemap/>
</item>
<item>
<name>SNMPtrap Warning</name>
<type>17</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>snmptrap[&quot;.1.3.6.1.4.1.1981.0.4&quot;]</key>
<delay>0</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>2</value_type>
<allowed_hosts/>
<units/>
<delta>0</delta>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>EMC VNX</name>
</application>
</applications>
<valuemap/>
</item>
</items>
<discovery_rules/>
<macros/>
<templates/>
<screens/>
</template>
</templates>
<triggers>
<trigger>
<expression>{Template EMC VNX:snmptrap[&quot;.1.3.6.1.4.1.1981.0.6&quot;].str(&quot;Critical&quot;)}=1</expression>
<name>SNMPtrigger Critical: {ITEM.VALUE1}</name>
<url/>
<status>0</status>
<priority>4</priority>
<description/>
<type>1</type>
<dependencies/>
</trigger>
<trigger>
<expression>{Template EMC VNX:snmptrap[&quot;.1.3.6.1.4.1.1981.0.5&quot;].str(&quot;Error&quot;)}=1</expression>
<name>SNMPtrigger Error: {ITEM.VALUE1}</name>
<url/>
<status>0</status>
<priority>3</priority>
<description/>
<type>1</type>
<dependencies/>
</trigger>
<trigger>
<expression>{Template EMC VNX:snmptrap[&quot;.1.3.6.1.4.1.1981.0.3&quot;].str(&quot;Information&quot;)}=1</expression>
<name>SNMPtrigger Information: {ITEM.VALUE1}</name>
<url/>
<status>0</status>
<priority>1</priority>
<description/>
<type>1</type>
<dependencies/>
</trigger>
<trigger>
<expression>{Template EMC VNX:snmptrap[&quot;.1.3.6.1.4.1.1981.0.4&quot;].str(&quot;Warning&quot;)}=1</expression>
<name>SNMPtrigger Warning: {ITEM.VALUE1}</name>
<url/>
<status>0</status>
<priority>2</priority>
<description/>
<type>1</type>
<dependencies/>
</trigger>
</triggers>
</zabbix_export>

View File

@ -0,0 +1,39 @@
#
# 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.
#
define plugin_zabbix_monitoring_emc::emc_host(
$host_group = 'EMC',
) {
$host = split($name,':')
if size($host) == 2 {
plugin_zabbix_host { $host[0]:
host => $host[0],
type => 2,
ip => $host[1],
port => '161',
api => $plugin_zabbix::params::api_hash,
groups => $host_group,
}
plugin_zabbix_template_link { "${host[0]} Template EMC VNX":
host => $host[0],
template => 'Template EMC VNX',
api => $plugin_zabbix::params::api_hash,
require => Plugin_zabbix_host[$host[0]],
}
}
}

View File

@ -0,0 +1,55 @@
#
# 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_monitoring_emc(
$host_group = 'EMC',
)
{
include plugin_zabbix::params
file { '/etc/zabbix/import/Template_EMC_VNX.xml':
ensure => present,
source => 'puppet:///modules/plugin_zabbix_monitoring_emc/Template_EMC_VNX.xml',
}
plugin_zabbix_configuration_import { 'Template_EMC_VNX.xml Import':
ensure => present,
xml_file => '/etc/zabbix/import/Template_EMC_VNX.xml',
api => $plugin_zabbix::params::api_hash,
require => File['/etc/zabbix/import/Template_EMC_VNX.xml'],
}
plugin_zabbix_hostgroup {$host_group:
ensure => present,
api => $plugin_zabbix::params::api_hash,
}
$zabbix_monitoring_emc_hash = hiera('zabbix_monitoring_emc')
$hosts_string = $zabbix_monitoring_emc_hash['hosts']
if $hosts_string {
$hosts = split($hosts_string,',')
if size($hosts) > 0 {
plugin_zabbix_monitoring_emc::emc_host { $hosts:
host_group => $host_group,
}
Plugin_zabbix_configuration_import<||> -> Plugin_zabbix_monitoring_emc::Emc_host<||>
Plugin_zabbix_hostgroup<||> -> Plugin_zabbix_monitoring_emc::Emc_host<||>
}
}
}

View File

@ -0,0 +1,47 @@
#
# 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_monitoring_emc::snmptt_config {
file { '/etc/snmp/snmptt.conf.d':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
file { '/etc/snmp/snmptt.conf.d/emc.conf':
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/plugin_zabbix_monitoring_emc/snmptt_emc.conf',
require => File['/etc/snmp/snmptt.conf.d'],
}
file_line { 'add emc.conf config to snmptt.ini':
path => '/etc/snmp/snmptt.ini',
after => 'snmptt_conf_files = <<END',
line => '/etc/snmp/snmptt.conf.d/emc.conf',
require => File['/etc/snmp/snmptt.conf.d/emc.conf'],
notify => Service['snmptt'],
}
service { 'snmptt':
ensure => running,
enable => true,
}
}

12
environment_config.yaml Normal file
View File

@ -0,0 +1,12 @@
attributes:
metadata:
restrictions:
- condition: "settings:zabbix_snmptrapd.metadata.enabled == false"
action: disable
message: This plugin requires SNMP trap daemon for Zabbix plugin
hosts:
value: ""
label: "EMC hardware to monitor"
description: "comma separated NAME:IP values"
weight: 10
type: "text"

33
metadata.yaml Normal file
View File

@ -0,0 +1,33 @@
# Plugin name
name: zabbix_monitoring_emc
title: EMC hardware monitoring extension for Zabbix plugin
# Plugin version
version: 1.0.0
# Description
description: Adds EMC hardware monitoring to Zabbix plugin
# Required fuel version
fuel_version: ['6.1']
# Groups
groups: ['monitoring']
# Licenses
licenses: ['Apache License, Version 2.0']
# Homepage
homepage: 'https://github.com/stackforge/fuel-plugin-zabbix-emc'
# Authors
authors: ['Dmitry Klenov <dklenov@mirantis.com>', 'Piotr Misiak <pmisiak@mirantis.com>', 'Szymon Banka <sbanka@mirantis.com>', 'Alexander Zatserklyany <azatserklyany@mirantis.com>']
# The plugin is compatible with releases in the list
releases:
- os: ubuntu
version: 2014.2-6.1
mode: ['ha']
deployment_scripts_path: deployment_scripts/
repository_path: repositories/ubuntu
- os: centos
version: 2014.2-6.1
mode: ['ha']
deployment_scripts_path: deployment_scripts/
repository_path: repositories/centos
# Version of plugin package
package_version: '2.0.0'

View File

View File

14
tasks.yaml Normal file
View File

@ -0,0 +1,14 @@
- role: ['primary-controller']
stage: post_deployment/8120
type: puppet
parameters:
puppet_manifest: puppet/manifests/zabbix_config.pp
puppet_modules: puppet/modules:/etc/puppet/modules:../zabbix_monitoring-1.0/puppet/modules
timeout: 300
- role: ['primary-controller', 'controller']
stage: post_deployment/8121
type: puppet
parameters:
puppet_manifest: puppet/manifests/snmptt_config.pp
puppet_modules: puppet/modules:/etc/puppet/modules:../zabbix_monitoring-1.0/puppet/modules
timeout: 300