diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0dfd567 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.build/ +*.noarch.rpm +repositories/centos/*.rpm +repositories/ubuntu/*.deb diff --git a/deployment_scripts/puppet/manifests/snmptt_config.pp b/deployment_scripts/puppet/manifests/snmptt_config.pp new file mode 100644 index 0000000..a04c720 --- /dev/null +++ b/deployment_scripts/puppet/manifests/snmptt_config.pp @@ -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 diff --git a/deployment_scripts/puppet/manifests/zabbix_config.pp b/deployment_scripts/puppet/manifests/zabbix_config.pp new file mode 100644 index 0000000..16a0add --- /dev/null +++ b/deployment_scripts/puppet/manifests/zabbix_config.pp @@ -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 diff --git a/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/files/Template_Extreme_Networks.xml b/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/files/Template_Extreme_Networks.xml new file mode 100644 index 0000000..5315f4c --- /dev/null +++ b/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/files/Template_Extreme_Networks.xml @@ -0,0 +1,345 @@ + + + 2.0 + 2014-12-09T17:13:43Z + + + Templates + + + + + + + + {Template Extreme Networks:snmptrap[".1.3.6.1.4.1.1916.0.10"].str("Critical")}=1 + Power Supply Failed: {ITEM.VALUE1} + + 0 + 4 + + 1 + + + + {Template Extreme Networks:snmptrap[".1.3.6.1.4.1.1916.0.11"].str("Information")}=1 + Power Supply OK: {ITEM.VALUE1} + + 0 + 1 + + 1 + + + + {Template Extreme Networks:snmptrap[".1.3.6.1.4.1.1916.0.7"].str("Critical")}=1 + Fan Failed: {ITEM.VALUE1} + + 0 + 4 + + 1 + + + + {Template Extreme Networks:snmptrap[".1.3.6.1.4.1.1916.0.8"].str("Information")}=1 + Fan OK: {ITEM.VALUE1} + + 0 + 1 + + 1 + + + + {Template Extreme Networks:snmptrap[".1.3.6.1.6.3.1.1.5.3"].str("Critical")}=1 + Link Down: {ITEM.VALUE1} + + 0 + 4 + + 1 + + + + {Template Extreme Networks:snmptrap[".1.3.6.1.6.3.1.1.5.4"].str("Information")}=1 + Link Up: {ITEM.LASTVALUE1} + + 0 + 1 + + 1 + + + + diff --git a/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/files/snmptt_extreme_networks.conf b/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/files/snmptt_extreme_networks.conf new file mode 100644 index 0000000..2be75ab --- /dev/null +++ b/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/files/snmptt_extreme_networks.conf @@ -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 diff --git a/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/manifests/extreme_host.pp b/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/manifests/extreme_host.pp new file mode 100644 index 0000000..3d8018d --- /dev/null +++ b/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/manifests/extreme_host.pp @@ -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]], + } + } + +} diff --git a/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/manifests/init.pp b/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/manifests/init.pp new file mode 100644 index 0000000..b7f51f7 --- /dev/null +++ b/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/manifests/init.pp @@ -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<||> + } + } + +} diff --git a/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/manifests/snmptt_config.pp b/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/manifests/snmptt_config.pp new file mode 100644 index 0000000..480bc49 --- /dev/null +++ b/deployment_scripts/puppet/modules/plugin_zabbix_monitoring_extreme_networks/manifests/snmptt_config.pp @@ -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 = < '/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, + } + +} diff --git a/environment_config.yaml b/environment_config.yaml new file mode 100644 index 0000000..3f3848f --- /dev/null +++ b/environment_config.yaml @@ -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" diff --git a/metadata.yaml b/metadata.yaml new file mode 100644 index 0000000..4273744 --- /dev/null +++ b/metadata.yaml @@ -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 ', 'Piotr Misiak ', 'Szymon Banka ', 'Alexander Zatserklyany '] + +# 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' diff --git a/repositories/centos/.gitkeep b/repositories/centos/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/repositories/ubuntu/.gitkeep b/repositories/ubuntu/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tasks.yaml b/tasks.yaml new file mode 100644 index 0000000..d8377ce --- /dev/null +++ b/tasks.yaml @@ -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