summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/adaptec_raid
diff options
context:
space:
mode:
authorIlya Mashchenko <ilyamaschenko@gmail.com>2018-10-26 08:57:34 +0900
committerCosta Tsaousis <costa@tsaousis.gr>2018-10-26 02:57:34 +0300
commitc6cce6bd2accec27a61243e1ffa38826ac2a4892 (patch)
tree734d28a099ae2c12f4858a8d425cdf549581db0e /collectors/python.d.plugin/adaptec_raid
parent6cf0d0c0169be2588ad2e199d911d7b10df58cb2 (diff)
Disable python sudo modules by default (#4477)
* adaptec_raid: check if `arcconf` is available first * adaptec_raid: disable by default and update docs * megacli: disable by default and update docs * samba: disable by default and update docs * samba megacli adaptec readme fix * adaptec readme fix
Diffstat (limited to 'collectors/python.d.plugin/adaptec_raid')
-rw-r--r--collectors/python.d.plugin/adaptec_raid/README.md23
-rw-r--r--collectors/python.d.plugin/adaptec_raid/adaptec_raid.chart.py12
-rw-r--r--collectors/python.d.plugin/adaptec_raid/adaptec_raid.conf4
3 files changed, 28 insertions, 11 deletions
diff --git a/collectors/python.d.plugin/adaptec_raid/README.md b/collectors/python.d.plugin/adaptec_raid/README.md
index 44b327c8f8..499dc9190e 100644
--- a/collectors/python.d.plugin/adaptec_raid/README.md
+++ b/collectors/python.d.plugin/adaptec_raid/README.md
@@ -3,7 +3,9 @@
Module collects logical and physical devices health metrics.
**Requirements:**
- * `netdata` user needs to be able to sudo the `arcconf` program without password
+* `arcconf` program
+* `sudo` program
+* `netdata` user needs to be able to sudo the `arcconf` program without password
To grab stats it executes:
* `sudo -n arcconf GETCONFIG 1 LD`
@@ -20,7 +22,24 @@ It produces:
4. **Physical Device Temperature**
-Screenshot:
+### prerequisite
+This module uses `arcconf` which can only be executed by root. It uses
+`sudo` and assumes that it is configured such that the `netdata` user can
+execute `arcconf` as root without password.
+
+Add to `sudoers`:
+
+ netdata ALL=(root) NOPASSWD: /path/to/arcconf
+
+### configuration
+
+ **adaptec_raid** is disabled by default. Should be explicitly enabled in `python.d.conf`.
+
+```yaml
+adaptec_raid: yes
+```
+
+#### Screenshot:
![image](https://user-images.githubusercontent.com/22274335/47278133-6d306680-d601-11e8-87c2-cc9c0f42d686.png)
diff --git a/collectors/python.d.plugin/adaptec_raid/adaptec_raid.chart.py b/collectors/python.d.plugin/adaptec_raid/adaptec_raid.chart.py
index e4af5afff4..1fb1e4336c 100644
--- a/collectors/python.d.plugin/adaptec_raid/adaptec_raid.chart.py
+++ b/collectors/python.d.plugin/adaptec_raid/adaptec_raid.chart.py
@@ -12,6 +12,8 @@ from bases.FrameworkServices.ExecutableService import ExecutableService
from bases.collection import find_binary
+disabled_by_default = True
+
update_every = 5
ORDER = [
@@ -158,6 +160,11 @@ class Service(ExecutableService):
return self._get_raw_data(command=command, stderr=stderr)
def check(self):
+ arcconf = find_binary(ARCCONF)
+ if not arcconf:
+ self.error('can\'t locate "{0}" binary'.format(ARCCONF))
+ return False
+
sudo = find_binary(SUDO)
if self.use_sudo:
if not sudo:
@@ -168,11 +175,6 @@ class Service(ExecutableService):
self.error(' '.join(err))
return False
- arcconf = find_binary(ARCCONF)
- if not arcconf:
- self.error('can\'t locate "{0}" binary'.format(ARCCONF))
- return False
-
if self.use_sudo:
self.arcconf = SudoArcconf(arcconf, sudo)
else:
diff --git a/collectors/python.d.plugin/adaptec_raid/adaptec_raid.conf b/collectors/python.d.plugin/adaptec_raid/adaptec_raid.conf
index 9a3796db39..253cbf5a9c 100644
--- a/collectors/python.d.plugin/adaptec_raid/adaptec_raid.conf
+++ b/collectors/python.d.plugin/adaptec_raid/adaptec_raid.conf
@@ -53,7 +53,3 @@
# retries: 60 # the JOB's number of restoration attempts
# autodetection_retry: 0 # the JOB's re-check interval in seconds
# ----------------------------------------------------------------------
-
-# IMPORTANT
-# The netdata user needs to be able to sudo the arcconf program without password:
-# netdata ALL=(root) NOPASSWD: /path/to/arcconf