Browse Source

initial version of EMC hardware monitoring extension for Zabbix plugin

Change-Id: Ic63b89f99e26e445ae232134ff255e11171ba232
Piotr Misiak 3 years ago
parent
commit
c54ec723e7

+ 5
- 0
.gitignore View File

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

+ 16
- 0
deployment_scripts/puppet/manifests/snmptt_config.pp View File

@@ -0,0 +1,16 @@
1
+#
2
+#    Copyright 2015 Mirantis, Inc.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+#
16
+include plugin_zabbix_monitoring_emc::snmptt_config

+ 16
- 0
deployment_scripts/puppet/manifests/zabbix_config.pp View File

@@ -0,0 +1,16 @@
1
+#
2
+#    Copyright 2015 Mirantis, Inc.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+#
16
+include plugin_zabbix_monitoring_emc

+ 242
- 0
deployment_scripts/puppet/modules/plugin_zabbix_monitoring_emc/files/Template_EMC_VNX.xml View File

@@ -0,0 +1,242 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<zabbix_export>
3
+    <version>2.0</version>
4
+    <date>2014-07-25T09:26:35Z</date>
5
+    <groups>
6
+        <group>
7
+            <name>Templates</name>
8
+        </group>
9
+    </groups>
10
+    <templates>
11
+        <template>
12
+            <template>Template EMC VNX</template>
13
+            <name>Template EMC VNX</name>
14
+            <groups>
15
+                <group>
16
+                    <name>Templates</name>
17
+                </group>
18
+            </groups>
19
+            <applications>
20
+                <application>
21
+                    <name>EMC VNX</name>
22
+                </application>
23
+            </applications>
24
+            <items>
25
+                <item>
26
+                    <name>SNMPtrap Critical</name>
27
+                    <type>17</type>
28
+                    <snmp_community/>
29
+                    <multiplier>0</multiplier>
30
+                    <snmp_oid/>
31
+                    <key>snmptrap[&quot;.1.3.6.1.4.1.1981.0.6&quot;]</key>
32
+                    <delay>0</delay>
33
+                    <history>90</history>
34
+                    <trends>365</trends>
35
+                    <status>0</status>
36
+                    <value_type>2</value_type>
37
+                    <allowed_hosts/>
38
+                    <units/>
39
+                    <delta>0</delta>
40
+                    <snmpv3_contextname/>
41
+                    <snmpv3_securityname/>
42
+                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
43
+                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
44
+                    <snmpv3_authpassphrase/>
45
+                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
46
+                    <snmpv3_privpassphrase/>
47
+                    <formula>1</formula>
48
+                    <delay_flex/>
49
+                    <params/>
50
+                    <ipmi_sensor/>
51
+                    <data_type>0</data_type>
52
+                    <authtype>0</authtype>
53
+                    <username/>
54
+                    <password/>
55
+                    <publickey/>
56
+                    <privatekey/>
57
+                    <port/>
58
+                    <description/>
59
+                    <inventory_link>0</inventory_link>
60
+                    <applications>
61
+                        <application>
62
+                            <name>EMC VNX</name>
63
+                        </application>
64
+                    </applications>
65
+                    <valuemap/>
66
+                </item>
67
+                <item>
68
+                    <name>SNMPtrap Error</name>
69
+                    <type>17</type>
70
+                    <snmp_community/>
71
+                    <multiplier>0</multiplier>
72
+                    <snmp_oid/>
73
+                    <key>snmptrap[&quot;.1.3.6.1.4.1.1981.0.5&quot;]</key>
74
+                    <delay>0</delay>
75
+                    <history>90</history>
76
+                    <trends>365</trends>
77
+                    <status>0</status>
78
+                    <value_type>2</value_type>
79
+                    <allowed_hosts/>
80
+                    <units/>
81
+                    <delta>0</delta>
82
+                    <snmpv3_contextname/>
83
+                    <snmpv3_securityname/>
84
+                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
85
+                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
86
+                    <snmpv3_authpassphrase/>
87
+                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
88
+                    <snmpv3_privpassphrase/>
89
+                    <formula>1</formula>
90
+                    <delay_flex/>
91
+                    <params/>
92
+                    <ipmi_sensor/>
93
+                    <data_type>0</data_type>
94
+                    <authtype>0</authtype>
95
+                    <username/>
96
+                    <password/>
97
+                    <publickey/>
98
+                    <privatekey/>
99
+                    <port/>
100
+                    <description/>
101
+                    <inventory_link>0</inventory_link>
102
+                    <applications>
103
+                        <application>
104
+                            <name>EMC VNX</name>
105
+                        </application>
106
+                    </applications>
107
+                    <valuemap/>
108
+                </item>
109
+                <item>
110
+                    <name>SNMPtrap Information</name>
111
+                    <type>17</type>
112
+                    <snmp_community/>
113
+                    <multiplier>0</multiplier>
114
+                    <snmp_oid/>
115
+                    <key>snmptrap[&quot;.1.3.6.1.4.1.1981.0.3&quot;]</key>
116
+                    <delay>0</delay>
117
+                    <history>90</history>
118
+                    <trends>365</trends>
119
+                    <status>0</status>
120
+                    <value_type>2</value_type>
121
+                    <allowed_hosts/>
122
+                    <units/>
123
+                    <delta>0</delta>
124
+                    <snmpv3_contextname/>
125
+                    <snmpv3_securityname/>
126
+                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
127
+                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
128
+                    <snmpv3_authpassphrase/>
129
+                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
130
+                    <snmpv3_privpassphrase/>
131
+                    <formula>1</formula>
132
+                    <delay_flex/>
133
+                    <params/>
134
+                    <ipmi_sensor/>
135
+                    <data_type>0</data_type>
136
+                    <authtype>0</authtype>
137
+                    <username/>
138
+                    <password/>
139
+                    <publickey/>
140
+                    <privatekey/>
141
+                    <port/>
142
+                    <description/>
143
+                    <inventory_link>0</inventory_link>
144
+                    <applications>
145
+                        <application>
146
+                            <name>EMC VNX</name>
147
+                        </application>
148
+                    </applications>
149
+                    <valuemap/>
150
+                </item>
151
+                <item>
152
+                    <name>SNMPtrap Warning</name>
153
+                    <type>17</type>
154
+                    <snmp_community/>
155
+                    <multiplier>0</multiplier>
156
+                    <snmp_oid/>
157
+                    <key>snmptrap[&quot;.1.3.6.1.4.1.1981.0.4&quot;]</key>
158
+                    <delay>0</delay>
159
+                    <history>90</history>
160
+                    <trends>365</trends>
161
+                    <status>0</status>
162
+                    <value_type>2</value_type>
163
+                    <allowed_hosts/>
164
+                    <units/>
165
+                    <delta>0</delta>
166
+                    <snmpv3_contextname/>
167
+                    <snmpv3_securityname/>
168
+                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
169
+                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
170
+                    <snmpv3_authpassphrase/>
171
+                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
172
+                    <snmpv3_privpassphrase/>
173
+                    <formula>1</formula>
174
+                    <delay_flex/>
175
+                    <params/>
176
+                    <ipmi_sensor/>
177
+                    <data_type>0</data_type>
178
+                    <authtype>0</authtype>
179
+                    <username/>
180
+                    <password/>
181
+                    <publickey/>
182
+                    <privatekey/>
183
+                    <port/>
184
+                    <description/>
185
+                    <inventory_link>0</inventory_link>
186
+                    <applications>
187
+                        <application>
188
+                            <name>EMC VNX</name>
189
+                        </application>
190
+                    </applications>
191
+                    <valuemap/>
192
+                </item>
193
+            </items>
194
+            <discovery_rules/>
195
+            <macros/>
196
+            <templates/>
197
+            <screens/>
198
+        </template>
199
+    </templates>
200
+    <triggers>
201
+        <trigger>
202
+            <expression>{Template EMC VNX:snmptrap[&quot;.1.3.6.1.4.1.1981.0.6&quot;].str(&quot;Critical&quot;)}=1</expression>
203
+            <name>SNMPtrigger Critical: {ITEM.VALUE1}</name>
204
+            <url/>
205
+            <status>0</status>
206
+            <priority>4</priority>
207
+            <description/>
208
+            <type>1</type>
209
+            <dependencies/>
210
+        </trigger>
211
+        <trigger>
212
+            <expression>{Template EMC VNX:snmptrap[&quot;.1.3.6.1.4.1.1981.0.5&quot;].str(&quot;Error&quot;)}=1</expression>
213
+            <name>SNMPtrigger Error: {ITEM.VALUE1}</name>
214
+            <url/>
215
+            <status>0</status>
216
+            <priority>3</priority>
217
+            <description/>
218
+            <type>1</type>
219
+            <dependencies/>
220
+        </trigger>
221
+        <trigger>
222
+            <expression>{Template EMC VNX:snmptrap[&quot;.1.3.6.1.4.1.1981.0.3&quot;].str(&quot;Information&quot;)}=1</expression>
223
+            <name>SNMPtrigger Information: {ITEM.VALUE1}</name>
224
+            <url/>
225
+            <status>0</status>
226
+            <priority>1</priority>
227
+            <description/>
228
+            <type>1</type>
229
+            <dependencies/>
230
+        </trigger>
231
+        <trigger>
232
+            <expression>{Template EMC VNX:snmptrap[&quot;.1.3.6.1.4.1.1981.0.4&quot;].str(&quot;Warning&quot;)}=1</expression>
233
+            <name>SNMPtrigger Warning: {ITEM.VALUE1}</name>
234
+            <url/>
235
+            <status>0</status>
236
+            <priority>2</priority>
237
+            <description/>
238
+            <type>1</type>
239
+            <dependencies/>
240
+        </trigger>
241
+    </triggers>
242
+</zabbix_export>

