@cryptotaxi247 / netdata-1 / commits / 2bc3c2544

remove charts.d/nut (#16230)

Ilya Mashchenko committed Oct 18, 2023 at 10:01 UTC 2bc3c2544adbaac88856e0029e0a7baf3bf306c3
10 files changed -773
collectors/charts.d.plugin/Makefile.am
-1
@@ -45,6 +45,5 @@ include ap/Makefile.inc
45 include apcupsd/Makefile.inc
46 include example/Makefile.inc
47 include libreswan/Makefile.inc
48 -include nut/Makefile.inc
48 include opensips/Makefile.inc
49 include sensors/Makefile.inc
collectors/charts.d.plugin/charts.d.conf
-1
@@ -36,7 +36,6 @@
36 # ap=yes
37 # apcupsd=yes
38 # libreswan=yes
39 -# nut=yes
39 # opensips=yes
40
41 # -----------------------------------------------------------------------------
collectors/charts.d.plugin/nut/Makefile.inc deleted
-13
@@ -1,13 +0,0 @@
1 -# SPDX-License-Identifier: GPL-3.0-or-later
2 -
3 -# THIS IS NOT A COMPLETE Makefile
4 -# IT IS INCLUDED BY ITS PARENT'S Makefile.am
5 -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT
6 -
7 -# install these files
8 -dist_charts_DATA += nut/nut.chart.sh
9 -dist_chartsconfig_DATA += nut/nut.conf
10 -
11 -# do not install these files, but include them in the distribution
12 -dist_noinst_DATA += nut/README.md nut/Makefile.inc
13 -
collectors/charts.d.plugin/nut/README.md deleted
-1
@@ -1 +0,0 @@
1 -integrations/network_ups_tools_nut.md
\ No newline at end of file
collectors/charts.d.plugin/nut/integrations/network_ups_tools_nut.md deleted
-207
@@ -1,207 +0,0 @@
1 -<!--startmeta
2 -custom_edit_url: "https://github.com/netdata/netdata/edit/master/collectors/charts.d.plugin/nut/README.md"
3 -meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/charts.d.plugin/nut/metadata.yaml"
4 -sidebar_label: "Network UPS Tools (NUT)"
5 -learn_status: "Published"
6 -learn_rel_path: "Data Collection/UPS"
7 -message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
8 -endmeta-->
9 -
10 -# Network UPS Tools (NUT)
11 -
12 -
13 -<img src="https://netdata.cloud/img/plug-circle-bolt.svg" width="150"/>
14 -
15 -
16 -Plugin: charts.d.plugin
17 -Module: nut
18 -
19 -<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
20 -
21 -## Overview
22 -
23 -Examine UPS/PDU metrics with Netdata for insights into power device performance. Improve your power device performance with comprehensive dashboards and anomaly detection.
24 -
25 -This collector uses the `nut` (Network UPS Tools) to query statistics for multiple UPS devices.
26 -
27 -This collector is supported on all platforms.
28 -
29 -This collector supports collecting metrics from multiple instances of this integration, including remote instances.
30 -
31 -
32 -### Default Behavior
33 -
34 -#### Auto-Detection
35 -
36 -This integration doesn't support auto-detection.
37 -
38 -#### Limits
39 -
40 -The default configuration for this integration does not impose any limits on data collection.
41 -
42 -#### Performance Impact
43 -
44 -The default configuration for this integration is not expected to impose a significant performance impact on the system.
45 -
46 -
47 -## Metrics
48 -
49 -Metrics grouped by *scope*.
50 -
51 -The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
52 -
53 -
54 -
55 -### Per ups
56 -
57 -Metrics related to UPS. Each UPS provides its own set of the following metrics.
58 -
59 -This scope has no labels.
60 -
61 -Metrics:
62 -
63 -| Metric | Dimensions | Unit |
64 -|:------|:----------|:----|
65 -| nut.charge | charge | percentage |
66 -| nut.runtime | runtime | seconds |
67 -| nut.battery.voltage | voltage, high, low, nominal | Volts |
68 -| nut.input.voltage | voltage, fault, nominal | Volts |
69 -| nut.input.current | nominal | Ampere |
70 -| nut.input.frequency | frequency, nominal | Hz |
71 -| nut.output.voltage | voltage | Volts |
72 -| nut.load | load | percentage |
73 -| nut.load_usage | load_usage | Watts |
74 -| nut.temperature | temp | temperature |
75 -| nut.clients | clients | clients |
76 -
77 -
78 -
79 -## Alerts
80 -
81 -
82 -The following alerts are available:
83 -
84 -| Alert name | On metric | Description |
85 -|:------------|:----------|:------------|
86 -| [ nut_ups_charge ](https://github.com/netdata/netdata/blob/master/health/health.d/nut.conf) | nut.charge | average UPS charge over the last minute |
87 -| [ nut_10min_ups_load ](https://github.com/netdata/netdata/blob/master/health/health.d/nut.conf) | nut.load | average UPS load over the last 10 minutes |
88 -| [ nut_last_collected_secs ](https://github.com/netdata/netdata/blob/master/health/health.d/nut.conf) | nut.load | number of seconds since the last successful data collection |
89 -
90 -
91 -## Setup
92 -
93 -### Prerequisites
94 -
95 -#### Install charts.d plugin
96 -
97 -If [using our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/UPDATE.md#determine-which-installation-method-you-used), make sure `netdata-plugin-chartsd` is installed.
98 -
99 -
100 -#### Required software
101 -
102 -Make sure the Network UPS Tools (`nut`) is installed and can detect your UPS devices.
103 -
104 -
105 -### Configuration
106 -
107 -#### File
108 -
109 -The configuration file name for this integration is `charts.d/nut.conf`.
110 -
111 -
112 -You can edit the configuration file using the `edit-config` script from the
113 -Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory).
114 -
115 -```bash
116 -cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
117 -sudo ./edit-config charts.d/nut.conf
118 -```
119 -#### Options
120 -
121 -The config file is sourced by the charts.d plugin. It's a standard bash file.
122 -
123 -The following collapsed table contains all the options that can be configured for the nut collector.
124 -
125 -
126 -<details><summary>Config options</summary>
127 -
128 -| Name | Description | Default | Required |
129 -|:----|:-----------|:-------|:--------:|
130 -| nut_ups | A space separated list of UPS names. If empty, the list returned by `upsc -l` will be used. | | False |
131 -| nut_names | Each line represents an alias for one UPS. If empty, the FQDN will be used. | | False |
132 -| nut_timeout | How long to wait for nut to respond. | 2 | False |
133 -| nut_clients_chart | Set this to 1 to enable another chart showing the number of UPS clients connected to `upsd`. | 1 | False |
134 -| nut_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 2 | False |
135 -| nut_priority | The charts priority on the dashboard | 90000 | False |
136 -| nut_retries | The number of retries to do in case of failure before disabling the collector. | 10 | False |
137 -
138 -</details>
139 -
140 -#### Examples
141 -
142 -##### Provide names to UPS devices
143 -
144 -Map aliases to UPS devices
145 -
146 -<details><summary>Config</summary>
147 -
148 -```yaml
149 -# a space separated list of UPS names
150 -# if empty, the list returned by 'upsc -l' will be used
151 -#nut_ups=
152 -
153 -# each line represents an alias for one UPS
154 -# if empty, the FQDN will be used
155 -nut_names["XXXXXX"]="UPS-office"
156 -nut_names["YYYYYY"]="UPS-rack"
157 -
158 -# how much time in seconds, to wait for nut to respond
159 -#nut_timeout=2
160 -
161 -# set this to 1, to enable another chart showing the number
162 -# of UPS clients connected to upsd
163 -#nut_clients_chart=1
164 -
165 -# the data collection frequency
166 -# if unset, will inherit the netdata update frequency
167 -#nut_update_every=2
168 -
169 -# the charts priority on the dashboard
170 -#nut_priority=90000
171 -
172 -# the number of retries to do in case of failure
173 -# before disabling the module
174 -#nut_retries=10
175 -
176 -```
177 -</details>
178 -
179 -
180 -
181 -## Troubleshooting
182 -
183 -### Debug Mode
184 -
185 -To troubleshoot issues with the `nut` collector, run the `charts.d.plugin` with the debug option enabled. The output
186 -should give you clues as to why the collector isn't working.
187 -
188 -- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
189 - your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
190 -
191 - ```bash
192 - cd /usr/libexec/netdata/plugins.d/
193 - ```
194 -
195 -- Switch to the `netdata` user.
196 -
197 - ```bash
198 - sudo -u netdata -s
199 - ```
200 -
201 -- Run the `charts.d.plugin` to debug the collector:
202 -
203 - ```bash
204 - ./charts.d.plugin debug 1 nut
205 - ```
206 -
207 -
collectors/charts.d.plugin/nut/metadata.yaml deleted
-222
@@ -1,222 +0,0 @@
1 -plugin_name: charts.d.plugin
2 -modules:
3 - - meta:
4 - plugin_name: charts.d.plugin
5 - module_name: nut
6 - monitored_instance:
7 - name: Network UPS Tools (NUT)
8 - link: ''
9 - categories:
10 - - data-collection.ups
11 - icon_filename: 'plug-circle-bolt.svg'
12 - related_resources:
13 - integrations:
14 - list: []
15 - info_provided_to_referring_integrations:
16 - description: ''
17 - keywords:
18 - - nut
19 - - network ups tools
20 - - ups
21 - - pdu
22 - most_popular: false
23 - overview:
24 - data_collection:
25 - metrics_description: 'Examine UPS/PDU metrics with Netdata for insights into power device performance. Improve your power device performance with comprehensive dashboards and anomaly detection.'
26 - method_description: 'This collector uses the `nut` (Network UPS Tools) to query statistics for multiple UPS devices.'
27 - supported_platforms:
28 - include: []
29 - exclude: []
30 - multi_instance: true
31 - additional_permissions:
32 - description: ''
33 - default_behavior:
34 - auto_detection:
35 - description: ''
36 - limits:
37 - description: ''
38 - performance_impact:
39 - description: ''
40 - setup:
41 - prerequisites:
42 - list:
43 - - title: "Install charts.d plugin"
44 - description: |
45 - If [using our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/UPDATE.md#determine-which-installation-method-you-used), make sure `netdata-plugin-chartsd` is installed.
46 - - title: "Required software"
47 - description: "Make sure the Network UPS Tools (`nut`) is installed and can detect your UPS devices."
48 - configuration:
49 - file:
50 - name: charts.d/nut.conf
51 - options:
52 - description: |
53 - The config file is sourced by the charts.d plugin. It's a standard bash file.
54 -
55 - The following collapsed table contains all the options that can be configured for the nut collector.
56 - folding:
57 - title: "Config options"
58 - enabled: true
59 - list:
60 - - name: nut_ups
61 - description: A space separated list of UPS names. If empty, the list returned by `upsc -l` will be used.
62 - default_value: ""
63 - required: false
64 - - name: nut_names
65 - description: Each line represents an alias for one UPS. If empty, the FQDN will be used.
66 - default_value: ""
67 - required: false
68 - - name: nut_timeout
69 - description: How long to wait for nut to respond.
70 - default_value: 2
71 - required: false
72 - - name: nut_clients_chart
73 - description: Set this to 1 to enable another chart showing the number of UPS clients connected to `upsd`.
74 - default_value: 1
75 - required: false
76 - - name: nut_update_every
77 - description: The data collection frequency. If unset, will inherit the netdata update frequency.
78 - default_value: 2
79 - required: false
80 - - name: nut_priority
81 - description: The charts priority on the dashboard
82 - default_value: 90000
83 - required: false
84 - - name: nut_retries
85 - description: The number of retries to do in case of failure before disabling the collector.
86 - default_value: 10
87 - required: false
88 - examples:
89 - folding:
90 - enabled: true
91 - title: "Config"
92 - list:
93 - - name: Provide names to UPS devices
94 - description: Map aliases to UPS devices
95 - config: |
96 - # a space separated list of UPS names
97 - # if empty, the list returned by 'upsc -l' will be used
98 - #nut_ups=
99 -
100 - # each line represents an alias for one UPS
101 - # if empty, the FQDN will be used
102 - nut_names["XXXXXX"]="UPS-office"
103 - nut_names["YYYYYY"]="UPS-rack"
104 -
105 - # how much time in seconds, to wait for nut to respond
106 - #nut_timeout=2
107 -
108 - # set this to 1, to enable another chart showing the number
109 - # of UPS clients connected to upsd
110 - #nut_clients_chart=1
111 -
112 - # the data collection frequency
113 - # if unset, will inherit the netdata update frequency
114 - #nut_update_every=2
115 -
116 - # the charts priority on the dashboard
117 - #nut_priority=90000
118 -
119 - # the number of retries to do in case of failure
120 - # before disabling the module
121 - #nut_retries=10
122 - troubleshooting:
123 - problems:
124 - list: []
125 - alerts:
126 - - name: nut_ups_charge
127 - link: https://github.com/netdata/netdata/blob/master/health/health.d/nut.conf
128 - metric: nut.charge
129 - info: average UPS charge over the last minute
130 - os: "*"
131 - - name: nut_10min_ups_load
132 - link: https://github.com/netdata/netdata/blob/master/health/health.d/nut.conf
133 - metric: nut.load
134 - info: average UPS load over the last 10 minutes
135 - os: "*"
136 - - name: nut_last_collected_secs
137 - link: https://github.com/netdata/netdata/blob/master/health/health.d/nut.conf
138 - metric: nut.load
139 - info: number of seconds since the last successful data collection
140 - metrics:
141 - folding:
142 - title: Metrics
143 - enabled: false
144 - description: ""
145 - availability: []
146 - scopes:
147 - - name: ups
148 - description: "Metrics related to UPS. Each UPS provides its own set of the following metrics."
149 - labels: []
150 - metrics:
151 - - name: nut.charge
152 - description: UPS Charge
153 - unit: "percentage"
154 - chart_type: area
155 - dimensions:
156 - - name: charge
157 - - name: nut.runtime
158 - description: UPS Runtime
159 - unit: "seconds"
160 - chart_type: line
161 - dimensions:
162 - - name: runtime
163 - - name: nut.battery.voltage
164 - description: UPS Battery Voltage
165 - unit: "Volts"
166 - chart_type: line
167 - dimensions:
168 - - name: voltage
169 - - name: high
170 - - name: low
171 - - name: nominal
172 - - name: nut.input.voltage
173 - description: UPS Input Voltage
174 - unit: "Volts"
175 - chart_type: line
176 - dimensions:
177 - - name: voltage
178 - - name: fault
179 - - name: nominal
180 - - name: nut.input.current
181 - description: UPS Input Current
182 - unit: "Ampere"
183 - chart_type: line
184 - dimensions:
185 - - name: nominal
186 - - name: nut.input.frequency
187 - description: UPS Input Frequency
188 - unit: "Hz"
189 - chart_type: line
190 - dimensions:
191 - - name: frequency
192 - - name: nominal
193 - - name: nut.output.voltage
194 - description: UPS Output Voltage
195 - unit: "Volts"
196 - chart_type: line
197 - dimensions:
198 - - name: voltage
199 - - name: nut.load
200 - description: UPS Load
201 - unit: "percentage"
202 - chart_type: area
203 - dimensions:
204 - - name: load
205 - - name: nut.load_usage
206 - description: UPS Load Usage
207 - unit: "Watts"
208 - chart_type: area
209 - dimensions:
210 - - name: load_usage
211 - - name: nut.temperature
212 - description: UPS Temperature
213 - unit: "temperature"
214 - chart_type: line
215 - dimensions:
216 - - name: temp
217 - - name: nut.clients
218 - description: UPS Connected Clients
219 - unit: "clients"
220 - chart_type: area
221 - dimensions:
222 - - name: clients
collectors/charts.d.plugin/nut/nut.chart.sh deleted
-244
@@ -1,244 +0,0 @@
1 -# shellcheck shell=bash
2 -# no need for shebang - this file is loaded from charts.d.plugin
3 -# SPDX-License-Identifier: GPL-3.0-or-later
4 -
5 -# netdata
6 -# real-time performance and health monitoring, done right!
7 -# (C) 2016-2017 Costa Tsaousis <costa@tsaousis.gr>
8 -#
9 -
10 -# a space separated list of UPS names
11 -# if empty, the list returned by 'upsc -l' will be used
12 -nut_ups=
13 -
14 -# how frequently to collect UPS data
15 -nut_update_every=2
16 -
17 -# how much time in seconds, to wait for nut to respond
18 -nut_timeout=2
19 -
20 -# set this to 1, to enable another chart showing the number
21 -# of UPS clients connected to upsd
22 -nut_clients_chart=0
23 -
24 -# the priority of nut related to other charts
25 -nut_priority=90000
26 -
27 -declare -A nut_ids=()
28 -declare -A nut_names=()
29 -
30 -nut_get_all() {
31 - run -t $nut_timeout upsc -l
32 -}
33 -
34 -nut_get() {
35 - run -t $nut_timeout upsc "$1"
36 -
37 - if [ "${nut_clients_chart}" -eq "1" ]; then
38 - printf "ups.connected_clients: "
39 - run -t $nut_timeout upsc -c "$1" | wc -l
40 - fi
41 -}
42 -
43 -nut_check() {
44 -
45 - # this should return:
46 - # - 0 to enable the chart
47 - # - 1 to disable the chart
48 -
49 - local x
50 -
51 - require_cmd upsc || return 1
52 -
53 - [ -z "$nut_ups" ] && nut_ups="$(nut_get_all)"
54 -
55 - for x in $nut_ups; do
56 - nut_get "$x" > /dev/null
57 - # shellcheck disable=SC2181
58 - if [ $? -eq 0 ]; then
59 - if [ -n "${nut_names[${x}]}" ]; then
60 - nut_ids[$x]="$(fixid "${nut_names[${x}]}")"
61 - else
62 - nut_ids[$x]="$(fixid "$x")"
63 - fi
64 - continue
65 - fi
66 - error "cannot get information for NUT UPS '$x'."
67 - done
68 -
69 - if [ ${#nut_ids[@]} -eq 0 ]; then
70 - # shellcheck disable=SC2154
71 - error "Cannot find UPSes - please set nut_ups='ups_name' in $confd/nut.conf"
72 - return 1
73 - fi
74 -
75 - return 0
76 -}
77 -
78 -nut_create() {
79 - # create the charts
80 - local x
81 -
82 - for x in "${nut_ids[@]}"; do
83 - cat << EOF
84 -CHART nut_$x.charge '' "UPS Charge" "percentage" ups nut.charge area $((nut_priority + 2)) $nut_update_every
85 -DIMENSION battery_charge charge absolute 1 100
86 -
87 -CHART nut_$x.runtime '' "UPS Runtime" "seconds" ups nut.runtime area $((nut_priority + 3)) $nut_update_every
88 -DIMENSION battery_runtime runtime absolute 1 100
89 -
90 -CHART nut_$x.battery_voltage '' "UPS Battery Voltage" "Volts" ups nut.battery.voltage line $((nut_priority + 4)) $nut_update_every
91 -DIMENSION battery_voltage voltage absolute 1 100
92 -DIMENSION battery_voltage_high high absolute 1 100
93 -DIMENSION battery_voltage_low low absolute 1 100
94 -DIMENSION battery_voltage_nominal nominal absolute 1 100
95 -
96 -CHART nut_$x.input_voltage '' "UPS Input Voltage" "Volts" input nut.input.voltage line $((nut_priority + 5)) $nut_update_every
97 -DIMENSION input_voltage voltage absolute 1 100
98 -DIMENSION input_voltage_fault fault absolute 1 100
99 -DIMENSION input_voltage_nominal nominal absolute 1 100
100 -
101 -CHART nut_$x.input_current '' "UPS Input Current" "Ampere" input nut.input.current line $((nut_priority + 6)) $nut_update_every
102 -DIMENSION input_current_nominal nominal absolute 1 100
103 -
104 -CHART nut_$x.input_frequency '' "UPS Input Frequency" "Hz" input nut.input.frequency line $((nut_priority + 7)) $nut_update_every
105 -DIMENSION input_frequency frequency absolute 1 100
106 -DIMENSION input_frequency_nominal nominal absolute 1 100
107 -
108 -CHART nut_$x.output_voltage '' "UPS Output Voltage" "Volts" output nut.output.voltage line $((nut_priority + 8)) $nut_update_every
109 -DIMENSION output_voltage voltage absolute 1 100
110 -
111 -CHART nut_$x.load '' "UPS Load" "percentage" ups nut.load area $((nut_priority)) $nut_update_every
112 -DIMENSION load load absolute 1 100
113 -
114 -CHART nut_$x.load_usage '' "UPS Load Usage" "Watts" ups nut.load_usage area $((nut_priority + 1)) $nut_update_every
115 -DIMENSION load_usage load_usage absolute 1 100
116 -
117 -CHART nut_$x.temp '' "UPS Temperature" "temperature" ups nut.temperature line $((nut_priority + 9)) $nut_update_every
118 -DIMENSION temp temp absolute 1 100
119 -EOF
120 -
121 - if [ "${nut_clients_chart}" = "1" ]; then
122 - cat << EOF2
123 -CHART nut_$x.clients '' "UPS Connected Clients" "clients" ups nut.clients area $((nut_priority + 10)) $nut_update_every
124 -DIMENSION clients '' absolute 1 1
125 -EOF2
126 - fi
127 -
128 - done
129 -
130 - return 0
131 -}
132 -
133 -nut_update() {
134 - # the first argument to this function is the microseconds since last update
135 - # pass this parameter to the BEGIN statement (see below).
136 -
137 - # do all the work to collect / calculate the values
138 - # for each dimension
139 - # remember: KEEP IT SIMPLE AND SHORT
140 -
141 - local i x
142 - for i in "${!nut_ids[@]}"; do
143 - x="${nut_ids[$i]}"
144 - nut_get "$i" | awk "
145 -BEGIN {
146 - battery_charge = 0;
147 - battery_runtime = 0;
148 - battery_voltage = 0;
149 - battery_voltage_high = 0;
150 - battery_voltage_low = 0;
151 - battery_voltage_nominal = 0;
152 - input_voltage = 0;
153 - input_voltage_fault = 0;
154 - input_voltage_nominal = 0;
155 - input_current_nominal = 0;
156 - input_frequency = 0;
157 - input_frequency_nominal = 0;
158 - output_voltage = 0;
159 - load = 0;
160 - load_usage = 0;
161 - nompower = 0;
162 - temp = 0;
163 - client = 0;
164 - do_clients = ${nut_clients_chart};
165 -}
166 -/^battery.charge: .*/ { battery_charge = \$2 * 100 };
167 -/^battery.runtime: .*/ { battery_runtime = \$2 * 100 };
168 -/^battery.voltage: .*/ { battery_voltage = \$2 * 100 };
169 -/^battery.voltage.high: .*/ { battery_voltage_high = \$2 * 100 };
170 -/^battery.voltage.low: .*/ { battery_voltage_low = \$2 * 100 };
171 -/^battery.voltage.nominal: .*/ { battery_voltage_nominal = \$2 * 100 };
172 -/^input.voltage: .*/ { input_voltage = \$2 * 100 };
173 -/^input.voltage.fault: .*/ { input_voltage_fault = \$2 * 100 };
174 -/^input.voltage.nominal: .*/ { input_voltage_nominal = \$2 * 100 };
175 -/^input.current.nominal: .*/ { input_current_nominal = \$2 * 100 };
176 -/^input.frequency: .*/ { input_frequency = \$2 * 100 };
177 -/^input.frequency.nominal: .*/ { input_frequency_nominal = \$2 * 100 };
178 -/^output.voltage: .*/ { output_voltage = \$2 * 100 };
179 -/^ups.load: .*/ { load = \$2 * 100 };
180 -/^ups.realpower.nominal: .*/ { nompower = \$2 };
181 -/^ups.temperature: .*/ { temp = \$2 * 100 };
182 -/^ups.connected_clients: .*/ { clients = \$2 };
183 -END {
184 - { load_usage = nompower * load / 100 };
185 -
186 - print \"BEGIN nut_$x.charge $1\";
187 - print \"SET battery_charge = \" battery_charge;
188 - print \"END\"
189 -
190 - print \"BEGIN nut_$x.runtime $1\";
191 - print \"SET battery_runtime = \" battery_runtime;
192 - print \"END\"
193 -
194 - print \"BEGIN nut_$x.battery_voltage $1\";
195 - print \"SET battery_voltage = \" battery_voltage;
196 - print \"SET battery_voltage_high = \" battery_voltage_high;
197 - print \"SET battery_voltage_low = \" battery_voltage_low;
198 - print \"SET battery_voltage_nominal = \" battery_voltage_nominal;
199 - print \"END\"
200 -
201 - print \"BEGIN nut_$x.input_voltage $1\";
202 - print \"SET input_voltage = \" input_voltage;
203 - print \"SET input_voltage_fault = \" input_voltage_fault;
204 - print \"SET input_voltage_nominal = \" input_voltage_nominal;
205 - print \"END\"
206 -
207 - print \"BEGIN nut_$x.input_current $1\";
208 - print \"SET input_current_nominal = \" input_current_nominal;
209 - print \"END\"
210 -
211 - print \"BEGIN nut_$x.input_frequency $1\";
212 - print \"SET input_frequency = \" input_frequency;
213 - print \"SET input_frequency_nominal = \" input_frequency_nominal;
214 - print \"END\"
215 -
216 - print \"BEGIN nut_$x.output_voltage $1\";
217 - print \"SET output_voltage = \" output_voltage;
218 - print \"END\"
219 -
220 - print \"BEGIN nut_$x.load $1\";
221 - print \"SET load = \" load;
222 - print \"END\"
223 -
224 - print \"BEGIN nut_$x.load_usage $1\";
225 - print \"SET load_usage = \" load_usage;
226 - print \"END\"
227 -
228 - print \"BEGIN nut_$x.temp $1\";
229 - print \"SET temp = \" temp;
230 - print \"END\"
231 -
232 - if(do_clients) {
233 - print \"BEGIN nut_$x.clients $1\";
234 - print \"SET clients = \" clients;
235 - print \"END\"
236 - }
237 -}"
238 - # shellcheck disable=2181
239 - [ $? -ne 0 ] && unset "nut_ids[$i]" && error "failed to get values for '$i', disabling it."
240 - done
241 -
242 - [ ${#nut_ids[@]} -eq 0 ] && error "no UPSes left active." && return 1
243 - return 0
244 -}
collectors/charts.d.plugin/nut/nut.conf deleted
-33
@@ -1,33 +0,0 @@
1 -# no need for shebang - this file is loaded from charts.d.plugin
2 -
3 -# netdata
4 -# real-time performance and health monitoring, done right!
5 -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr>
6 -# GPL v3+
7 -
8 -# a space separated list of UPS names
9 -# if empty, the list returned by 'upsc -l' will be used
10 -#nut_ups=
11 -
12 -# each line represents an alias for one UPS
13 -# if empty, the FQDN will be used
14 -#nut_names["FQDN1"]="alias"
15 -#nut_names["FQDN2"]="alias"
16 -
17 -# how much time in seconds, to wait for nut to respond
18 -#nut_timeout=2
19 -
20 -# set this to 1, to enable another chart showing the number
21 -# of UPS clients connected to upsd
22 -#nut_clients_chart=1
23 -
24 -# the data collection frequency
25 -# if unset, will inherit the netdata update frequency
26 -#nut_update_every=2
27 -
28 -# the charts priority on the dashboard
29 -#nut_priority=90000
30 -
31 -# the number of retries to do in case of failure
32 -# before disabling the module
33 -#nut_retries=10
health/Makefile.am
-1
@@ -68,7 +68,6 @@ dist_healthconfig_DATA = \
68 health.d/net.conf \
69 health.d/netfilter.conf \
70 health.d/nvme.conf \
71 - health.d/nut.conf \
71 health.d/pihole.conf \
72 health.d/plugin.conf \
73 health.d/ping.conf \
health/health.d/nut.conf deleted
-50
@@ -1,50 +0,0 @@
1 -# you can disable an alarm notification by setting the 'to' line to: silent
2 -
3 - template: nut_10min_ups_load
4 - on: nut.load
5 - class: Utilization
6 - type: Power Supply
7 -component: UPS
8 - os: *
9 - hosts: *
10 - lookup: average -10m unaligned of load
11 - units: %
12 - every: 1m
13 - warn: $this > (($status >= $WARNING) ? (70) : (80))
14 - crit: $this > (($status == $CRITICAL) ? (85) : (95))
15 - delay: down 10m multiplier 1.5 max 1h
16 - summary: UPS load
17 - info: UPS average load over the last 10 minutes
18 - to: sitemgr
19 -
20 - template: nut_ups_charge
21 - on: nut.charge
22 - class: Errors
23 - type: Power Supply
24 -component: UPS
25 - os: *
26 - hosts: *
27 - lookup: average -60s unaligned of battery_charge
28 - units: %
29 - every: 60s
30 - warn: $this < 75
31 - crit: $this < 40
32 - delay: down 10m multiplier 1.5 max 1h
33 - summary: UPS battery charge
34 - info: UPS average battery charge over the last minute
35 - to: sitemgr
36 -
37 - template: nut_last_collected_secs
38 - on: nut.load
39 - class: Latency
40 - type: Power Supply
41 -component: UPS device
42 - calc: $now - $last_collected_t
43 - every: 10s
44 - units: seconds ago
45 - warn: $this > (($status >= $WARNING) ? ($update_every) : ( 5 * $update_every))
46 - crit: $this > (($status == $CRITICAL) ? ($update_every) : (60 * $update_every))
47 - delay: down 5m multiplier 1.5 max 1h
48 - summary: NUT last collected
49 - info: Number of seconds since the last successful data collection
50 - to: sitemgr