@cryptotaxi247 / netdata-1 / commits / 69f9707f0

remove charts.d/apcupsd (#18481)

Ilya Mashchenko committed Sep 8, 2024 at 16:06 UTC 69f9707f072dc61f758a2308df9caafdfb7e2433
6 files changed -827
CMakeLists.txt
-2
@@ -2836,7 +2836,6 @@ install(FILES
2836 DESTINATION usr/lib/netdata/conf.d)
2837
2838 install(PROGRAMS
2839 - src/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh
2839 src/collectors/charts.d.plugin/example/example.chart.sh
2840 src/collectors/charts.d.plugin/libreswan/libreswan.chart.sh
2841 src/collectors/charts.d.plugin/opensips/opensips.chart.sh
@@ -2844,7 +2843,6 @@ install(PROGRAMS
2843 DESTINATION usr/libexec/netdata/charts.d)
2844
2845 install(FILES
2847 - src/collectors/charts.d.plugin/apcupsd/apcupsd.conf
2846 src/collectors/charts.d.plugin/example/example.conf
2847 src/collectors/charts.d.plugin/libreswan/libreswan.conf
2848 src/collectors/charts.d.plugin/opensips/opensips.conf
src/collectors/charts.d.plugin/apcupsd/README.md deleted
-1
@@ -1 +0,0 @@
1 -integrations/apc_ups.md
\ No newline at end of file
src/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh deleted
-306
@@ -1,306 +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 Costa Tsaousis <costa@tsaousis.gr>
8 -#
9 -
10 -apcupsd_ip=
11 -apcupsd_port=
12 -
13 -declare -A apcupsd_sources=(
14 - ["local"]="127.0.0.1:3551"
15 -)
16 -
17 -# how frequently to collect UPS data
18 -apcupsd_update_every=10
19 -
20 -apcupsd_timeout=3
21 -
22 -# the priority of apcupsd related to other charts
23 -apcupsd_priority=90000
24 -
25 -apcupsd_get() {
26 - run -t $apcupsd_timeout apcaccess status "$1"
27 -}
28 -
29 -is_ups_alive() {
30 - local status
31 - status="$(apcupsd_get "$1" | sed -e 's/STATUS.*: //' -e 't' -e 'd')"
32 - case "$status" in
33 - "" | "COMMLOST" | "SHUTTING DOWN") return 1 ;;
34 - *) return 0 ;;
35 - esac
36 -}
37 -
38 -apcupsd_check() {
39 -
40 - # this should return:
41 - # - 0 to enable the chart
42 - # - 1 to disable the chart
43 -
44 - require_cmd apcaccess || return 1
45 -
46 - # backwards compatibility
47 - if [ "${apcupsd_ip}:${apcupsd_port}" != ":" ]; then
48 - apcupsd_sources["local"]="${apcupsd_ip}:${apcupsd_port}"
49 - fi
50 -
51 - local host working=0 failed=0
52 - for host in "${!apcupsd_sources[@]}"; do
53 - apcupsd_get "${apcupsd_sources[${host}]}" >/dev/null
54 - # shellcheck disable=2181
55 - if [ $? -ne 0 ]; then
56 - error "cannot get information for apcupsd server ${host} on ${apcupsd_sources[${host}]}."
57 - failed=$((failed + 1))
58 - else
59 - if ! is_ups_alive ${apcupsd_sources[${host}]}; then
60 - error "APC UPS ${host} on ${apcupsd_sources[${host}]} is not online."
61 - failed=$((failed + 1))
62 - else
63 - working=$((working + 1))
64 - fi
65 - fi
66 - done
67 -
68 - if [ ${working} -eq 0 ]; then
69 - error "No APC UPSes found available."
70 - return 1
71 - fi
72 -
73 - return 0
74 -}
75 -
76 -apcupsd_create() {
77 - local host
78 - for host in "${!apcupsd_sources[@]}"; do
79 - # create the charts
80 - cat <<EOF
81 -CHART apcupsd_${host}.charge '' "UPS Charge" "percentage" ups apcupsd.charge area $((apcupsd_priority + 2)) $apcupsd_update_every '' '' 'apcupsd'
82 -DIMENSION battery_charge charge absolute 1 100
83 -
84 -CHART apcupsd_${host}.battery_voltage '' "UPS Battery Voltage" "Volts" ups apcupsd.battery.voltage line $((apcupsd_priority + 4)) $apcupsd_update_every '' '' 'apcupsd'
85 -DIMENSION battery_voltage voltage absolute 1 100
86 -DIMENSION battery_voltage_nominal nominal absolute 1 100
87 -
88 -CHART apcupsd_${host}.input_voltage '' "UPS Input Voltage" "Volts" input apcupsd.input.voltage line $((apcupsd_priority + 5)) $apcupsd_update_every '' '' 'apcupsd'
89 -DIMENSION input_voltage voltage absolute 1 100
90 -DIMENSION input_voltage_min min absolute 1 100
91 -DIMENSION input_voltage_max max absolute 1 100
92 -
93 -CHART apcupsd_${host}.input_frequency '' "UPS Input Frequency" "Hz" input apcupsd.input.frequency line $((apcupsd_priority + 6)) $apcupsd_update_every '' '' 'apcupsd'
94 -DIMENSION input_frequency frequency absolute 1 100
95 -
96 -CHART apcupsd_${host}.output_voltage '' "UPS Output Voltage" "Volts" output apcupsd.output.voltage line $((apcupsd_priority + 7)) $apcupsd_update_every '' '' 'apcupsd'
97 -DIMENSION output_voltage voltage absolute 1 100
98 -DIMENSION output_voltage_nominal nominal absolute 1 100
99 -
100 -CHART apcupsd_${host}.load '' "UPS Load" "percentage" ups apcupsd.load area $((apcupsd_priority)) $apcupsd_update_every '' '' 'apcupsd'
101 -DIMENSION load load absolute 1 100
102 -
103 -CHART apcupsd_${host}.load_usage '' "UPS Load Usage" "Watts" ups apcupsd.load_usage area $((apcupsd_priority + 1)) $apcupsd_update_every '' '' 'apcupsd'
104 -DIMENSION load_usage load absolute 1 100
105 -
106 -CHART apcupsd_${host}.temp '' "UPS Temperature" "Celsius" ups apcupsd.temperature line $((apcupsd_priority + 8)) $apcupsd_update_every '' '' 'apcupsd'
107 -DIMENSION temp temp absolute 1 100
108 -
109 -CHART apcupsd_${host}.time '' "UPS Time Remaining" "Minutes" ups apcupsd.time area $((apcupsd_priority + 3)) $apcupsd_update_every '' '' 'apcupsd'
110 -DIMENSION time time absolute 1 100
111 -
112 -CHART apcupsd_${host}.online '' "UPS ONLINE flag" "boolean" ups apcupsd.online line $((apcupsd_priority + 9)) $apcupsd_update_every '' '' 'apcupsd'
113 -DIMENSION online online absolute 1 1
114 -
115 -CHART apcupsd_${host}.selftest '' "UPS Self-Test status" "status" ups apcupsd.selftest line $((apcupsd_priority + 10)) $apcupsd_update_every '' '' 'apcupsd'
116 -DIMENSION selftest_OK 'OK' absolute 1 1
117 -DIMENSION selftest_NO 'NO' absolute 1 1
118 -DIMENSION selftest_BT 'BT' absolute 1 1
119 -DIMENSION selftest_NG 'NG' absolute 1 1
120 -
121 -CHART apcupsd_${host}.status '' "UPS Status" "status" ups apcupsd.status line $((apcupsd_priority + 11)) $apcupsd_update_every '' '' 'apcupsd'
122 -DIMENSION status_ONLINE 'ONLINE' absolute 1 1
123 -DIMENSION status_ONBATT 'ONBATT' absolute 1 1
124 -DIMENSION status_OVERLOAD 'OVERLOAD' absolute 1 1
125 -DIMENSION status_LOWBATT 'LOWBATT' absolute 1 1
126 -DIMENSION status_REPLACEBATT 'REPLACEBATT' absolute 1 1
127 -DIMENSION status_NOBATT 'NOBATT' absolute 1 1
128 -DIMENSION status_SLAVE 'SLAVE' absolute 1 1
129 -DIMENSION status_SLAVEDOWN 'SLAVEDOWN' absolute 1 1
130 -DIMENSION status_COMMLOST 'COMMLOST' absolute 1 1
131 -DIMENSION status_CAL 'CAL' absolute 1 1
132 -DIMENSION status_TRIM 'TRIM' absolute 1 1
133 -DIMENSION status_BOOST 'BOOST' absolute 1 1
134 -DIMENSION status_SHUTTING_DOWN 'SHUTTING_DOWN' absolute 1 1
135 -
136 -EOF
137 - done
138 - return 0
139 -}
140 -
141 -apcupsd_update() {
142 - # the first argument to this function is the microseconds since last update
143 - # pass this parameter to the BEGIN statement (see below).
144 -
145 - # do all the work to collect / calculate the values
146 - # for each dimension
147 - # remember: KEEP IT SIMPLE AND SHORT
148 -
149 - local host working=0 failed=0
150 - for host in "${!apcupsd_sources[@]}"; do
151 - apcupsd_get "${apcupsd_sources[${host}]}" | awk "
152 -
153 -BEGIN {
154 - battery_charge = 0;
155 - battery_voltage = 0;
156 - battery_voltage_nominal = 0;
157 - input_voltage = 0;
158 - input_voltage_min = 0;
159 - input_voltage_max = 0;
160 - input_frequency = 0;
161 - output_voltage = 0;
162 - output_voltage_nominal = 0;
163 - load = 0;
164 - temp = 0;
165 - time = 0;
166 - online = 0;
167 - nompower = 0;
168 - load_usage = 0;
169 - selftest_OK = 0;
170 - selftest_NO = 0;
171 - selftest_BT = 0;
172 - selftest_NG = 0;
173 - status_ONLINE = 0;
174 - status_CAL = 0;
175 - status_TRIM = 0;
176 - status_BOOST = 0;
177 - status_ONBATT = 0;
178 - status_OVERLOAD = 0;
179 - status_LOWBATT = 0;
180 - status_REPLACEBATT = 0;
181 - status_NOBATT = 0;
182 - status_SLAVE = 0;
183 - status_SLAVEDOWN = 0;
184 - status_COMMLOST = 0;
185 - status_SHUTTING_DOWN = 0;
186 -
187 -}
188 -/^BCHARGE.*/ { battery_charge = \$3 * 100 };
189 -/^BATTV.*/ { battery_voltage = \$3 * 100 };
190 -/^NOMBATTV.*/ { battery_voltage_nominal = \$3 * 100 };
191 -/^LINEV.*/ { input_voltage = \$3 * 100 };
192 -/^MINLINEV.*/ { input_voltage_min = \$3 * 100 };
193 -/^MAXLINEV.*/ { input_voltage_max = \$3 * 100 };
194 -/^LINEFREQ.*/ { input_frequency = \$3 * 100 };
195 -/^OUTPUTV.*/ { output_voltage = \$3 * 100 };
196 -/^NOMOUTV.*/ { output_voltage_nominal = \$3 * 100 };
197 -/^LOADPCT.*/ { load = \$3 * 100 };
198 -/^ITEMP.*/ { temp = \$3 * 100 };
199 -/^NOMPOWER.*/ { nompower = \$3 };
200 -/^TIMELEFT.*/ { time = \$3 * 100 };
201 -/^STATUS.*/ { online=(\$0 !~ \"COMMLOST\" && \$0 !~ \"SHUTTING\") ? 1 : 0; };
202 -/^SELFTEST.*/ { selftest_OK = (\$3 == \"OK\") ? 1 : 0;
203 - selftest_NO = (\$3 == \"NO\") ? 1 : 0;
204 - selftest_BT = (\$3 == \"BT\") ? 1 : 0;
205 - selftest_NG = (\$3 == \"NG\") ? 1 : 0;
206 - };
207 -/^STATUS.*/ { status_ONLINE = (\$0 ~ \"ONLINE\") ? 1 : 0;
208 - status_CAL = (\$0 ~ \"CAL\") ? 1 : 0;
209 - status_TRIM = (\$0 ~ \"TRIM\") ? 1 : 0;
210 - status_BOOST = (\$0 ~ \"BOOST\") ? 1 : 0;
211 - status_ONBATT = (\$0 ~ \"ONBATT\") ? 1 : 0;
212 - status_OVERLOAD = (\$0 ~ \"OVERLOAD\") ? 1 : 0;
213 - status_LOWBATT = (\$0 ~ \"LOWBATT\") ? 1 : 0;
214 - status_REPLACEBATT = (\$0 ~ \"REPLACEBATT\") ? 1 : 0;
215 - status_NOBATT = (\$0 ~ \"NOBATT\") ? 1 : 0;
216 - status_SLAVE = (\$0 ~ \"SLAVE( |$)\") ? 1 : 0;
217 - status_SLAVEDOWN = (\$0 ~ \"SLAVEDOWN\") ? 1 : 0;
218 - status_COMMLOST = (\$0 ~ \"COMMLOST\") ? 1 : 0;
219 - status_SHUTTING_DOWN = (\$0 ~ \"SHUTTING\") ? 1 : 0;
220 - };
221 -
222 -END {
223 - { load_usage = nompower * load / 100 };
224 -
225 - print \"BEGIN apcupsd_${host}.online $1\";
226 - print \"SET online = \" online;
227 - print \"END\"
228 -
229 - if (online == 1) {
230 - print \"BEGIN apcupsd_${host}.charge $1\";
231 - print \"SET battery_charge = \" battery_charge;
232 - print \"END\"
233 -
234 - print \"BEGIN apcupsd_${host}.battery_voltage $1\";
235 - print \"SET battery_voltage = \" battery_voltage;
236 - print \"SET battery_voltage_nominal = \" battery_voltage_nominal;
237 - print \"END\"
238 -
239 - print \"BEGIN apcupsd_${host}.input_voltage $1\";
240 - print \"SET input_voltage = \" input_voltage;
241 - print \"SET input_voltage_min = \" input_voltage_min;
242 - print \"SET input_voltage_max = \" input_voltage_max;
243 - print \"END\"
244 -
245 - print \"BEGIN apcupsd_${host}.input_frequency $1\";
246 - print \"SET input_frequency = \" input_frequency;
247 - print \"END\"
248 -
249 - print \"BEGIN apcupsd_${host}.output_voltage $1\";
250 - print \"SET output_voltage = \" output_voltage;
251 - print \"SET output_voltage_nominal = \" output_voltage_nominal;
252 - print \"END\"
253 -
254 - print \"BEGIN apcupsd_${host}.load $1\";
255 - print \"SET load = \" load;
256 - print \"END\"
257 -
258 - print \"BEGIN apcupsd_${host}.load_usage $1\";
259 - print \"SET load_usage = \" load_usage;
260 - print \"END\"
261 -
262 - print \"BEGIN apcupsd_${host}.temp $1\";
263 - print \"SET temp = \" temp;
264 - print \"END\"
265 -
266 - print \"BEGIN apcupsd_${host}.time $1\";
267 - print \"SET time = \" time;
268 - print \"END\"
269 -
270 - print \"BEGIN apcupsd_${host}.selftest $1\";
271 - print \"SET selftest_OK = \" selftest_OK;
272 - print \"SET selftest_NO = \" selftest_NO;
273 - print \"SET selftest_BT = \" selftest_BT;
274 - print \"SET selftest_NG = \" selftest_NG;
275 - print \"END\"
276 -
277 - print \"BEGIN apcupsd_${host}.status $1\";
278 - print \"SET status_ONLINE = \" status_ONLINE;
279 - print \"SET status_ONBATT = \" status_ONBATT;
280 - print \"SET status_OVERLOAD = \" status_OVERLOAD;
281 - print \"SET status_LOWBATT = \" status_LOWBATT;
282 - print \"SET status_REPLACEBATT = \" status_REPLACEBATT;
283 - print \"SET status_NOBATT = \" status_NOBATT;
284 - print \"SET status_SLAVE = \" status_SLAVE;
285 - print \"SET status_SLAVEDOWN = \" status_SLAVEDOWN;
286 - print \"SET status_COMMLOST = \" status_COMMLOST;
287 - print \"SET status_CAL = \" status_CAL;
288 - print \"SET status_TRIM = \" status_TRIM;
289 - print \"SET status_BOOST = \" status_BOOST;
290 - print \"SET status_SHUTTING_DOWN = \" status_SHUTTING_DOWN;
291 - print \"END\";
292 - }
293 -}"
294 - # shellcheck disable=SC2181
295 - if [ $? -ne 0 ]; then
296 - failed=$((failed + 1))
297 - error "failed to get values for APC UPS ${host} on ${apcupsd_sources[${host}]}" && return 1
298 - else
299 - working=$((working + 1))
300 - fi
301 - done
302 -
303 - [ $working -eq 0 ] && error "failed to get values from all APC UPSes" && return 1
304 -
305 - return 0
306 -}
src/collectors/charts.d.plugin/apcupsd/apcupsd.conf deleted
-25
@@ -1,25 +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 -# add all your APC UPSes in this array - uncomment it too
9 -#declare -A apcupsd_sources=(
10 -# ["local"]="127.0.0.1:3551"
11 -#)
12 -
13 -# how long to wait for apcupsd to respond
14 -#apcupsd_timeout=3
15 -
16 -# the data collection frequency
17 -# if unset, will inherit the netdata update frequency
18 -#apcupsd_update_every=10
19 -
20 -# the charts priority on the dashboard
21 -#apcupsd_priority=90000
22 -
23 -# the number of retries to do in case of failure
24 -# before disabling the module
25 -#apcupsd_retries=10
src/collectors/charts.d.plugin/apcupsd/integrations/apc_ups.md deleted
-237
@@ -1,237 +0,0 @@
1 -<!--startmeta
2 -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/charts.d.plugin/apcupsd/README.md"
3 -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/charts.d.plugin/apcupsd/metadata.yaml"
4 -sidebar_label: "APC UPS"
5 -learn_status: "Published"
6 -learn_rel_path: "Collecting Metrics/UPS"
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 -# APC UPS
12 -
13 -
14 -<img src="https://netdata.cloud/img/apc.svg" width="150"/>
15 -
16 -
17 -Plugin: charts.d.plugin
18 -Module: apcupsd
19 -
20 -<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
21 -
22 -## Overview
23 -
24 -Monitor APC UPS performance with Netdata for optimal uninterruptible power supply operations. Enhance your power supply reliability with real-time APC UPS metrics.
25 -
26 -The collector uses the `apcaccess` tool to contact the `apcupsd` daemon and get the APC UPS statistics.
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 -By default, with no configuration provided, the collector will try to contact 127.0.0.1:3551 with using the `apcaccess` utility.
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 ups
57 -
58 -Metrics related to UPS. Each UPS provides its own set of the following metrics.
59 -
60 -This scope has no labels.
61 -
62 -Metrics:
63 -
64 -| Metric | Dimensions | Unit |
65 -|:------|:----------|:----|
66 -| apcupsd.charge | charge | percentage |
67 -| apcupsd.battery.voltage | voltage, nominal | Volts |
68 -| apcupsd.input.voltage | voltage, min, max | Volts |
69 -| apcupsd.output.voltage | absolute, nominal | Volts |
70 -| apcupsd.input.frequency | frequency | Hz |
71 -| apcupsd.load | load | percentage |
72 -| apcupsd.load_usage | load | Watts |
73 -| apcupsd.temperature | temp | Celsius |
74 -| apcupsd.time | time | Minutes |
75 -| apcupsd.online | online | boolean |
76 -| apcupsd.selftest | OK, NO, BT, NG | status |
77 -| apcupsd.status | ONLINE, ONBATT, OVERLOAD, LOWBATT, REPLACEBATT, NOBATT, SLAVE, SLAVEDOWN, COMMLOST, CAL, TRIM, BOOST, SHUTTING_DOWN | status |
78 -
79 -
80 -
81 -## Alerts
82 -
83 -
84 -The following alerts are available:
85 -
86 -| Alert name | On metric | Description |
87 -|:------------|:----------|:------------|
88 -| [ apcupsd_ups_charge ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.charge | average UPS charge over the last minute |
89 -| [ apcupsd_10min_ups_load ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.load | average UPS load over the last 10 minutes |
90 -| [ apcupsd_last_collected_secs ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.load | number of seconds since the last successful data collection |
91 -| [ apcupsd_selftest_warning ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.selftest | self-test failed due to insufficient battery capacity or due to overload. |
92 -| [ apcupsd_status_onbatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS has switched to battery power because the input power has failed |
93 -| [ apcupsd_status_overload ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS is overloaded and cannot supply enough power to the load |
94 -| [ apcupsd_status_lowbatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS battery is low and needs to be recharged |
95 -| [ apcupsd_status_replacebatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS battery has reached the end of its lifespan and needs to be replaced |
96 -| [ apcupsd_status_nobatt ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS has no battery |
97 -| [ apcupsd_status_commlost ](https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS communication link is lost |
98 -
99 -
100 -## Setup
101 -
102 -### Prerequisites
103 -
104 -#### Install charts.d plugin
105 -
106 -If [using our official native DEB/RPM packages](/packaging/installer/UPDATE.md#determine-which-installation-method-you-used), make sure `netdata-plugin-chartsd` is installed.
107 -
108 -
109 -#### Required software
110 -
111 -Make sure the `apcaccess` and `apcupsd` are installed and running.
112 -
113 -
114 -### Configuration
115 -
116 -#### File
117 -
118 -The configuration file name for this integration is `charts.d/apcupsd.conf`.
119 -
120 -
121 -You can edit the configuration file using the `edit-config` script from the
122 -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory).
123 -
124 -```bash
125 -cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
126 -sudo ./edit-config charts.d/apcupsd.conf
127 -```
128 -#### Options
129 -
130 -The config file is sourced by the charts.d plugin. It's a standard bash file.
131 -
132 -The following collapsed table contains all the options that can be configured for the apcupsd collector.
133 -
134 -
135 -<details open><summary>Config options</summary>
136 -
137 -| Name | Description | Default | Required |
138 -|:----|:-----------|:-------|:--------:|
139 -| apcupsd_sources | This is an array of apcupsd sources. You can have multiple entries there. Please refer to the example below on how to set it. | 127.0.0.1:3551 | no |
140 -| apcupsd_timeout | How long to wait for apcupsd to respond. | 3 | no |
141 -| apcupsd_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 1 | no |
142 -| apcupsd_priority | The charts priority on the dashboard. | 90000 | no |
143 -| apcupsd_retries | The number of retries to do in case of failure before disabling the collector. | 10 | no |
144 -
145 -</details>
146 -
147 -#### Examples
148 -
149 -##### Multiple apcupsd sources
150 -
151 -Specify a multiple apcupsd sources along with a custom update interval
152 -
153 -```yaml
154 -# add all your APC UPSes in this array - uncomment it too
155 -declare -A apcupsd_sources=(
156 - ["local"]="127.0.0.1:3551",
157 - ["remote"]="1.2.3.4:3551"
158 -)
159 -
160 -# how long to wait for apcupsd to respond
161 -#apcupsd_timeout=3
162 -
163 -# the data collection frequency
164 -# if unset, will inherit the netdata update frequency
165 -apcupsd_update_every=5
166 -
167 -# the charts priority on the dashboard
168 -#apcupsd_priority=90000
169 -
170 -# the number of retries to do in case of failure
171 -# before disabling the module
172 -#apcupsd_retries=10
173 -
174 -```
175 -
176 -
177 -## Troubleshooting
178 -
179 -### Debug Mode
180 -
181 -
182 -To troubleshoot issues with the `apcupsd` collector, run the `charts.d.plugin` with the debug option enabled. The output
183 -should give you clues as to why the collector isn't working.
184 -
185 -- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
186 - your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
187 -
188 - ```bash
189 - cd /usr/libexec/netdata/plugins.d/
190 - ```
191 -
192 -- Switch to the `netdata` user.
193 -
194 - ```bash
195 - sudo -u netdata -s
196 - ```
197 -
198 -- Run the `charts.d.plugin` to debug the collector:
199 -
200 - ```bash
201 - ./charts.d.plugin debug 1 apcupsd
202 - ```
203 -
204 -### Getting Logs
205 -
206 -If you're encountering problems with the `apcupsd` collector, follow these steps to retrieve logs and identify potential issues:
207 -
208 -- **Run the command** specific to your system (systemd, non-systemd, or Docker container).
209 -- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem.
210 -
211 -#### System with systemd
212 -
213 -Use the following command to view logs generated since the last Netdata service restart:
214 -
215 -```bash
216 -journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep apcupsd
217 -```
218 -
219 -#### System without systemd
220 -
221 -Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name:
222 -
223 -```bash
224 -grep apcupsd /var/log/netdata/collector.log
225 -```
226 -
227 -**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues.
228 -
229 -#### Docker Container
230 -
231 -If your Netdata runs in a Docker container named "netdata" (replace if different), use this command:
232 -
233 -```bash
234 -docker logs netdata 2>&1 | grep apcupsd
235 -```
236 -
237 -
src/collectors/charts.d.plugin/apcupsd/metadata.yaml deleted
-256
@@ -1,256 +0,0 @@
1 -plugin_name: charts.d.plugin
2 -modules:
3 - - meta:
4 - plugin_name: charts.d.plugin
5 - module_name: apcupsd
6 - monitored_instance:
7 - name: APC UPS
8 - link: "https://www.apc.com"
9 - categories:
10 - - data-collection.ups
11 - icon_filename: "apc.svg"
12 - related_resources:
13 - integrations:
14 - list: []
15 - info_provided_to_referring_integrations:
16 - description: ""
17 - keywords:
18 - - ups
19 - - apc
20 - - power
21 - - supply
22 - - battery
23 - - apcupsd
24 - most_popular: false
25 - overview:
26 - data_collection:
27 - metrics_description: "Monitor APC UPS performance with Netdata for optimal uninterruptible power supply operations. Enhance your power supply reliability with real-time APC UPS metrics."
28 - method_description: "The collector uses the `apcaccess` tool to contact the `apcupsd` daemon and get the APC UPS statistics."
29 - supported_platforms:
30 - include: []
31 - exclude: []
32 - multi_instance: false
33 - additional_permissions:
34 - description: ""
35 - default_behavior:
36 - auto_detection:
37 - description: "By default, with no configuration provided, the collector will try to contact 127.0.0.1:3551 with using the `apcaccess` utility."
38 - limits:
39 - description: ""
40 - performance_impact:
41 - description: ""
42 - setup:
43 - prerequisites:
44 - list:
45 - - title: "Install charts.d plugin"
46 - description: |
47 - If [using our official native DEB/RPM packages](/packaging/installer/UPDATE.md#determine-which-installation-method-you-used), make sure `netdata-plugin-chartsd` is installed.
48 - - title: "Required software"
49 - description: "Make sure the `apcaccess` and `apcupsd` are installed and running."
50 - configuration:
51 - file:
52 - name: charts.d/apcupsd.conf
53 - options:
54 - description: |
55 - The config file is sourced by the charts.d plugin. It's a standard bash file.
56 -
57 - The following collapsed table contains all the options that can be configured for the apcupsd collector.
58 - folding:
59 - title: "Config options"
60 - enabled: true
61 - list:
62 - - name: apcupsd_sources
63 - description: This is an array of apcupsd sources. You can have multiple entries there. Please refer to the example below on how to set it.
64 - default_value: "127.0.0.1:3551"
65 - required: false
66 - - name: apcupsd_timeout
67 - description: How long to wait for apcupsd to respond.
68 - default_value: 3
69 - required: false
70 - - name: apcupsd_update_every
71 - description: The data collection frequency. If unset, will inherit the netdata update frequency.
72 - default_value: 1
73 - required: false
74 - - name: apcupsd_priority
75 - description: The charts priority on the dashboard.
76 - default_value: 90000
77 - required: false
78 - - name: apcupsd_retries
79 - description: The number of retries to do in case of failure before disabling the collector.
80 - default_value: 10
81 - required: false
82 - examples:
83 - folding:
84 - enabled: false
85 - title: "Config"
86 - list:
87 - - name: Multiple apcupsd sources
88 - description: Specify a multiple apcupsd sources along with a custom update interval
89 - config: |
90 - # add all your APC UPSes in this array - uncomment it too
91 - declare -A apcupsd_sources=(
92 - ["local"]="127.0.0.1:3551",
93 - ["remote"]="1.2.3.4:3551"
94 - )
95 -
96 - # how long to wait for apcupsd to respond
97 - #apcupsd_timeout=3
98 -
99 - # the data collection frequency
100 - # if unset, will inherit the netdata update frequency
101 - apcupsd_update_every=5
102 -
103 - # the charts priority on the dashboard
104 - #apcupsd_priority=90000
105 -
106 - # the number of retries to do in case of failure
107 - # before disabling the module
108 - #apcupsd_retries=10
109 - troubleshooting:
110 - problems:
111 - list: []
112 - alerts:
113 - - name: apcupsd_ups_charge
114 - link: https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf
115 - metric: apcupsd.charge
116 - info: average UPS charge over the last minute
117 - os: "*"
118 - - name: apcupsd_10min_ups_load
119 - link: https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf
120 - metric: apcupsd.load
121 - info: average UPS load over the last 10 minutes
122 - os: "*"
123 - - name: apcupsd_last_collected_secs
124 - link: https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf
125 - metric: apcupsd.load
126 - info: number of seconds since the last successful data collection
127 - - name: apcupsd_selftest_warning
128 - link: https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf
129 - metric: apcupsd.selftest
130 - info: self-test failed due to insufficient battery capacity or due to overload.
131 - - name: apcupsd_status_onbatt
132 - link: https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf
133 - metric: apcupsd.status
134 - info: APC UPS has switched to battery power because the input power has failed
135 - - name: apcupsd_status_overload
136 - link: https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf
137 - metric: apcupsd.status
138 - info: APC UPS is overloaded and cannot supply enough power to the load
139 - - name: apcupsd_status_lowbatt
140 - link: https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf
141 - metric: apcupsd.status
142 - info: APC UPS battery is low and needs to be recharged
143 - - name: apcupsd_status_replacebatt
144 - link: https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf
145 - metric: apcupsd.status
146 - info: APC UPS battery has reached the end of its lifespan and needs to be replaced
147 - - name: apcupsd_status_nobatt
148 - link: https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf
149 - metric: apcupsd.status
150 - info: APC UPS has no battery
151 - - name: apcupsd_status_commlost
152 - link: https://github.com/netdata/netdata/blob/master/src/health/health.d/apcupsd.conf
153 - metric: apcupsd.status
154 - info: APC UPS communication link is lost
155 - metrics:
156 - folding:
157 - title: Metrics
158 - enabled: false
159 - description: ""
160 - availability: []
161 - scopes:
162 - - name: ups
163 - description: "Metrics related to UPS. Each UPS provides its own set of the following metrics."
164 - labels: []
165 - metrics:
166 - - name: apcupsd.charge
167 - description: UPS Charge
168 - unit: "percentage"
169 - chart_type: area
170 - dimensions:
171 - - name: charge
172 - - name: apcupsd.battery.voltage
173 - description: UPS Battery Voltage
174 - unit: "Volts"
175 - chart_type: line
176 - dimensions:
177 - - name: voltage
178 - - name: nominal
179 - - name: apcupsd.input.voltage
180 - description: UPS Input Voltage
181 - unit: "Volts"
182 - chart_type: line
183 - dimensions:
184 - - name: voltage
185 - - name: min
186 - - name: max
187 - - name: apcupsd.output.voltage
188 - description: UPS Output Voltage
189 - unit: "Volts"
190 - chart_type: line
191 - dimensions:
192 - - name: absolute
193 - - name: nominal
194 - - name: apcupsd.input.frequency
195 - description: UPS Input Voltage
196 - unit: "Hz"
197 - chart_type: line
198 - dimensions:
199 - - name: frequency
200 - - name: apcupsd.load
201 - description: UPS Load
202 - unit: "percentage"
203 - chart_type: area
204 - dimensions:
205 - - name: load
206 - - name: apcupsd.load_usage
207 - description: UPS Load Usage
208 - unit: "Watts"
209 - chart_type: area
210 - dimensions:
211 - - name: load
212 - - name: apcupsd.temperature
213 - description: UPS Temperature
214 - unit: "Celsius"
215 - chart_type: line
216 - dimensions:
217 - - name: temp
218 - - name: apcupsd.time
219 - description: UPS Time Remaining
220 - unit: "Minutes"
221 - chart_type: area
222 - dimensions:
223 - - name: time
224 - - name: apcupsd.online
225 - description: UPS ONLINE flag
226 - unit: "boolean"
227 - chart_type: line
228 - dimensions:
229 - - name: online
230 - - name: apcupsd.selftest
231 - description: UPS Self-Test status
232 - unit: status
233 - chart_type: line
234 - dimensions:
235 - - name: OK
236 - - name: NO
237 - - name: BT
238 - - name: NG
239 - - name: apcupsd.status
240 - description: UPS Status
241 - unit: status
242 - chart_type: line
243 - dimensions:
244 - - name: ONLINE
245 - - name: ONBATT
246 - - name: OVERLOAD
247 - - name: LOWBATT
248 - - name: REPLACEBATT
249 - - name: NOBATT
250 - - name: SLAVE
251 - - name: SLAVEDOWN
252 - - name: COMMLOST
253 - - name: CAL
254 - - name: TRIM
255 - - name: BOOST
256 - - name: SHUTTING_DOWN