+ 1542
- 0
deployment_scripts/puppet/modules/plugin_zabbix_monitoring_emc/files/snmptt_emc.conf
File diff suppressed because it is too large
View File


+ 39
- 0
deployment_scripts/puppet/modules/plugin_zabbix_monitoring_emc/manifests/emc_host.pp View File

@@ -0,0 +1,39 @@
1
+#
2
+#    Copyright 2015 Mirantis, Inc.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+#
16
+define plugin_zabbix_monitoring_emc::emc_host(
17
+  $host_group = 'EMC',
18
+) {
19
+
20
+  $host = split($name,':')
21
+
22
+  if size($host) == 2 {
23
+    plugin_zabbix_host { $host[0]:
24
+      host     => $host[0],
25
+      type     => 2,
26
+      ip       => $host[1],
27
+      port     => '161',
28
+      api      => $plugin_zabbix::params::api_hash,
29
+      groups   => $host_group,
30
+    }
31
+    plugin_zabbix_template_link { "${host[0]} Template EMC VNX":
32
+      host     => $host[0],
33
+      template => 'Template EMC VNX',
34
+      api      => $plugin_zabbix::params::api_hash,
35
+      require  => Plugin_zabbix_host[$host[0]],
36
+    }
37
+  }
38
+
39
+}

