initial version of Extreme Networks hardware monitoring extension for Zabbix plugin

Change-Id: I8749b64edf49098280aadcd8e6d6386c1119c85c
This commit is contained in:
Piotr Misiak 2015-06-05 13:42:24 +02:00
parent 3e38dd33c3
commit 767cad8dc6
13 changed files with 601 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.build/
*.noarch.rpm
repositories/centos/*.rpm
repositories/ubuntu/*.deb

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_extreme_networks::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_extreme_networks

View File

@ -0,0 +1,345 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2014-12-09T17:13:43Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
<template>
<template>Template Extreme Networks</template>
<name>Template Extreme Networks</name>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<applications>
<application>
<name>Extreme Networks</name>
</application>
</applications>
<items>
<item>
<name>Power Supply Failed</name>
<type>17</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>snmptrap[&quot;.1.3.6.1.4.1.1916.0.10&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>Extreme Networks</name>
</application>
</applications>
<valuemap/>
</item>
<item>
<name>Power Supply OK</name>
<type>17</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>snmptrap[&quot;.1.3.6.1.4.1.1916.0.11&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>Extreme Networks</name>
</application>
</applications>
<valuemap/>
</item>
<item>
<name>Fan Failed</name>
<type>17</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>snmptrap[&quot;.1.3.6.1.4.1.1916.0.7&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>Extreme Networks</name>
</application>
</applications>
<valuemap/>
</item>
<item>
<name>Fan OK</name>
<type>17</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>snmptrap[&quot;.1.3.6.1.4.1.1916.0.8&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>Extreme Networks</name>
</application>
</applications>
<valuemap/>
</item>
<item>
<name>Link Down</name>
<type>17</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>snmptrap[&quot;.1.3.6.1.6.3.1.1.5.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>Extreme Networks</name>
</application>
</applications>
<valuemap/>
</item>
<item>
<name>Link Up</name>
<type>17</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>snmptrap[&quot;.1.3.6.1.6.3.1.1.5.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>Extreme Networks</name>
</application>
</applications>
<valuemap/>
</item>
</items>
<macros/>
<templates/>
<screens/>
</template>
</templates>
<triggers>
<trigger>
<expression>{Template Extreme Networks:snmptrap[&quot;.1.3.6.1.4.1.1916.0.10&quot;].str(&quot;Critical&quot;)}=1</expression>
<name>Power Supply Failed: {ITEM.VALUE1}</name>
<url/>
<status>0</status>
<priority>4</priority>
<description/>
<type>1</type>
<dependencies/>
</trigger>
<trigger>
<expression>{Template Extreme Networks:snmptrap[&quot;.1.3.6.1.4.1.1916.0.11&quot;].str(&quot;Information&quot;)}=1</expression>
<name>Power Supply OK: {ITEM.VALUE1}</name>
<url/>
<status>0</status>
<priority>1</priority>
<description/>
<type>1</type>
<dependencies/>
</trigger>
<trigger>
<expression>{Template Extreme Networks:snmptrap[&quot;.1.3.6.1.4.1.1916.0.7&quot;].str(&quot;Critical&quot;)}=1</expression>
<name>Fan Failed: {ITEM.VALUE1}</name>
<url/>
<status>0</status>
<priority>4</priority>
<description/>
<type>1</type>
<dependencies/>
</trigger>
<trigger>
<expression>{Template Extreme Networks:snmptrap[&quot;.1.3.6.1.4.1.1916.0.8&quot;].str(&quot;Information&quot;)}=1</expression>
<name>Fan OK: {ITEM.VALUE1}</name>
<url/>
<status>0</status>
<priority>1</priority>
<description/>
<type>1</type>
<dependencies/>
</trigger>
<trigger>
<expression>{Template Extreme Networks:snmptrap[&quot;.1.3.6.1.6.3.1.1.5.3&quot;].str(&quot;Critical&quot;)}=1</expression>
<name>Link Down: {ITEM.VALUE1}</name>
<url/>
<status>0</status>
<priority>4</priority>
<description/>
<type>1</type>
<dependencies/>
</trigger>
<trigger>
<expression>{Template Extreme Networks:snmptrap[&quot;.1.3.6.1.6.3.1.1.5.4&quot;].str(&quot;Information&quot;)}=1</expression>
<name>Link Up: {ITEM.LASTVALUE1}</name>
<url/>
<status>0</status>
<priority>1</priority>
<description/>
<type>1</type>
<dependencies/>
</trigger>
</triggers>
</zabbix_export>

View File

@ -0,0 +1,20 @@
# Extreme Ports
EVENT ExtremePortDown .1.3.6.1.6.3.1.1.5.3 "Status Events" Critical
FORMAT ZBXTRAP $aA LinkDown Port $1
EVENT ExtremePortUp .1.3.6.1.6.3.1.1.5.4 "Status Events" Information
FORMAT ZBXTRAP $aA LinkUp Port $1
# Extreme Fans
EVENT ExtremeFanFailed .1.3.6.1.4.1.1916.0.7 "Status Events" Critical
FORMAT ZBXTRAP $aA FanFailed Fan $3
EVENT ExtremeFanOK .1.3.6.1.4.1.1916.0.8 "Status Events" Information
FORMAT ZBXTRAP $aA FanOK Fan $3
# Extreme Power Supply
EVENT ExtremePSFailed .1.3.6.1.4.1.1916.0.10 "Status Events" Critical
FORMAT ZBXTRAP $aA PowerFailed PS $3
EVENT ExtremePSOK .1.3.6.1.4.1.1916.0.11 "Status Events" Information
FORMAT ZBXTRAP $aA PowerOK PS $3

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_extreme_networks::extreme_host(
$host_group = 'Extreme Networks',
) {
$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 Extreme Networks":
host => $host[0],
template => 'Template Extreme Networks',
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_extreme_networks(
$host_group = 'Extreme Networks',
)
{
include plugin_zabbix::params
file { '/etc/zabbix/import/Template_Extreme_Networks.xml':
ensure => present,
source => 'puppet:///modules/plugin_zabbix_monitoring_extreme_networks/Template_Extreme_Networks.xml',
}
plugin_zabbix_configuration_import { 'Template_Extreme_Networks.xml Import':
ensure => present,
xml_file => '/etc/zabbix/import/Template_Extreme_Networks.xml',
api => $plugin_zabbix::params::api_hash,
require => File['/etc/zabbix/import/Template_Extreme_Networks.xml'],
}
plugin_zabbix_hostgroup {$host_group:
ensure => present,
api => $plugin_zabbix::params::api_hash,
}
$zabbix_monitoring_extreme_hash = hiera('zabbix_monitoring_extreme_networks')
$hosts_string = $zabbix_monitoring_extreme_hash['hosts']
if $hosts_string {
$hosts = split($hosts_string,',')
if size($hosts) > 0 {
plugin_zabbix_monitoring_extreme_networks::extreme_host { $hosts:
host_group => $host_group,
}
Plugin_zabbix_configuration_import<||> -> Plugin_zabbix_monitoring_extreme_networks::Extreme_host<||>
Plugin_zabbix_hostgroup<||> -> Plugin_zabbix_monitoring_extreme_networks::Extreme_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_extreme_networks::snmptt_config {
file { '/etc/snmp/snmptt.conf.d':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
file { '/etc/snmp/snmptt.conf.d/extreme_networks.conf':
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/plugin_zabbix_monitoring_extreme_networks/snmptt_extreme_networks.conf',
require => File['/etc/snmp/snmptt.conf.d'],
}
file_line { 'add extreme_networks.conf config to snmptt.ini':
path => '/etc/snmp/snmptt.ini',
after => 'snmptt_conf_files = <<END',
line => '/etc/snmp/snmptt.conf.d/extreme_networks.conf',
require => File['/etc/snmp/snmptt.conf.d/extreme_networks.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: "Extreme Networks 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_extreme_networks
title: Extreme Networks hardware monitoring extension for Zabbix plugin
# Plugin version
version: 1.0.0
# Description
description: Adds Extreme Networks 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-monitoring-extreme-networks'
# 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