@cryptotaxi247 / netdata-1 / commits / 5e97c2cd4

add resetting CapabilityBoundingSet workaround to the python.d collectors (that use `sudo`) readmes (#10587)

Co-authored-by: Joel Hans <joel.g.hans@gmail.com>

Ilya Mashchenko committed Feb 11, 2021 at 17:56 UTC 5e97c2cd45a73a5a37dc42addde1c27e7e9707bd
4 files changed +196 -111
collectors/python.d.plugin/adaptec_raid/README.md
+42 -22
@@ -6,53 +6,73 @@ sidebar_label: "Adaptec RAID"
6
7 # Adaptec RAID controller monitoring with Netdata
8
9 -Collects logical and physical devices metrics.
9 +Collects logical and physical devices metrics using `arcconf` command-line utility.
10 +
11 +Executed commands:
12 +
13 +- `sudo -n arcconf GETCONFIG 1 LD`
14 +- `sudo -n arcconf GETCONFIG 1 PD`
15
16 ## Requirements
17
13 -The module uses `arcconf`, which can only be executed by root. It uses
14 -`sudo` and assumes that it is configured such that the `netdata` user can
15 -execute `arcconf` as root without password.
18 +The module uses `arcconf`, which can only be executed by `root`. It uses
19 +`sudo` and assumes that it is configured such that the `netdata` user can execute `arcconf` as root without a password.
20
17 -Add to `sudoers`:
21 +- Add to your `/etc/sudoers` file:
22
19 -```
23 +`which arcconf` shows the full path to the binary.
24 +
25 +```bash
26 netdata ALL=(root) NOPASSWD: /path/to/arcconf
27 ```
28
23 -To grab stats it executes:
29 +- Reset Netdata's systemd
30 + unit [CapabilityBoundingSet](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Capabilities) (Linux
31 + distributions with systemd)
32
25 -- `sudo -n arcconf GETCONFIG 1 LD`
26 -- `sudo -n arcconf GETCONFIG 1 PD`
33 +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 `arcconf` using `sudo`.
34
28 -It produces:
35
30 -1. **Logical Device Status**
36 +As the `root` user, do the following:
37
32 -2. **Physical Device State**
38 +```cmd
39 +mkdir /etc/systemd/system/netdata.service.d
40 +echo -e '[Service]\nCapabilityBoundingSet=~' | tee /etc/systemd/system/netdata.service.d/unset-capability-bounding-set.conf
41 +systemctl daemon-reload
42 +systemctl restart netdata.service
43 +```
44
34 -3. **Physical Device S.M.A.R.T warnings**
45 +## Charts
46
36 -4. **Physical Device Temperature**
47 +- Logical Device Status
48 +- Physical Device State
49 +- Physical Device S.M.A.R.T warnings
50 +- Physical Device Temperature
51
38 -## Configuration
52 +## Enable the collector
53
40 -**adaptec_raid** is disabled by default. Should be explicitly enabled in `python.d.conf`.
54 +The `adaptec_raid` collector is disabled by default. To enable it, use `edit-config` from the
55 +Netdata [config directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`, to edit the `python.d.conf`
56 +file.
57
42 -```yaml
43 -adaptec_raid: yes
58 +```bash
59 +cd /etc/netdata # Replace this path with your Netdata config directory, if different
60 +sudo ./edit-config python.d.conf
61 ```
62
46 -Edit the `python.d/adaptec_raid.conf` configuration file using `edit-config` from the Netdata [config
47 -directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`.
63 +Change the value of the `adaptec_raid` setting to `yes`. Save the file and restart the Netdata Agent
64 +with `sudo systemctl restart netdata`, or the appropriate method for your system.
65 +
66 +## Configuration
67 +
68 +Edit the `python.d/adaptec_raid.conf` configuration file using `edit-config` from the
69 +Netdata [config directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`.
70
71 ```bash
72 cd /etc/netdata # Replace this path with your Netdata config directory, if different
73 sudo ./edit-config python.d/adaptec_raid.conf
74 ```
75
54 -
55 -
76 ![image](https://user-images.githubusercontent.com/22274335/47278133-6d306680-d601-11e8-87c2-cc9c0f42d686.png)
77
78 ---
collectors/python.d.plugin/hpssa/README.md
+36 -16
@@ -8,44 +8,64 @@ sidebar_label: "HP Smart Storage Arrays"
8
9 Monitors controller, cache module, logical and physical drive state and temperature using `ssacli` tool.
10
11 +Executed commands:
12 +
13 +- `sudo -n ssacli ctrl all show config detail`
14 +
15 ## Requirements:
16
17 This module uses `ssacli`, which can only be executed by root. It uses
14 -`sudo` and assumes that it is configured such that the `netdata` user can
15 -execute `ssacli` as root without password.
18 +`sudo` and assumes that it is configured such that the `netdata` user can execute `ssacli` as root without a password.
19
17 -Add to `sudoers`:
20 +- Add to your `/etc/sudoers` file:
21
19 -```
22 +`which ssacli` shows the full path to the binary.
23 +
24 +```bash
25 netdata ALL=(root) NOPASSWD: /path/to/ssacli
26 ```
27
23 -To collect metrics, the module executes: `sudo -n ssacli ctrl all show config detail`
28 +- Reset Netdata's systemd
29 + unit [CapabilityBoundingSet](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Capabilities) (Linux
30 + distributions with systemd)
31 +
32 +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`.
33 +
34 +As the `root` user, do the following:
35 +
36 +```cmd
37 +mkdir /etc/systemd/system/netdata.service.d
38 +echo -e '[Service]\nCapabilityBoundingSet=~' | tee /etc/systemd/system/netdata.service.d/unset-capability-bounding-set.conf
39 +systemctl daemon-reload
40 +systemctl restart netdata.service
41 +```
42
25 -This module produces:
43 +## Charts
44
27 -1. Controller state and temperature
28 -2. Cache module state and temperature
29 -3. Logical drive state
30 -4. Physical drive state and temperature
45 +- Controller status
46 +- Controller temperature
47 +- Logical drive status
48 +- Physical drive status
49 +- Physical drive temperature
50
51 ## Enable the collector
52
34 -The `hpssa` collector is disabled by default. To enable it, use `edit-config` from the Netdata [config
35 -directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`, to edit the `python.d.conf` file.
53 +The `hpssa` collector is disabled by default. To enable it, use `edit-config` from the
54 +Netdata [config directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`, to edit the `python.d.conf`
55 +file.
56
57 ```bash
58 cd /etc/netdata # Replace this path with your Netdata config directory, if different
59 sudo ./edit-config python.d.conf
60 ```
61
42 -Change the value of the `hpssa` setting to `yes`. Save the file and restart the Netdata Agent with `sudo systemctl
43 -restart netdata`, or the appropriate method for your system, to finish enabling the `hpssa` collector.
62 +Change the value of the `hpssa` setting to `yes`. Save the file and restart the Netdata Agent
63 +with `sudo systemctl restart netdata`, or the appropriate method for your system.
64
65 ## Configuration
66
47 -Edit the `python.d/hpssa.conf` configuration file using `edit-config` from the Netdata [config
48 -directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`.
67 +Edit the `python.d/hpssa.conf` configuration file using `edit-config` from the
68 +Netdata [config directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`.
69
70 ```bash
71 cd /etc/netdata # Replace this path with your Netdata config directory, if different
collectors/python.d.plugin/megacli/README.md
+41 -23
@@ -6,50 +6,68 @@ sidebar_label: "MegaRAID controllers"
6
7 # MegaRAID controller monitoring with Netdata
8
9 -Collects adapter, physical drives and battery stats.
9 +Collects adapter, physical drives and battery stats using `megacli` command-line tool.
10 +
11 +Executed commands:
12 +
13 +- `sudo -n megacli -LDPDInfo -aAll`
14 +- `sudo -n megacli -AdpBbuCmd -a0`
15
16 ## Requirements
17
13 -Uses the `megacli` program, which can only be executed by root. It uses
14 -`sudo` and assumes that it is configured such that the `netdata` user can
15 -execute `megacli` as root without password.
18 +The module uses `megacli`, which can only be executed by `root`. It uses
19 +`sudo` and assumes that it is configured such that the `netdata` user can execute `megacli` as root without a password.
20
17 -Add to `sudoers`:
21 +- Add to your `/etc/sudoers` file:
22
19 -```
23 +`which megacli` shows the full path to the binary.
24 +
25 +```bash
26 netdata ALL=(root) NOPASSWD: /path/to/megacli
27 ```
28
29 +- Reset Netdata's systemd
30 + unit [CapabilityBoundingSet](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Capabilities) (Linux
31 + distributions with systemd)
32
24 -To grab stats it executes:
33 +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 `megacli` using `sudo`.
34
26 -- `sudo -n megacli -LDPDInfo -aAll`
27 -- `sudo -n megacli -AdpBbuCmd -a0`
35
29 -It produces:
36 +As the `root` user, do the following:
37
31 -1. **Adapter State**
38 +```cmd
39 +mkdir /etc/systemd/system/netdata.service.d
40 +echo -e '[Service]\nCapabilityBoundingSet=~' | tee /etc/systemd/system/netdata.service.d/unset-capability-bounding-set.conf
41 +systemctl daemon-reload
42 +systemctl restart netdata.service
43 +```
44
33 -2. **Physical Drives Media Errors**
45 +## Charts
46
35 -3. **Physical Drives Predictive Failures**
47 +- Adapter State
48 +- Physical Drives Media Errors
49 +- Physical Drives Predictive Failures
50 +- Battery Relative State of Charge
51 +- Battery Cycle Count
52
37 -4. **Battery Relative State of Charge**
53 +## Enable the collector
54
39 -5. **Battery Cycle Count**
55 +The `megacli` collector is disabled by default. To enable it, use `edit-config` from the
56 +Netdata [config directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`, to edit the `python.d.conf`
57 +file.
58
59 +```bash
60 +cd /etc/netdata # Replace this path with your Netdata config directory, if different
61 +sudo ./edit-config python.d.conf
62 +```
63
64 +Change the value of the `megacli` setting to `yes`. Save the file and restart the Netdata Agent
65 +with `sudo systemctl restart netdata`, or the appropriate method for your system.
66
67 ## Configuration
68
45 -**megacli** is disabled by default. Should be explicitly enabled in `python.d.conf`.
46 -
47 -```yaml
48 -megacli: yes
49 -```
50 -
51 -Edit the `python.d/megacli.conf` configuration file using `edit-config` from the Netdata [config
52 -directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`.
69 +Edit the `python.d/megacli.conf` configuration file using `edit-config` from the
70 +Netdata [config directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`.
71
72 ```bash
73 cd /etc/netdata # Replace this path with your Netdata config directory, if different
collectors/python.d.plugin/samba/README.md
+77 -50
@@ -6,83 +6,110 @@ sidebar_label: "Samba"
6
7 # Samba monitoring with Netdata
8
9 -Monitors the performance metrics of Samba file sharing.
9 +Monitors the performance metrics of Samba file sharing using `smbstatus` command-line tool.
10 +
11 +Executed commands:
12 +
13 +- `sudo -n smbstatus -P`
14
15 ## Requirements
16
13 -- `smbstatus` program
14 -- `sudo` program
15 -- `smbd` must be compiled with profiling enabled
16 -- `smbd` must be started either with the `-P 1` option or inside `smb.conf` using `smbd profiling level`
17 -- `netdata` user needs to be able to sudo the `smbstatus` program without password
17 +- `smbstatus` program
18 +- `sudo` program
19 +- `smbd` must be compiled with profiling enabled
20 +- `smbd` must be started either with the `-P 1` option or inside `smb.conf` using `smbd profiling level`
21
19 -It produces the following charts:
22 +The module uses `smbstatus`, which can only be executed by `root`. It uses
23 +`sudo` and assumes that it is configured such that the `netdata` user can execute `smbstatus` as root without a
24 +password.
25
21 -1. **Syscall R/Ws** in kilobytes/s
26 +- Add to your `/etc/sudoers` file:
27
23 - - sendfile
24 - - recvfile
28 +`which smbstatus` shows the full path to the binary.
29
26 -2. **Smb2 R/Ws** in kilobytes/s
30 +```bash
31 +netdata ALL=(root) NOPASSWD: /path/to/smbstatus
32 +```
33
28 - - readout
29 - - writein
30 - - readin
31 - - writeout
34 +- Reset Netdata's systemd
35 + unit [CapabilityBoundingSet](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Capabilities) (Linux
36 + distributions with systemd)
37
33 -3. **Smb2 Create/Close** in operations/s
38 +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 `smbstatus` using `sudo`.
39
35 - - create
36 - - close
40
38 -4. **Smb2 Info** in operations/s
41 +As the `root` user, do the following:
42
40 - - getinfo
41 - - setinfo
43 +```cmd
44 +mkdir /etc/systemd/system/netdata.service.d
45 +echo -e '[Service]\nCapabilityBoundingSet=~' | tee /etc/systemd/system/netdata.service.d/unset-capability-bounding-set.conf
46 +systemctl daemon-reload
47 +systemctl restart netdata.service
48 +```
49
43 -5. **Smb2 Find** in operations/s
50 +## Charts
51
45 - - find
52 +1. **Syscall R/Ws** in kilobytes/s
53
47 -6. **Smb2 Notify** in operations/s
54 + - sendfile
55 + - recvfile
56
49 - - notify
57 +2. **Smb2 R/Ws** in kilobytes/s
58
51 -7. **Smb2 Lesser Ops** as counters
59 + - readout
60 + - writein
61 + - readin
62 + - writeout
63
53 - - tcon
54 - - negprot
55 - - tdis
56 - - cancel
57 - - logoff
58 - - flush
59 - - lock
60 - - keepalive
61 - - break
62 - - sessetup
64 +3. **Smb2 Create/Close** in operations/s
65
64 -## prerequisite
66 + - create
67 + - close
68
66 -This module uses `smbstatus` which can only be executed by root. It uses
67 -`sudo` and assumes that it is configured such that the `netdata` user can
68 -execute `smbstatus` as root without password.
69 +4. **Smb2 Info** in operations/s
70
70 -Add to `sudoers`:
71 + - getinfo
72 + - setinfo
73
72 -```
73 -netdata ALL=(root) NOPASSWD: /path/to/smbstatus
74 -```
74 +5. **Smb2 Find** in operations/s
75
76 -## Configuration
76 + - find
77
78 -**samba** is disabled by default. Should be explicitly enabled in `python.d.conf`.
78 +6. **Smb2 Notify** in operations/s
79
80 -```yaml
81 -samba: yes
80 + - notify
81 +
82 +7. **Smb2 Lesser Ops** as counters
83 +
84 + - tcon
85 + - negprot
86 + - tdis
87 + - cancel
88 + - logoff
89 + - flush
90 + - lock
91 + - keepalive
92 + - break
93 + - sessetup
94 +
95 +## Enable the collector
96 +
97 +The `samba` collector is disabled by default. To enable it, use `edit-config` from the
98 +Netdata [config directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`, to edit the `python.d.conf`
99 +file.
100 +
101 +```bash
102 +cd /etc/netdata # Replace this path with your Netdata config directory, if different
103 +sudo ./edit-config python.d.conf
104 ```
105
84 -Edit the `python.d/samba.conf` configuration file using `edit-config` from the Netdata [config
85 -directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`.
106 +Change the value of the `samba` setting to `yes`. Save the file and restart the Netdata Agent
107 +with `sudo systemctl restart netdata`, or the appropriate method for your system.
108 +
109 +## Configuration
110 +
111 +Edit the `python.d/samba.conf` configuration file using `edit-config` from the
112 +Netdata [config directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`.
113
114 ```bash
115 cd /etc/netdata # Replace this path with your Netdata config directory, if different