+ 55
- 0
deployment_scripts/puppet/modules/plugin_zabbix_monitoring_emc/manifests/init.pp View File

@@ -0,0 +1,55 @@
1
+#
2
+#    Copyright 2015 Mirantis, Inc.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+#
16
+class plugin_zabbix_monitoring_emc(
17
+  $host_group = 'EMC',
18
+)
19
+{
20
+
21
+  include plugin_zabbix::params
22
+
23
+  file { '/etc/zabbix/import/Template_EMC_VNX.xml':
24
+    ensure     => present,
25
+    source     => 'puppet:///modules/plugin_zabbix_monitoring_emc/Template_EMC_VNX.xml',
26
+  }
27
+
28
+  plugin_zabbix_configuration_import { 'Template_EMC_VNX.xml Import':
29
+    ensure     => present,
30
+    xml_file   => '/etc/zabbix/import/Template_EMC_VNX.xml',
31
+    api        => $plugin_zabbix::params::api_hash,
32
+    require    => File['/etc/zabbix/import/Template_EMC_VNX.xml'],
33
+  }
34
+
35
+  plugin_zabbix_hostgroup {$host_group:
36
+    ensure     => present,
37
+    api        => $plugin_zabbix::params::api_hash,
38
+  }
39
+
40
+  $zabbix_monitoring_emc_hash = hiera('zabbix_monitoring_emc')
41
+  $hosts_string = $zabbix_monitoring_emc_hash['hosts']
42
+
43
+  if $hosts_string {
44
+    $hosts = split($hosts_string,',')
45
+
46
+    if size($hosts) > 0 {
47
+      plugin_zabbix_monitoring_emc::emc_host { $hosts:
48
+        host_group => $host_group,
49
+      }
50
+      Plugin_zabbix_configuration_import<||> -> Plugin_zabbix_monitoring_emc::Emc_host<||>
51
+      Plugin_zabbix_hostgroup<||> -> Plugin_zabbix_monitoring_emc::Emc_host<||>
52
+    }
53
+  }
54
+
55
+}

