@cryptotaxi247 / netdata-1 / commits / f10635a54

python.d remove hpssa (#17638)

Ilya Mashchenko committed May 14, 2024 at 10:59 UTC f10635a54bc0817f79114b2bc821f6928795e40f
6 files changed -850
CMakeLists.txt
-2
@@ -2738,7 +2738,6 @@ install(FILES
2738 src/collectors/python.d.plugin/gearman/gearman.conf
2739 src/collectors/python.d.plugin/go_expvar/go_expvar.conf
2740 src/collectors/python.d.plugin/haproxy/haproxy.conf
2741 - src/collectors/python.d.plugin/hpssa/hpssa.conf
2741 src/collectors/python.d.plugin/icecast/icecast.conf
2742 src/collectors/python.d.plugin/ipfs/ipfs.conf
2743 src/collectors/python.d.plugin/litespeed/litespeed.conf
@@ -2781,7 +2780,6 @@ install(FILES
2780 src/collectors/python.d.plugin/gearman/gearman.chart.py
2781 src/collectors/python.d.plugin/go_expvar/go_expvar.chart.py
2782 src/collectors/python.d.plugin/haproxy/haproxy.chart.py
2784 - src/collectors/python.d.plugin/hpssa/hpssa.chart.py
2783 src/collectors/python.d.plugin/icecast/icecast.chart.py
2784 src/collectors/python.d.plugin/ipfs/ipfs.chart.py
2785 src/collectors/python.d.plugin/litespeed/litespeed.chart.py
src/collectors/python.d.plugin/hpssa/README.md deleted
-1
@@ -1 +0,0 @@
1 -integrations/hp_smart_storage_arrays.md
\ No newline at end of file
src/collectors/python.d.plugin/hpssa/hpssa.chart.py deleted
-396
@@ -1,396 +0,0 @@
1 -# -*- coding: utf-8 -*-
2 -# Description: hpssa netdata python.d module
3 -# Author: Peter Gnodde (gnoddep)
4 -# SPDX-License-Identifier: GPL-3.0-or-later
5 -
6 -import os
7 -import re
8 -from copy import deepcopy
9 -
10 -from bases.FrameworkServices.ExecutableService import ExecutableService
11 -from bases.collection import find_binary
12 -
13 -disabled_by_default = True
14 -update_every = 5
15 -
16 -ORDER = [
17 - 'ctrl_status',
18 - 'ctrl_temperature',
19 - 'ld_status',
20 - 'pd_status',
21 - 'pd_temperature',
22 -]
23 -
24 -CHARTS = {
25 - 'ctrl_status': {
26 - 'options': [
27 - None,
28 - 'Status 1 is OK, Status 0 is not OK',
29 - 'Status',
30 - 'Controller',
31 - 'hpssa.ctrl_status',
32 - 'line'
33 - ],
34 - 'lines': []
35 - },
36 - 'ctrl_temperature': {
37 - 'options': [
38 - None,
39 - 'Temperature',
40 - 'Celsius',
41 - 'Controller',
42 - 'hpssa.ctrl_temperature',
43 - 'line'
44 - ],
45 - 'lines': []
46 - },
47 - 'ld_status': {
48 - 'options': [
49 - None,
50 - 'Status 1 is OK, Status 0 is not OK',
51 - 'Status',
52 - 'Logical drives',
53 - 'hpssa.ld_status',
54 - 'line'
55 - ],
56 - 'lines': []
57 - },
58 - 'pd_status': {
59 - 'options': [
60 - None,
61 - 'Status 1 is OK, Status 0 is not OK',
62 - 'Status',
63 - 'Physical drives',
64 - 'hpssa.pd_status',
65 - 'line'
66 - ],
67 - 'lines': []
68 - },
69 - 'pd_temperature': {
70 - 'options': [
71 - None,
72 - 'Temperature',
73 - 'Celsius',
74 - 'Physical drives',
75 - 'hpssa.pd_temperature',
76 - 'line'
77 - ],
78 - 'lines': []
79 - }
80 -}
81 -
82 -adapter_regex = re.compile(r'^(?P<adapter_type>.+) in Slot (?P<slot>\d+)')
83 -ignored_sections_regex = re.compile(
84 - r'''
85 - ^
86 - Physical[ ]Drives
87 - | None[ ]attached
88 - | (?:Expander|Enclosure|SEP|Port[ ]Name:)[ ].+
89 - | .+[ ]at[ ]Port[ ]\S+,[ ]Box[ ]\d+(\s\(Index[ ]\d+\))?,[ ].+
90 - | Mirror[ ]Group[ ]\d+:
91 - $
92 - ''',
93 - re.X
94 -)
95 -mirror_group_regex = re.compile(r'^Mirror Group \d+:$')
96 -disk_partition_regex = re.compile(r'^Disk Partition Information$')
97 -array_regex = re.compile(r'^Array: (?P<id>[A-Z]+)$')
98 -drive_regex = re.compile(
99 - r'''
100 - ^
101 - Logical[ ]Drive:[ ](?P<logical_drive_id>\d+)
102 - | physicaldrive[ ](?P<fqn>[^:]+:\d+:\d+)
103 - $
104 - ''',
105 - re.X
106 -)
107 -key_value_regex = re.compile(r'^(?P<key>[^:]+): ?(?P<value>.*)$')
108 -ld_status_regex = re.compile(r'^Status: (?P<status>[^,]+)(?:, (?P<percentage>[0-9.]+)% complete)?$')
109 -error_match = re.compile(r'Error:')
110 -
111 -
112 -class HPSSAException(Exception):
113 - pass
114 -
115 -
116 -class HPSSA(object):
117 - def __init__(self, lines):
118 - self.lines = [line.strip() for line in lines if line.strip()]
119 - self.current_line = 0
120 - self.adapters = []
121 - self.parse()
122 -
123 - def __iter__(self):
124 - return self
125 -
126 - def __next__(self):
127 - if self.current_line == len(self.lines):
128 - raise StopIteration
129 -
130 - line = self.lines[self.current_line]
131 - self.current_line += 1
132 -
133 - return line
134 -
135 - def next(self):
136 - """
137 - This is for Python 2.7 compatibility
138 - """
139 - return self.__next__()
140 -
141 - def rewind(self):
142 - self.current_line = max(self.current_line - 1, 0)
143 -
144 - @staticmethod
145 - def match_any(line, *regexes):
146 - return any([regex.match(line) for regex in regexes])
147 -
148 - def parse(self):
149 - for line in self:
150 - match = adapter_regex.match(line)
151 - if match:
152 - self.adapters.append(self.parse_adapter(**match.groupdict()))
153 -
154 - def parse_adapter(self, slot, adapter_type):
155 - adapter = {
156 - 'slot': int(slot),
157 - 'type': adapter_type,
158 -
159 - 'controller': {
160 - 'status': None,
161 - 'temperature': None,
162 - },
163 - 'cache': {
164 - 'present': False,
165 - 'status': None,
166 - 'temperature': None,
167 - },
168 - 'battery': {
169 - 'status': None,
170 - 'count': 0,
171 - },
172 -
173 - 'logical_drives': [],
174 - 'physical_drives': [],
175 - }
176 -
177 - for line in self:
178 - if error_match.match(line):
179 - raise HPSSAException('Error: {}'.format(line))
180 - elif adapter_regex.match(line):
181 - self.rewind()
182 - break
183 - elif array_regex.match(line):
184 - self.parse_array(adapter)
185 - elif line in ('Unassigned', 'unassigned') or line == 'HBA Drives':
186 - self.parse_physical_drives(adapter)
187 - elif ignored_sections_regex.match(line):
188 - self.parse_ignored_section()
189 - else:
190 - match = key_value_regex.match(line)
191 - if match:
192 - key, value = match.group('key', 'value')
193 - if key == 'Controller Status':
194 - adapter['controller']['status'] = value == 'OK'
195 - elif key == 'Controller Temperature (C)':
196 - adapter['controller']['temperature'] = int(value)
197 - elif key == 'Cache Board Present':
198 - adapter['cache']['present'] = value == 'True'
199 - elif key == 'Cache Status':
200 - adapter['cache']['status'] = value == 'OK'
201 - elif key == 'Cache Module Temperature (C)':
202 - adapter['cache']['temperature'] = int(value)
203 - elif key == 'Battery/Capacitor Count':
204 - adapter['battery']['count'] = int(value)
205 - elif key == 'Battery/Capacitor Status':
206 - adapter['battery']['status'] = value == 'OK'
207 - else:
208 - raise HPSSAException('Cannot parse line: {}'.format(line))
209 -
210 - return adapter
211 -
212 - def parse_array(self, adapter):
213 - for line in self:
214 - if HPSSA.match_any(line, adapter_regex, array_regex, ignored_sections_regex):
215 - self.rewind()
216 - break
217 -
218 - match = drive_regex.match(line)
219 - if match:
220 - data = match.groupdict()
221 - if data['logical_drive_id']:
222 - self.parse_logical_drive(adapter, int(data['logical_drive_id']))
223 - else:
224 - self.parse_physical_drive(adapter, data['fqn'])
225 - elif not key_value_regex.match(line):
226 - self.rewind()
227 - break
228 -
229 - def parse_physical_drives(self, adapter):
230 - for line in self:
231 - match = drive_regex.match(line)
232 - if match:
233 - self.parse_physical_drive(adapter, match.group('fqn'))
234 - else:
235 - self.rewind()
236 - break
237 -
238 - def parse_logical_drive(self, adapter, logical_drive_id):
239 - ld = {
240 - 'id': logical_drive_id,
241 - 'status': None,
242 - 'status_complete': None,
243 - }
244 -
245 - for line in self:
246 - if HPSSA.match_any(line, mirror_group_regex, disk_partition_regex):
247 - self.parse_ignored_section()
248 - continue
249 -
250 - match = ld_status_regex.match(line)
251 - if match:
252 - ld['status'] = match.group('status') == 'OK'
253 -
254 - if match.group('percentage'):
255 - ld['status_complete'] = float(match.group('percentage')) / 100
256 - elif HPSSA.match_any(line, adapter_regex, array_regex, drive_regex, ignored_sections_regex) \
257 - or not key_value_regex.match(line):
258 - self.rewind()
259 - break
260 -
261 - adapter['logical_drives'].append(ld)
262 -
263 - def parse_physical_drive(self, adapter, fqn):
264 - pd = {
265 - 'fqn': fqn,
266 - 'status': None,
267 - 'temperature': None,
268 - }
269 -
270 - for line in self:
271 - if HPSSA.match_any(line, adapter_regex, array_regex, drive_regex, ignored_sections_regex):
272 - self.rewind()
273 - break
274 -
275 - match = key_value_regex.match(line)
276 - if match:
277 - key, value = match.group('key', 'value')
278 - if key == 'Status':
279 - pd['status'] = value == 'OK'
280 - elif key == 'Current Temperature (C)':
281 - pd['temperature'] = int(value)
282 - else:
283 - self.rewind()
284 - break
285 -
286 - adapter['physical_drives'].append(pd)
287 -
288 - def parse_ignored_section(self):
289 - for line in self:
290 - if HPSSA.match_any(line, adapter_regex, array_regex, drive_regex, ignored_sections_regex) \
291 - or not key_value_regex.match(line):
292 - self.rewind()
293 - break
294 -
295 -
296 -class Service(ExecutableService):
297 - def __init__(self, configuration=None, name=None):
298 - super(Service, self).__init__(configuration=configuration, name=name)
299 - self.order = ORDER
300 - self.definitions = deepcopy(CHARTS)
301 - self.ssacli_path = self.configuration.get('ssacli_path', 'ssacli')
302 - self.use_sudo = self.configuration.get('use_sudo', True)
303 - self.cmd = []
304 -
305 - def get_adapters(self):
306 - try:
307 - adapters = HPSSA(self._get_raw_data(command=self.cmd)).adapters
308 - if not adapters:
309 - # If no adapters are returned, run the command again but capture stderr
310 - err = self._get_raw_data(command=self.cmd, stderr=True)
311 - if err:
312 - raise HPSSAException('Error executing cmd {}: {}'.format(' '.join(self.cmd), '\n'.join(err)))
313 - return adapters
314 - except HPSSAException as ex:
315 - self.error(ex)
316 - return []
317 -
318 - def check(self):
319 - if not os.path.isfile(self.ssacli_path):
320 - ssacli_path = find_binary(self.ssacli_path)
321 - if ssacli_path:
322 - self.ssacli_path = ssacli_path
323 - else:
324 - self.error('Cannot locate "{}" binary'.format(self.ssacli_path))
325 - return False
326 -
327 - if self.use_sudo:
328 - sudo = find_binary('sudo')
329 - if not sudo:
330 - self.error('Cannot locate "{}" binary'.format('sudo'))
331 - return False
332 -
333 - allowed = self._get_raw_data(command=[sudo, '-n', '-l', self.ssacli_path])
334 - if not allowed or allowed[0].strip() != os.path.realpath(self.ssacli_path):
335 - self.error('Not allowed to run sudo for command {}'.format(self.ssacli_path))
336 - return False
337 -
338 - self.cmd = [sudo, '-n']
339 -
340 - self.cmd.extend([self.ssacli_path, 'ctrl', 'all', 'show', 'config', 'detail'])
341 - self.info('Command: {}'.format(self.cmd))
342 -
343 - adapters = self.get_adapters()
344 -
345 - self.info('Discovered adapters: {}'.format([adapter['type'] for adapter in adapters]))
346 - if not adapters:
347 - self.error('No adapters discovered')
348 - return False
349 -
350 - return True
351 -
352 - def get_data(self):
353 - netdata = {}
354 -
355 - for adapter in self.get_adapters():
356 - status_key = '{}_status'.format(adapter['slot'])
357 - temperature_key = '{}_temperature'.format(adapter['slot'])
358 - ld_key = 'ld_{}_'.format(adapter['slot'])
359 -
360 - data = {
361 - 'ctrl_status': {
362 - 'ctrl_' + status_key: adapter['controller']['status'],
363 - 'cache_' + status_key: adapter['cache']['present'] and adapter['cache']['status'],
364 - 'battery_' + status_key:
365 - adapter['battery']['status'] if adapter['battery']['count'] > 0 else None
366 - },
367 -
368 - 'ctrl_temperature': {
369 - 'ctrl_' + temperature_key: adapter['controller']['temperature'],
370 - 'cache_' + temperature_key: adapter['cache']['temperature'],
371 - },
372 -
373 - 'ld_status': {
374 - ld_key + '{}_status'.format(ld['id']): ld['status'] for ld in adapter['logical_drives']
375 - },
376 -
377 - 'pd_status': {},
378 - 'pd_temperature': {},
379 - }
380 -
381 - for pd in adapter['physical_drives']:
382 - pd_key = 'pd_{}_{}'.format(adapter['slot'], pd['fqn'])
383 - data['pd_status'][pd_key + '_status'] = pd['status']
384 - data['pd_temperature'][pd_key + '_temperature'] = pd['temperature']
385 -
386 - for chart, dimension_data in data.items():
387 - for dimension_id, value in dimension_data.items():
388 - if value is None:
389 - continue
390 -
391 - if dimension_id not in self.charts[chart]:
392 - self.charts[chart].add_dimension([dimension_id])
393 -
394 - netdata[dimension_id] = value
395 -
396 - return netdata
src/collectors/python.d.plugin/hpssa/hpssa.conf deleted
-61
@@ -1,61 +0,0 @@
1 -# netdata python.d.plugin configuration for hpssa
2 -#
3 -# This file is in YaML format. Generally the format is:
4 -#
5 -# name: value
6 -#
7 -
8 -# ----------------------------------------------------------------------
9 -# Global Variables
10 -# These variables set the defaults for all JOBs, however each JOB
11 -# may define its own, overriding the defaults.
12 -
13 -# update_every sets the default data collection frequency.
14 -# If unset, the python.d.plugin default is used.
15 -# update_every: 5
16 -
17 -# priority controls the order of charts at the netdata dashboard.
18 -# Lower numbers move the charts towards the top of the page.
19 -# If unset, the default for python.d.plugin is used.
20 -# priority: 60000
21 -
22 -# penalty indicates whether to apply penalty to update_every in case of failures.
23 -# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
24 -# penalty: yes
25 -
26 -# autodetection_retry sets the job re-check interval in seconds.
27 -# The job is not deleted if check fails.
28 -# Attempts to start the job are made once every autodetection_retry.
29 -# This feature is disabled by default.
30 -# autodetection_retry: 0
31 -
32 -# ----------------------------------------------------------------------
33 -# JOBS (data collection sources)
34 -#
35 -# The default JOBS share the same *name*. JOBS with the same name
36 -# are mutually exclusive. Only one of them will be allowed running at
37 -# any time. This allows autodetection to try several alternatives and
38 -# pick the one that works.
39 -#
40 -# Any number of jobs is supported.
41 -#
42 -# All python.d.plugin JOBS (for all its modules) support a set of
43 -# predefined parameters. These are:
44 -#
45 -# job_name:
46 -# name: myname # the JOB's name as it will appear at the
47 -# # dashboard (by default is the job_name)
48 -# # JOBs sharing a name are mutually exclusive
49 -# update_every: 5 # the JOB's data collection frequency
50 -# priority: 60000 # the JOB's order on the dashboard
51 -# penalty: yes # the JOB's penalty
52 -# autodetection_retry: 0 # the JOB's re-check interval in seconds
53 -#
54 -# Additionally to the above, hpssa also supports the following:
55 -#
56 -# ssacli_path: /usr/sbin/ssacli # The path to the ssacli executable
57 -# use_sudo: True # Whether to use sudo or not
58 -# ----------------------------------------------------------------------
59 -
60 -# ssacli_path: /usr/sbin/ssacli
61 -# use_sudo: True
src/collectors/python.d.plugin/hpssa/integrations/hp_smart_storage_arrays.md deleted
-205
@@ -1,205 +0,0 @@
1 -<!--startmeta
2 -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/hpssa/README.md"
3 -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/hpssa/metadata.yaml"
4 -sidebar_label: "HP Smart Storage Arrays"
5 -learn_status: "Published"
6 -learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems"
7 -most_popular: False
8 -message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
9 -endmeta-->
10 -
11 -# HP Smart Storage Arrays
12 -
13 -
14 -<img src="https://netdata.cloud/img/hp.svg" width="150"/>
15 -
16 -
17 -Plugin: python.d.plugin
18 -Module: hpssa
19 -
20 -<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
21 -
22 -## Overview
23 -
24 -This collector monitors HP Smart Storage Arrays metrics about operational statuses and temperatures.
25 -
26 -It uses the command line tool `ssacli`. The exact command used is `sudo -n ssacli ctrl all show config detail`
27 -
28 -This collector is supported on all platforms.
29 -
30 -This collector only supports collecting metrics from a single instance of this integration.
31 -
32 -
33 -### Default Behavior
34 -
35 -#### Auto-Detection
36 -
37 -If no configuration is provided, the collector will try to execute the `ssacli` binary.
38 -
39 -#### Limits
40 -
41 -The default configuration for this integration does not impose any limits on data collection.
42 -
43 -#### Performance Impact
44 -
45 -The default configuration for this integration is not expected to impose a significant performance impact on the system.
46 -
47 -
48 -## Metrics
49 -
50 -Metrics grouped by *scope*.
51 -
52 -The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
53 -
54 -
55 -
56 -### Per HP Smart Storage Arrays instance
57 -
58 -These metrics refer to the entire monitored application.
59 -
60 -This scope has no labels.
61 -
62 -Metrics:
63 -
64 -| Metric | Dimensions | Unit |
65 -|:------|:----------|:----|
66 -| hpssa.ctrl_status | ctrl_{adapter slot}_status, cache_{adapter slot}_status, battery_{adapter slot}_status per adapter | Status |
67 -| hpssa.ctrl_temperature | ctrl_{adapter slot}_temperature, cache_{adapter slot}_temperature per adapter | Celsius |
68 -| hpssa.ld_status | a dimension per logical drive | Status |
69 -| hpssa.pd_status | a dimension per physical drive | Status |
70 -| hpssa.pd_temperature | a dimension per physical drive | Celsius |
71 -
72 -
73 -
74 -## Alerts
75 -
76 -There are no alerts configured by default for this integration.
77 -
78 -
79 -## Setup
80 -
81 -### Prerequisites
82 -
83 -#### Enable the hpssa collector
84 -
85 -The `hpssa` collector is disabled by default. To enable it, use `edit-config` from the Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration.md), which is typically at `/etc/netdata`, to edit the `python.d.conf` file.
86 -
87 -```bash
88 -cd /etc/netdata # Replace this path with your Netdata config directory, if different
89 -sudo ./edit-config python.d.conf
90 -```
91 -
92 -Change the value of the `hpssa` setting to `yes`. Save the file and restart the Netdata Agent with `sudo systemctl restart netdata`, or the [appropriate method](https://github.com/netdata/netdata/blob/master/packaging/installer/README.md#maintaining-a-netdata-agent-installation) for your system.
93 -
94 -
95 -#### Allow user netdata to execute `ssacli` as root.
96 -
97 -This module uses `ssacli`, which can only be executed by root. It uses `sudo` and assumes that it is configured such that the `netdata` user can execute `ssacli` as root without a password.
98 -
99 -- Add to your `/etc/sudoers` file:
100 -
101 -`which ssacli` shows the full path to the binary.
102 -
103 -```bash
104 -netdata ALL=(root) NOPASSWD: /path/to/ssacli
105 -```
106 -
107 -- Reset Netdata's systemd
108 - unit [CapabilityBoundingSet](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Capabilities) (Linux
109 - distributions with systemd)
110 -
111 -The default CapabilityBoundingSet doesn't allow using `sudo`, and is quite strict in general. Resetting is not optimal, but a next-best solution given the inability to execute `ssacli` using `sudo`.
112 -
113 -As the `root` user, do the following:
114 -
115 -```cmd
116 -mkdir /etc/systemd/system/netdata.service.d
117 -echo -e '[Service]\nCapabilityBoundingSet=~' | tee /etc/systemd/system/netdata.service.d/unset-capability-bounding-set.conf
118 -systemctl daemon-reload
119 -systemctl restart netdata.service
120 -```
121 -
122 -
123 -
124 -### Configuration
125 -
126 -#### File
127 -
128 -The configuration file name for this integration is `python.d/hpssa.conf`.
129 -
130 -
131 -You can edit the configuration file using the `edit-config` script from the
132 -Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration.md#the-netdata-config-directory).
133 -
134 -```bash
135 -cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
136 -sudo ./edit-config python.d/hpssa.conf
137 -```
138 -#### Options
139 -
140 -There are 2 sections:
141 -
142 -* Global variables
143 -* One or more JOBS that can define multiple different instances to monitor.
144 -
145 -The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values.
146 -
147 -Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
148 -
149 -Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
150 -
151 -
152 -<details><summary>Config options</summary>
153 -
154 -| Name | Description | Default | Required |
155 -|:----|:-----------|:-------|:--------:|
156 -| update_every | Sets the default data collection frequency. | 5 | no |
157 -| priority | Controls the order of charts at the netdata dashboard. | 60000 | no |
158 -| autodetection_retry | Sets the job re-check interval in seconds. | 0 | no |
159 -| penalty | Indicates whether to apply penalty to update_every in case of failures. | yes | no |
160 -| name | Job name. This value will overwrite the `job_name` value. JOBS with the same name are mutually exclusive. Only one of them will be allowed running at any time. This allows autodetection to try several alternatives and pick the one that works. | | no |
161 -| ssacli_path | Path to the `ssacli` command line utility. Configure this if `ssacli` is not in the $PATH | | no |
162 -| use_sudo | Whether or not to use `sudo` to execute `ssacli` | True | no |
163 -
164 -</details>
165 -
166 -#### Examples
167 -
168 -##### Local simple config
169 -
170 -A basic configuration, specyfing the path to `ssacli`
171 -
172 -```yaml
173 -local:
174 - ssacli_path: /usr/sbin/ssacli
175 -
176 -```
177 -
178 -
179 -## Troubleshooting
180 -
181 -### Debug Mode
182 -
183 -To troubleshoot issues with the `hpssa` collector, run the `python.d.plugin` with the debug option enabled. The output
184 -should give you clues as to why the collector isn't working.
185 -
186 -- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
187 - your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
188 -
189 - ```bash
190 - cd /usr/libexec/netdata/plugins.d/
191 - ```
192 -
193 -- Switch to the `netdata` user.
194 -
195 - ```bash
196 - sudo -u netdata -s
197 - ```
198 -
199 -- Run the `python.d.plugin` to debug the collector:
200 -
201 - ```bash
202 - ./python.d.plugin hpssa debug trace
203 - ```
204 -
205 -
src/collectors/python.d.plugin/hpssa/metadata.yaml deleted
-185
@@ -1,185 +0,0 @@
1 -plugin_name: python.d.plugin
2 -modules:
3 - - meta:
4 - plugin_name: python.d.plugin
5 - module_name: hpssa
6 - monitored_instance:
7 - name: HP Smart Storage Arrays
8 - link: 'https://buy.hpe.com/us/en/software/server-management-software/server-management-software/smart-array-management-software/hpe-smart-storage-administrator/p/5409020'
9 - categories:
10 - - data-collection.storage-mount-points-and-filesystems
11 - icon_filename: 'hp.svg'
12 - related_resources:
13 - integrations:
14 - list: []
15 - info_provided_to_referring_integrations:
16 - description: ''
17 - keywords:
18 - - storage
19 - - hp
20 - - hpssa
21 - - array
22 - most_popular: false
23 - overview:
24 - data_collection:
25 - metrics_description: 'This collector monitors HP Smart Storage Arrays metrics about operational statuses and temperatures.'
26 - method_description: 'It uses the command line tool `ssacli`. The exact command used is `sudo -n ssacli ctrl all show config detail`'
27 - supported_platforms:
28 - include: []
29 - exclude: []
30 - multi_instance: false
31 - additional_permissions:
32 - description: ''
33 - default_behavior:
34 - auto_detection:
35 - description: 'If no configuration is provided, the collector will try to execute the `ssacli` binary.'
36 - limits:
37 - description: ''
38 - performance_impact:
39 - description: ''
40 - setup:
41 - prerequisites:
42 - list:
43 - - title: 'Enable the hpssa collector'
44 - description: |
45 - The `hpssa` collector is disabled by default. To enable it, use `edit-config` from the Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration.md), which is typically at `/etc/netdata`, to edit the `python.d.conf` file.
46 -
47 - ```bash
48 - cd /etc/netdata # Replace this path with your Netdata config directory, if different
49 - sudo ./edit-config python.d.conf
50 - ```
51 -
52 - Change the value of the `hpssa` setting to `yes`. Save the file and restart the Netdata Agent with `sudo systemctl restart netdata`, or the [appropriate method](https://github.com/netdata/netdata/blob/master/packaging/installer/README.md#maintaining-a-netdata-agent-installation) for your system.
53 - - title: 'Allow user netdata to execute `ssacli` as root.'
54 - description: |
55 - This module uses `ssacli`, which can only be executed by root. It uses `sudo` and assumes that it is configured such that the `netdata` user can execute `ssacli` as root without a password.
56 -
57 - - Add to your `/etc/sudoers` file:
58 -
59 - `which ssacli` shows the full path to the binary.
60 -
61 - ```bash
62 - netdata ALL=(root) NOPASSWD: /path/to/ssacli
63 - ```
64 -
65 - - Reset Netdata's systemd
66 - unit [CapabilityBoundingSet](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Capabilities) (Linux
67 - distributions with systemd)
68 -
69 - The default CapabilityBoundingSet doesn't allow using `sudo`, and is quite strict in general. Resetting is not optimal, but a next-best solution given the inability to execute `ssacli` using `sudo`.
70 -
71 - As the `root` user, do the following:
72 -
73 - ```cmd
74 - mkdir /etc/systemd/system/netdata.service.d
75 - echo -e '[Service]\nCapabilityBoundingSet=~' | tee /etc/systemd/system/netdata.service.d/unset-capability-bounding-set.conf
76 - systemctl daemon-reload
77 - systemctl restart netdata.service
78 - ```
79 - configuration:
80 - file:
81 - name: python.d/hpssa.conf
82 - options:
83 - description: |
84 - There are 2 sections:
85 -
86 - * Global variables
87 - * One or more JOBS that can define multiple different instances to monitor.
88 -
89 - The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values.
90 -
91 - Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
92 -
93 - Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
94 - folding:
95 - title: "Config options"
96 - enabled: true
97 - list:
98 - - name: update_every
99 - description: Sets the default data collection frequency.
100 - default_value: 5
101 - required: false
102 - - name: priority
103 - description: Controls the order of charts at the netdata dashboard.
104 - default_value: 60000
105 - required: false
106 - - name: autodetection_retry
107 - description: Sets the job re-check interval in seconds.
108 - default_value: 0
109 - required: false
110 - - name: penalty
111 - description: Indicates whether to apply penalty to update_every in case of failures.
112 - default_value: yes
113 - required: false
114 - - name: name
115 - description: Job name. This value will overwrite the `job_name` value. JOBS with the same name are mutually exclusive. Only one of them will be allowed running at any time. This allows autodetection to try several alternatives and pick the one that works.
116 - default_value: ''
117 - required: false
118 - - name: ssacli_path
119 - description: Path to the `ssacli` command line utility. Configure this if `ssacli` is not in the $PATH
120 - default_value: ''
121 - required: false
122 - - name: use_sudo
123 - description: Whether or not to use `sudo` to execute `ssacli`
124 - default_value: 'True'
125 - required: false
126 - examples:
127 - folding:
128 - enabled: false
129 - title: "Config"
130 - list:
131 - - name: Local simple config
132 - description: A basic configuration, specyfing the path to `ssacli`
133 - folding:
134 - enabled: false
135 - config: |
136 - local:
137 - ssacli_path: /usr/sbin/ssacli
138 - troubleshooting:
139 - problems:
140 - list: []
141 - alerts: []
142 - metrics:
143 - folding:
144 - title: Metrics
145 - enabled: false
146 - description: ""
147 - availability: []
148 - scopes:
149 - - name: global
150 - description: "These metrics refer to the entire monitored application."
151 - labels: []
152 - metrics:
153 - - name: hpssa.ctrl_status
154 - description: Status 1 is OK, Status 0 is not OK
155 - unit: "Status"
156 - chart_type: line
157 - dimensions:
158 - - name: ctrl_{adapter slot}_status
159 - - name: cache_{adapter slot}_status
160 - - name: battery_{adapter slot}_status per adapter
161 - - name: hpssa.ctrl_temperature
162 - description: Temperature
163 - unit: "Celsius"
164 - chart_type: line
165 - dimensions:
166 - - name: ctrl_{adapter slot}_temperature
167 - - name: cache_{adapter slot}_temperature per adapter
168 - - name: hpssa.ld_status
169 - description: Status 1 is OK, Status 0 is not OK
170 - unit: "Status"
171 - chart_type: line
172 - dimensions:
173 - - name: a dimension per logical drive
174 - - name: hpssa.pd_status
175 - description: Status 1 is OK, Status 0 is not OK
176 - unit: "Status"
177 - chart_type: line
178 - dimensions:
179 - - name: a dimension per physical drive
180 - - name: hpssa.pd_temperature
181 - description: Temperature
182 - unit: "Celsius"
183 - chart_type: line
184 - dimensions:
185 - - name: a dimension per physical drive