+ 47
- 0
deployment_scripts/puppet/modules/plugin_zabbix_monitoring_emc/manifests/snmptt_config.pp View File

@@ -0,0 +1,47 @@
1
+#
2
+#    Copyright 2015 Mirantis, Inc.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+#
16
+class plugin_zabbix_monitoring_emc::snmptt_config {
17
+
18
+  file { '/etc/snmp/snmptt.conf.d':
19
+    ensure     => directory,
20
+    owner      => 'root',
21
+    group      => 'root',
22
+    mode       => '0755',
23
+  }
24
+
25
+  file { '/etc/snmp/snmptt.conf.d/emc.conf':
26
+    ensure     => present,
27
+    owner      => 'root',
28
+    group      => 'root',
29
+    mode       => '0644',
30
+    source     => 'puppet:///modules/plugin_zabbix_monitoring_emc/snmptt_emc.conf',
31
+    require    => File['/etc/snmp/snmptt.conf.d'],
32
+  }
33
+
34
+  file_line { 'add emc.conf config to snmptt.ini':
35
+    path       => '/etc/snmp/snmptt.ini',
36
+    after      => 'snmptt_conf_files = <<END',
37
+    line       => '/etc/snmp/snmptt.conf.d/emc.conf',
38
+    require    => File['/etc/snmp/snmptt.conf.d/emc.conf'],
39
+    notify     => Service['snmptt'],
40
+  }
41
+
42
+  service { 'snmptt':
43
+    ensure     => running,
44
+    enable     => true,
45
+  }
46
+
47
+}

+ 12
- 0
environment_config.yaml View File

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

+ 33
- 0
metadata.yaml View File

@@ -0,0 +1,33 @@
1
+# Plugin name
2
+name: zabbix_monitoring_emc
3
+title: EMC hardware monitoring extension for Zabbix plugin
4
+# Plugin version
5
+version: 1.0.0
6
+# Description
7
+description: Adds EMC hardware monitoring to Zabbix plugin
8
+# Required fuel version
9
+fuel_version: ['6.1']
10
+# Groups
11
+groups: ['monitoring']
12
+# Licenses
13
+licenses: ['Apache License, Version 2.0']
14
+# Homepage
15
+homepage: 'https://github.com/stackforge/fuel-plugin-zabbix-emc'
16
+# Authors
17
+authors: ['Dmitry Klenov <dklenov@mirantis.com>', 'Piotr Misiak <pmisiak@mirantis.com>', 'Szymon Banka <sbanka@mirantis.com>', 'Alexander Zatserklyany <azatserklyany@mirantis.com>']
18
+
19
+# The plugin is compatible with releases in the list
20
+releases:
21
+  - os: ubuntu
22
+    version: 2014.2-6.1
23
+    mode: ['ha']
24
+    deployment_scripts_path: deployment_scripts/
25
+    repository_path: repositories/ubuntu
26
+  - os: centos
27
+    version: 2014.2-6.1
28
+    mode: ['ha']
29
+    deployment_scripts_path: deployment_scripts/
30
+    repository_path: repositories/centos
31
+
32
+# Version of plugin package
33
+package_version: '2.0.0'

+ 0
- 0
repositories/centos/.gitkeep View File


+ 0
- 0
repositories/ubuntu/.gitkeep View File


+ 14
- 0
tasks.yaml View File

@@ -0,0 +1,14 @@
1
+- role: ['primary-controller']
2
+  stage: post_deployment/8120
3
+  type: puppet
4
+  parameters:
5
+    puppet_manifest: puppet/manifests/zabbix_config.pp
6
+    puppet_modules: puppet/modules:/etc/puppet/modules:../zabbix_monitoring-1.0/puppet/modules
7
+    timeout: 300
8
+- role: ['primary-controller', 'controller']
9
+  stage: post_deployment/8121
10
+  type: puppet
11
+  parameters:
12
+    puppet_manifest: puppet/manifests/snmptt_config.pp
13
+    puppet_modules: puppet/modules:/etc/puppet/modules:../zabbix_monitoring-1.0/puppet/modules
14
+    timeout: 300

Loading…
Cancel
Save