summaryrefslogtreecommitdiffstats
path: root/collectors/charts.d.plugin
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/charts.d.plugin')
-rw-r--r--collectors/charts.d.plugin/Makefile.am1
-rw-r--r--collectors/charts.d.plugin/ap/integrations/access_points.md7
-rw-r--r--collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh212
-rw-r--r--collectors/charts.d.plugin/apcupsd/integrations/apc_ups.md20
-rw-r--r--collectors/charts.d.plugin/apcupsd/metadata.yaml55
-rw-r--r--collectors/charts.d.plugin/charts.d.conf1
-rwxr-xr-xcollectors/charts.d.plugin/charts.d.plugin.in158
-rw-r--r--collectors/charts.d.plugin/libreswan/integrations/libreswan.md9
-rw-r--r--collectors/charts.d.plugin/nut/Makefile.inc13
l---------collectors/charts.d.plugin/nut/README.md1
-rw-r--r--collectors/charts.d.plugin/nut/integrations/network_ups_tools_nut.md207
-rw-r--r--collectors/charts.d.plugin/nut/metadata.yaml222
-rw-r--r--collectors/charts.d.plugin/nut/nut.chart.sh244
-rw-r--r--collectors/charts.d.plugin/nut/nut.conf33
-rw-r--r--collectors/charts.d.plugin/opensips/integrations/opensips.md13
-rw-r--r--collectors/charts.d.plugin/sensors/integrations/linux_sensors_sysfs.md13
16 files changed, 348 insertions, 861 deletions
diff --git a/collectors/charts.d.plugin/Makefile.am b/collectors/charts.d.plugin/Makefile.am
index 03c7f0a94..f82992fd4 100644
--- a/collectors/charts.d.plugin/Makefile.am
+++ b/collectors/charts.d.plugin/Makefile.am
@@ -45,6 +45,5 @@ include ap/Makefile.inc
include apcupsd/Makefile.inc
include example/Makefile.inc
include libreswan/Makefile.inc
-include nut/Makefile.inc
include opensips/Makefile.inc
include sensors/Makefile.inc
diff --git a/collectors/charts.d.plugin/ap/integrations/access_points.md b/collectors/charts.d.plugin/ap/integrations/access_points.md
index 0d8d39046..a0de2c4df 100644
--- a/collectors/charts.d.plugin/ap/integrations/access_points.md
+++ b/collectors/charts.d.plugin/ap/integrations/access_points.md
@@ -4,6 +4,7 @@ meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/charts.d.p
sidebar_label: "Access Points"
learn_status: "Published"
learn_rel_path: "Data Collection/Linux Systems/Network"
+most_popular: False
message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
endmeta-->
@@ -117,9 +118,9 @@ The following collapsed table contains all the options that can be configured fo
| Name | Description | Default | Required |
|:----|:-----------|:-------|:--------:|
-| ap_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 1 | False |
-| ap_priority | Controls the order of charts at the netdata dashboard. | 6900 | False |
-| ap_retries | The number of retries to do in case of failure before disabling the collector. | 10 | False |
+| ap_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 1 | no |
+| ap_priority | Controls the order of charts at the netdata dashboard. | 6900 | no |
+| ap_retries | The number of retries to do in case of failure before disabling the collector. | 10 | no |
</details>
diff --git a/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh b/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh
index ef9a90596..da9cd19c3 100644
--- a/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh
+++ b/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh
@@ -50,7 +50,7 @@ apcupsd_check() {
local host working=0 failed=0
for host in "${!apcupsd_sources[@]}"; do
- apcupsd_get "${apcupsd_sources[${host}]}" > /dev/null
+ apcupsd_get "${apcupsd_sources[${host}]}" >/dev/null
# shellcheck disable=2181
if [ $? -ne 0 ]; then
error "cannot get information for apcupsd server ${host} on ${apcupsd_sources[${host}]}."
@@ -77,7 +77,7 @@ apcupsd_create() {
local host
for host in "${!apcupsd_sources[@]}"; do
# create the charts
- cat << EOF
+ cat <<EOF
CHART apcupsd_${host}.charge '' "UPS Charge" "percentage" ups apcupsd.charge area $((apcupsd_priority + 2)) $apcupsd_update_every '' '' 'apcupsd'
DIMENSION battery_charge charge absolute 1 100
@@ -110,7 +110,28 @@ CHART apcupsd_${host}.time '' "UPS Time Remaining" "Minutes" ups apcupsd.time ar
DIMENSION time time absolute 1 100
CHART apcupsd_${host}.online '' "UPS ONLINE flag" "boolean" ups apcupsd.online line $((apcupsd_priority + 9)) $apcupsd_update_every '' '' 'apcupsd'
-DIMENSION online online absolute 0 1
+DIMENSION online online absolute 1 1
+
+CHART apcupsd_${host}.selftest '' "UPS Self-Test status" "status" ups apcupsd.selftest line $((apcupsd_priority + 10)) $apcupsd_update_every '' '' 'apcupsd'
+DIMENSION selftest_OK 'OK' absolute 1 1
+DIMENSION selftest_NO 'NO' absolute 1 1
+DIMENSION selftest_BT 'BT' absolute 1 1
+DIMENSION selftest_NG 'NG' absolute 1 1
+
+CHART apcupsd_${host}.status '' "UPS Status" "status" ups apcupsd.status line $((apcupsd_priority + 11)) $apcupsd_update_every '' '' 'apcupsd'
+DIMENSION status_ONLINE 'ONLINE' absolute 1 1
+DIMENSION status_ONBATT 'ONBATT' absolute 1 1
+DIMENSION status_OVERLOAD 'OVERLOAD' absolute 1 1
+DIMENSION status_LOWBATT 'LOWBATT' absolute 1 1
+DIMENSION status_REPLACEBATT 'REPLACEBATT' absolute 1 1
+DIMENSION status_NOBATT 'NOBATT' absolute 1 1
+DIMENSION status_SLAVE 'SLAVE' absolute 1 1
+DIMENSION status_SLAVEDOWN 'SLAVEDOWN' absolute 1 1
+DIMENSION status_COMMLOST 'COMMLOST' absolute 1 1
+DIMENSION status_CAL 'CAL' absolute 1 1
+DIMENSION status_TRIM 'TRIM' absolute 1 1
+DIMENSION status_BOOST 'BOOST' absolute 1 1
+DIMENSION status_SHUTTING_DOWN 'SHUTTING_DOWN' absolute 1 1
EOF
done
@@ -130,20 +151,38 @@ apcupsd_update() {
apcupsd_get "${apcupsd_sources[${host}]}" | awk "
BEGIN {
- battery_charge = 0;
- battery_voltage = 0;
- battery_voltage_nominal = 0;
- input_voltage = 0;
- input_voltage_min = 0;
- input_voltage_max = 0;
- input_frequency = 0;
- output_voltage = 0;
- output_voltage_nominal = 0;
- load = 0;
- temp = 0;
- time = 0;
- nompower = 0;
- load_usage = 0;
+ battery_charge = 0;
+ battery_voltage = 0;
+ battery_voltage_nominal = 0;
+ input_voltage = 0;
+ input_voltage_min = 0;
+ input_voltage_max = 0;
+ input_frequency = 0;
+ output_voltage = 0;
+ output_voltage_nominal = 0;
+ load = 0;
+ temp = 0;
+ time = 0;
+ nompower = 0;
+ load_usage = 0;
+ selftest_OK = 0;
+ selftest_NO = 0;
+ selftest_BT = 0;
+ selftest_NG = 0;
+ status_ONLINE = 0;
+ status_CAL = 0;
+ status_TRIM = 0;
+ status_BOOST = 0;
+ status_ONBATT = 0;
+ status_OVERLOAD = 0;
+ status_LOWBATT = 0;
+ status_REPLACEBATT = 0;
+ status_NOBATT = 0;
+ status_SLAVE = 0;
+ status_SLAVEDOWN = 0;
+ status_COMMLOST = 0;
+ status_SHUTTING_DOWN = 0;
+
}
/^BCHARGE.*/ { battery_charge = \$3 * 100 };
/^BATTV.*/ { battery_voltage = \$3 * 100 };
@@ -158,55 +197,98 @@ BEGIN {
/^ITEMP.*/ { temp = \$3 * 100 };
/^NOMPOWER.*/ { nompower = \$3 };
/^TIMELEFT.*/ { time = \$3 * 100 };
-/^STATUS.*/ { online=(\$3 != \"COMMLOST\" && !(\$3 == \"SHUTTING\" && \$4 == \"DOWN\"))?1:0 };
+/^STATUS.*/ { online=(\$3 != \"COMMLOST\" && !(\$3 == \"SHUTTING\" && \$4 == \"DOWN\"))?1:0; };
+/^SELFTEST.*/ { selftest_OK = (\$3 == \"OK\") ? 1 : 0;
+ selftest_NO = (\$3 == \"NO\") ? 1 : 0;
+ selftest_BT = (\$3 == \"BT\") ? 1 : 0;
+ selftest_NG = (\$3 == \"NG\") ? 1 : 0;
+ };
+/^STATUS.*/ { status_ONLINE = (\$3 == \"ONLINE\") ? 1 : 0;
+ status_CAL = (\$3 == \"CAL\") ? 1 : 0;
+ status_TRIM = (\$3 == \"TRIM\") ? 1 : 0;
+ status_BOOST = (\$3 == \"BOOST\") ? 1 : 0;
+ status_ONBATT = (\$3 == \"ONBATT\") ? 1 : 0;
+ status_OVERLOAD = (\$3 == \"OVERLOAD\") ? 1 : 0;
+ status_LOWBATT = (\$3 == \"LOWBATT\") ? 1 : 0;
+ status_REPLACEBATT = (\$3 == \"REPLACEBATT\") ? 1 : 0;
+ status_NOBATT = (\$3 == \"NOBATT\") ? 1 : 0;
+ status_SLAVE = (\$3 == \"SLAVE\") ? 1 : 0;
+ status_SLAVEDOWN = (\$3 == \"SLAVEDOWN\") ? 1 : 0;
+ status_COMMLOST = (\$3 == \"COMMLOST\") ? 1 : 0;
+ status_SHUTTING_DOWN = (\$3 == \"SHUTTING\" && \$4 == \"DOWN\") ? 1 : 0;
+ };
+
END {
- { load_usage = nompower * load / 100 };
-
- print \"BEGIN apcupsd_${host}.online $1\";
- print \"SET online = \" online;
- print \"END\"
-
- if (online == 1) {
- print \"BEGIN apcupsd_${host}.charge $1\";
- print \"SET battery_charge = \" battery_charge;
- print \"END\"
-
- print \"BEGIN apcupsd_${host}.battery_voltage $1\";
- print \"SET battery_voltage = \" battery_voltage;
- print \"SET battery_voltage_nominal = \" battery_voltage_nominal;
- print \"END\"
-
- print \"BEGIN apcupsd_${host}.input_voltage $1\";
- print \"SET input_voltage = \" input_voltage;
- print \"SET input_voltage_min = \" input_voltage_min;
- print \"SET input_voltage_max = \" input_voltage_max;
- print \"END\"
-
- print \"BEGIN apcupsd_${host}.input_frequency $1\";
- print \"SET input_frequency = \" input_frequency;
- print \"END\"
-
- print \"BEGIN apcupsd_${host}.output_voltage $1\";
- print \"SET output_voltage = \" output_voltage;
- print \"SET output_voltage_nominal = \" output_voltage_nominal;
- print \"END\"
-
- print \"BEGIN apcupsd_${host}.load $1\";
- print \"SET load = \" load;
- print \"END\"
-
- print \"BEGIN apcupsd_${host}.load_usage $1\";
- print \"SET load_usage = \" load_usage;
- print \"END\"
-
- print \"BEGIN apcupsd_${host}.temp $1\";
- print \"SET temp = \" temp;
- print \"END\"
-
- print \"BEGIN apcupsd_${host}.time $1\";
- print \"SET time = \" time;
- print \"END\"
- }
+ { load_usage = nompower * load / 100 };
+
+ print \"BEGIN apcupsd_${host}.online $1\";
+ print \"SET online = \" online;
+ print \"END\"
+
+ if (online == 1) {
+ print \"BEGIN apcupsd_${host}.charge $1\";
+ print \"SET battery_charge = \" battery_charge;
+ print \"END\"
+
+ print \"BEGIN apcupsd_${host}.battery_voltage $1\";
+ print \"SET battery_voltage = \" battery_voltage;
+ print \"SET battery_voltage_nominal = \" battery_voltage_nominal;
+ print \"END\"
+
+ print \"BEGIN apcupsd_${host}.input_voltage $1\";
+ print \"SET input_voltage = \" input_voltage;
+ print \"SET input_voltage_min = \" input_voltage_min;
+ print \"SET input_voltage_max = \" input_voltage_max;
+ print \"END\"
+
+ print \"BEGIN apcupsd_${host}.input_frequency $1\";
+ print \"SET input_frequency = \" input_frequency;
+ print \"END\"
+
+ print \"BEGIN apcupsd_${host}.output_voltage $1\";
+ print \"SET output_voltage = \" output_voltage;
+ print \"SET output_voltage_nominal = \" output_voltage_nominal;
+ print \"END\"
+
+ print \"BEGIN apcupsd_${host}.load $1\";
+ print \"SET load = \" load;
+ print \"END\"
+
+ print \"BEGIN apcupsd_${host}.load_usage $1\";
+ print \"SET load_usage = \" load_usage;
+ print \"END\"
+
+ print \"BEGIN apcupsd_${host}.temp $1\";
+ print \"SET temp = \" temp;
+ print \"END\"
+
+ print \"BEGIN apcupsd_${host}.time $1\";
+ print \"SET time = \" time;
+ print \"END\"
+
+ print \"BEGIN apcupsd_${host}.selftest $1\";
+ print \"SET selftest_OK = \" selftest_OK;
+ print \"SET selftest_NO = \" selftest_NO;
+ print \"SET selftest_BT = \" selftest_BT;
+ print \"SET selftest_NG = \" selftest_NG;
+ print \"END\"
+
+ print \"BEGIN apcupsd_${host}.status $1\";
+ print \"SET status_ONLINE = \" status_ONLINE;
+ print \"SET status_ONBATT = \" status_ONBATT;
+ print \"SET status_OVERLOAD = \" status_OVERLOAD;
+ print \"SET status_LOWBATT = \" status_LOWBATT;
+ print \"SET status_REPLACEBATT = \" status_REPLACEBATT;
+ print \"SET status_NOBATT = \" status_NOBATT;
+ print \"SET status_SLAVE = \" status_SLAVE;
+ print \"SET status_SLAVEDOWN = \" status_SLAVEDOWN;
+ print \"SET status_COMMLOST = \" status_COMMLOST;
+ print \"SET status_CAL = \" status_CAL;
+ print \"SET status_TRIM = \" status_TRIM;
+ print \"SET status_BOOST = \" status_BOOST;
+ print \"SET status_SHUTTING_DOWN = \" status_SHUTTING_DOWN;
+ print \"END\";
+ }
}"
# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
diff --git a/collectors/charts.d.plugin/apcupsd/integrations/apc_ups.md b/collectors/charts.d.plugin/apcupsd/integrations/apc_ups.md
index 4d1f2edd6..a5c1f9613 100644
--- a/collectors/charts.d.plugin/apcupsd/integrations/apc_ups.md
+++ b/collectors/charts.d.plugin/apcupsd/integrations/apc_ups.md
@@ -4,6 +4,7 @@ meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/charts.d.p
sidebar_label: "APC UPS"
learn_status: "Published"
learn_rel_path: "Data Collection/UPS"
+most_popular: False
message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
endmeta-->
@@ -72,6 +73,8 @@ Metrics:
| apcupsd.temperature | temp | Celsius |
| apcupsd.time | time | Minutes |
| apcupsd.online | online | boolean |
+| apcupsd.selftest | OK, NO, BT, NG | status |
+| apcupsd.status | ONLINE, ONBATT, OVERLOAD, LOWBATT, REPLACEBATT, NOBATT, SLAVE, SLAVEDOWN, COMMLOST, CAL, TRIM, BOOST, SHUTTING_DOWN | status |
@@ -85,6 +88,13 @@ The following alerts are available:
| [ apcupsd_ups_charge ](https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf) | apcupsd.charge | average UPS charge over the last minute |
| [ apcupsd_10min_ups_load ](https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf) | apcupsd.load | average UPS load over the last 10 minutes |
| [ apcupsd_last_collected_secs ](https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf) | apcupsd.load | number of seconds since the last successful data collection |
+| [ apcupsd_selftest_warning ](https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf) | apcupsd.selftest | self-test failed due to insufficient battery capacity or due to overload. |
+| [ apcupsd_status_onbatt ](https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS has switched to battery power because the input power has failed |
+| [ apcupsd_status_overload ](https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS is overloaded and cannot supply enough power to the load |
+| [ apcupsd_status_lowbatt ](https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS battery is low and needs to be recharged |
+| [ apcupsd_status_replacebatt ](https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS battery has reached the end of its lifespan and needs to be replaced |
+| [ apcupsd_status_nobatt ](https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS has no battery |
+| [ apcupsd_status_commlost ](https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf) | apcupsd.status | APC UPS communication link is lost |
## Setup
@@ -126,11 +136,11 @@ The following collapsed table contains all the options that can be configured fo
| Name | Description | Default | Required |
|:----|:-----------|:-------|:--------:|
-| 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 | False |
-| apcupsd_timeout | How long to wait for apcupsd to respond. | 3 | False |
-| apcupsd_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 1 | False |
-| apcupsd_priority | The charts priority on the dashboard. | 90000 | False |
-| apcupsd_retries | The number of retries to do in case of failure before disabling the collector. | 10 | False |
+| 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 |
+| apcupsd_timeout | How long to wait for apcupsd to respond. | 3 | no |
+| apcupsd_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 1 | no |
+| apcupsd_priority | The charts priority on the dashboard. | 90000 | no |
+| apcupsd_retries | The number of retries to do in case of failure before disabling the collector. | 10 | no |
</details>
diff --git a/collectors/charts.d.plugin/apcupsd/metadata.yaml b/collectors/charts.d.plugin/apcupsd/metadata.yaml
index 07d56d48d..c333dc964 100644
--- a/collectors/charts.d.plugin/apcupsd/metadata.yaml
+++ b/collectors/charts.d.plugin/apcupsd/metadata.yaml
@@ -124,6 +124,34 @@ modules:
link: https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf
metric: apcupsd.load
info: number of seconds since the last successful data collection
+ - name: apcupsd_selftest_warning
+ link: https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf
+ metric: apcupsd.selftest
+ info: self-test failed due to insufficient battery capacity or due to overload.
+ - name: apcupsd_status_onbatt
+ link: https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf
+ metric: apcupsd.status
+ info: APC UPS has switched to battery power because the input power has failed
+ - name: apcupsd_status_overload
+ link: https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf
+ metric: apcupsd.status
+ info: APC UPS is overloaded and cannot supply enough power to the load
+ - name: apcupsd_status_lowbatt
+ link: https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf
+ metric: apcupsd.status
+ info: APC UPS battery is low and needs to be recharged
+ - name: apcupsd_status_replacebatt
+ link: https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf
+ metric: apcupsd.status
+ info: APC UPS battery has reached the end of its lifespan and needs to be replaced
+ - name: apcupsd_status_nobatt
+ link: https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf
+ metric: apcupsd.status
+ info: APC UPS has no battery
+ - name: apcupsd_status_commlost
+ link: https://github.com/netdata/netdata/blob/master/health/health.d/apcupsd.conf
+ metric: apcupsd.status
+ info: APC UPS communication link is lost
metrics:
folding:
title: Metrics
@@ -199,3 +227,30 @@ modules:
chart_type: line
dimensions:
- name: online
+ - name: apcupsd.selftest
+ description: UPS Self-Test status
+ unit: status
+ chart_type: line
+ dimensions:
+ - name: OK
+ - name: NO
+ - name: BT
+ - name: NG
+ - name: apcupsd.status
+ description: UPS Status
+ unit: status
+ chart_type: line
+ dimensions:
+ - name: ONLINE
+ - name: ONBATT
+ - name: OVERLOAD
+ - name: LOWBATT
+ - name: REPLACEBATT
+ - name: NOBATT
+ - name: SLAVE
+ - name: SLAVEDOWN
+ - name: COMMLOST
+ - name: CAL
+ - name: TRIM
+ - name: BOOST
+ - name: SHUTTING_DOWN
diff --git a/collectors/charts.d.plugin/charts.d.conf b/collectors/charts.d.plugin/charts.d.conf
index 2d32f73ea..4614f259e 100644
--- a/collectors/charts.d.plugin/charts.d.conf
+++ b/collectors/charts.d.plugin/charts.d.conf
@@ -36,7 +36,6 @@
# ap=yes
# apcupsd=yes
# libreswan=yes
-# nut=yes
# opensips=yes
# -----------------------------------------------------------------------------
diff --git a/collectors/charts.d.plugin/charts.d.plugin.in b/collectors/charts.d.plugin/charts.d.plugin.in
index 34a5a656e..4e64b7e23 100755
--- a/collectors/charts.d.plugin/charts.d.plugin.in
+++ b/collectors/charts.d.plugin/charts.d.plugin.in
@@ -13,27 +13,115 @@
# each will have a different config file and modules configuration directory.
#
-export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
+export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:@sbindir_POST@"
PROGRAM_FILE="$0"
-PROGRAM_NAME="$(basename $0)"
-PROGRAM_NAME="${PROGRAM_NAME/.plugin/}"
MODULE_NAME="main"
-LOG_LEVEL_ERR=1
-LOG_LEVEL_WARN=2
-LOG_LEVEL_INFO=3
-LOG_LEVEL="$LOG_LEVEL_INFO"
-
-set_log_severity_level() {
- case ${NETDATA_LOG_SEVERITY_LEVEL,,} in
- "info") LOG_LEVEL="$LOG_LEVEL_INFO";;
- "warn" | "warning") LOG_LEVEL="$LOG_LEVEL_WARN";;
- "err" | "error") LOG_LEVEL="$LOG_LEVEL_ERR";;
+# -----------------------------------------------------------------------------
+# logging
+
+PROGRAM_NAME="$(basename "${0}")"
+SHORT_PROGRAM_NAME="${PROGRAM_NAME/.plugin/}"
+
+# these should be the same with syslog() priorities
+NDLP_EMERG=0 # system is unusable
+NDLP_ALERT=1 # action must be taken immediately
+NDLP_CRIT=2 # critical conditions
+NDLP_ERR=3 # error conditions
+NDLP_WARN=4 # warning conditions
+NDLP_NOTICE=5 # normal but significant condition
+NDLP_INFO=6 # informational
+NDLP_DEBUG=7 # debug-level messages
+
+# the max (numerically) log level we will log
+LOG_LEVEL=$NDLP_INFO
+
+set_log_min_priority() {
+ case "${NETDATA_LOG_LEVEL,,}" in
+ "emerg" | "emergency")
+ LOG_LEVEL=$NDLP_EMERG
+ ;;
+
+ "alert")
+ LOG_LEVEL=$NDLP_ALERT
+ ;;
+
+ "crit" | "critical")
+ LOG_LEVEL=$NDLP_CRIT
+ ;;
+
+ "err" | "error")
+ LOG_LEVEL=$NDLP_ERR
+ ;;
+
+ "warn" | "warning")
+ LOG_LEVEL=$NDLP_WARN
+ ;;
+
+ "notice")
+ LOG_LEVEL=$NDLP_NOTICE
+ ;;
+
+ "info")
+ LOG_LEVEL=$NDLP_INFO
+ ;;
+
+ "debug")
+ LOG_LEVEL=$NDLP_DEBUG
+ ;;
esac
}
-set_log_severity_level
+set_log_min_priority
+
+log() {
+ local level="${1}"
+ shift 1
+
+ [[ -n "$level" && -n "$LOG_LEVEL" && "$level" -gt "$LOG_LEVEL" ]] && return
+
+ systemd-cat-native --log-as-netdata --newline="--NEWLINE--" <<EOFLOG
+INVOCATION_ID=${NETDATA_INVOCATION_ID}
+SYSLOG_IDENTIFIER=${PROGRAM_NAME}
+PRIORITY=${level}
+THREAD_TAG=charts.d.plugin
+ND_LOG_SOURCE=collector
+MESSAGE=${MODULE_NAME}: ${*//\\n/--NEWLINE--}
+
+EOFLOG
+ # AN EMPTY LINE IS NEEDED ABOVE
+}
+
+info() {
+ log "$NDLP_INFO" "${@}"
+}
+
+warning() {
+ log "$NDLP_WARN" "${@}"
+}
+
+error() {
+ log "$NDLP_ERR" "${@}"
+}
+
+fatal() {
+ log "$NDLP_ALERT" "${@}"
+ echo "DISABLE"
+ exit 1
+}
+
+debug() {
+ [ "$debug" = "1" ] && log "$NDLP_DEBUG" "${@}"
+}
+
+# -----------------------------------------------------------------------------
+# check for BASH v4+ (required for associative arrays)
+
+if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
+ echo >&2 "BASH version 4 or later is required (this is ${BASH_VERSION})."
+ exit 1
+fi
# -----------------------------------------------------------------------------
# create temp dir
@@ -62,39 +150,6 @@ logdate() {
date "+%Y-%m-%d %H:%M:%S"
}
-log() {
- local status="${1}"
- shift
-
- echo >&2 "$(logdate): ${PROGRAM_NAME}: ${status}: ${MODULE_NAME}: ${*}"
-
-}
-
-info() {
- [[ -n "$LOG_LEVEL" && "$LOG_LEVEL_INFO" -gt "$LOG_LEVEL" ]] && return
- log INFO "${@}"
-}
-
-warning() {
- [[ -n "$LOG_LEVEL" && "$LOG_LEVEL_WARN" -gt "$LOG_LEVEL" ]] && return
- log WARNING "${@}"
-}
-
-error() {
- [[ -n "$LOG_LEVEL" && "$LOG_LEVEL_ERR" -gt "$LOG_LEVEL" ]] && return
- log ERROR "${@}"
-}
-
-fatal() {
- log FATAL "${@}"
- echo "DISABLE"
- exit 1
-}
-
-debug() {
- [ $debug -eq 1 ] && log DEBUG "${@}"
-}
-
# -----------------------------------------------------------------------------
# check a few commands
@@ -137,8 +192,8 @@ info "started from '$PROGRAM_FILE' with options: $*"
[ -z "${NETDATA_STOCK_CONFIG_DIR}" ] && NETDATA_STOCK_CONFIG_DIR="@libconfigdir_POST@"
pluginsd="${NETDATA_PLUGINS_DIR}"
-stockconfd="${NETDATA_STOCK_CONFIG_DIR}/${PROGRAM_NAME}"
-userconfd="${NETDATA_USER_CONFIG_DIR}/${PROGRAM_NAME}"
+stockconfd="${NETDATA_STOCK_CONFIG_DIR}/${SHORT_PROGRAM_NAME}"
+userconfd="${NETDATA_USER_CONFIG_DIR}/${SHORT_PROGRAM_NAME}"
olduserconfd="${NETDATA_USER_CONFIG_DIR}"
chartsd="$pluginsd/../charts.d"
@@ -194,12 +249,14 @@ while [ ! -z "$1" ]; do
if [ "$1" = "debug" -o "$1" = "all" ]; then
debug=1
+ LOG_LEVEL=$NDLP_DEBUG
shift
continue
fi
if [ -f "$chartsd/$1.chart.sh" ]; then
debug=1
+ LOG_LEVEL=$NDLP_DEBUG
chart_only="$(echo $1.chart.sh | sed "s/\.chart\.sh$//g")"
shift
continue
@@ -207,6 +264,7 @@ while [ ! -z "$1" ]; do
if [ -f "$chartsd/$1" ]; then
debug=1
+ LOG_LEVEL=$NDLP_DEBUG
chart_only="$(echo $1 | sed "s/\.chart\.sh$//g")"
shift
continue
@@ -247,7 +305,7 @@ source "$pluginsd/loopsleepms.sh.inc"
# -----------------------------------------------------------------------------
# load my configuration
-for myconfig in "${NETDATA_STOCK_CONFIG_DIR}/${PROGRAM_NAME}.conf" "${NETDATA_USER_CONFIG_DIR}/${PROGRAM_NAME}.conf"; do
+for myconfig in "${NETDATA_STOCK_CONFIG_DIR}/${SHORT_PROGRAM_NAME}.conf" "${NETDATA_USER_CONFIG_DIR}/${SHORT_PROGRAM_NAME}.conf"; do
if [ -f "$myconfig" ]; then
source "$myconfig"
if [ $? -ne 0 ]; then
diff --git a/collectors/charts.d.plugin/libreswan/integrations/libreswan.md b/collectors/charts.d.plugin/libreswan/integrations/libreswan.md
index 6f93a5f4c..bd1eec647 100644
--- a/collectors/charts.d.plugin/libreswan/integrations/libreswan.md
+++ b/collectors/charts.d.plugin/libreswan/integrations/libreswan.md
@@ -4,6 +4,7 @@ meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/charts.d.p
sidebar_label: "Libreswan"
learn_status: "Published"
learn_rel_path: "Data Collection/VPNs"
+most_popular: False
message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
endmeta-->
@@ -132,10 +133,10 @@ The following collapsed table contains all the options that can be configured fo
| Name | Description | Default | Required |
|:----|:-----------|:-------|:--------:|
-| libreswan_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 1 | False |
-| libreswan_priority | The charts priority on the dashboard | 90000 | False |
-| libreswan_retries | The number of retries to do in case of failure before disabling the collector. | 10 | False |
-| libreswan_sudo | Whether to run `ipsec` with `sudo` or not. | 1 | False |
+| libreswan_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 1 | no |
+| libreswan_priority | The charts priority on the dashboard | 90000 | no |
+| libreswan_retries | The number of retries to do in case of failure before disabling the collector. | 10 | no |
+| libreswan_sudo | Whether to run `ipsec` with `sudo` or not. | 1 | no |
</details>
diff --git a/collectors/charts.d.plugin/nut/Makefile.inc b/collectors/charts.d.plugin/nut/Makefile.inc
deleted file mode 100644
index 4fb47145d..000000000
--- a/collectors/charts.d.plugin/nut/Makefile.inc
+++ /dev/null
@@ -1,13 +0,0 @@
-# SPDX-License-Identifier: GPL-3.0-or-later
-
-# THIS IS NOT A COMPLETE Makefile
-# IT IS INCLUDED BY ITS PARENT'S Makefile.am
-# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT
-
-# install these files
-dist_charts_DATA += nut/nut.chart.sh
-dist_chartsconfig_DATA += nut/nut.conf
-
-# do not install these files, but include them in the distribution
-dist_noinst_DATA += nut/README.md nut/Makefile.inc
-
diff --git a/collectors/charts.d.plugin/nut/README.md b/collectors/charts.d.plugin/nut/README.md
deleted file mode 120000
index abfefd6f7..000000000
--- a/collectors/charts.d.plugin/nut/README.md
+++ /dev/null
@@ -1 +0,0 @@
-integrations/network_ups_tools_nut.md \ No newline at end of file
diff --git a/collectors/charts.d.plugin/nut/integrations/network_ups_tools_nut.md b/collectors/charts.d.plugin/nut/integrations/network_ups_tools_nut.md
deleted file mode 100644
index 74be607a1..000000000
--- a/collectors/charts.d.plugin/nut/integrations/network_ups_tools_nut.md
+++ /dev/null
@@ -1,207 +0,0 @@
-<!--startmeta
-custom_edit_url: "https://github.com/netdata/netdata/edit/master/collectors/charts.d.plugin/nut/README.md"
-meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/charts.d.plugin/nut/metadata.yaml"
-sidebar_label: "Network UPS Tools (NUT)"
-learn_status: "Published"
-learn_rel_path: "Data Collection/UPS"
-message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
-endmeta-->
-
-# Network UPS Tools (NUT)
-
-
-<img src="https://netdata.cloud/img/plug-circle-bolt.svg" width="150"/>
-
-
-Plugin: charts.d.plugin
-Module: nut
-
-<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
-
-## Overview
-
-Examine UPS/PDU metrics with Netdata for insights into power device performance. Improve your power device performance with comprehensive dashboards and anomaly detection.
-
-This collector uses the `nut` (Network UPS Tools) to query statistics for multiple UPS devices.
-
-This collector is supported on all platforms.
-
-This collector supports collecting metrics from multiple instances of this integration, including remote instances.
-
-
-### Default Behavior
-
-#### Auto-Detection
-
-This integration doesn't support auto-detection.
-
-#### Limits
-
-The default configuration for this integration does not impose any limits on data collection.
-
-#### Performance Impact
-
-The default configuration for this integration is not expected to impose a significant performance impact on the system.
-
-
-## Metrics
-
-Metrics grouped by *scope*.
-
-The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
-
-
-
-### Per ups
-
-Metrics related to UPS. Each UPS provides its own set of the following metrics.
-
-This scope has no labels.
-
-Metrics:
-
-| Metric | Dimensions | Unit |
-|:------|:----------|:----|
-| nut.charge | charge | percentage |
-| nut.runtime | runtime | seconds |
-| nut.battery.voltage | voltage, high, low, nominal | Volts |
-| nut.input.voltage | voltage, fault, nominal | Volts |
-| nut.input.current | nominal | Ampere |
-| nut.input.frequency | frequency, nominal | Hz |
-| nut.output.voltage | voltage | Volts |
-| nut.load | load | percentage |
-| nut.load_usage | load_usage | Watts |
-| nut.temperature | temp | temperature |
-| nut.clients | clients | clients |
-
-
-
-## Alerts
-
-
-The following alerts are available:
-
-| Alert name | On metric | Description |
-|:------------|:----------|:------------|
-| [ nut_ups_charge ](https://github.com/netdata/netdata/blob/master/health/health.d/nut.conf) | nut.charge | average UPS charge over the last minute |
-| [ 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 |
-| [ 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 |
-
-
-## Setup
-
-### Prerequisites
-
-#### Install charts.d plugin
-
-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.
-
-
-#### Required software
-
-Make sure the Network UPS Tools (`nut`) is installed and can detect your UPS devices.
-
-
-### Configuration
-
-#### File
-
-The configuration file name for this integration is `charts.d/nut.conf`.
-
-
-You can edit the configuration file using the `edit-config` script from the
-Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory).
-
-```bash
-cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
-sudo ./edit-config charts.d/nut.conf
-```
-#### Options
-
-The config file is sourced by the charts.d plugin. It's a standard bash file.
-
-The following collapsed table contains all the options that can be configured for the nut collector.
-
-
-<details><summary>Config options</summary>
-
-| Name | Description | Default | Required |
-|:----|:-----------|:-------|:--------:|
-| nut_ups | A space separated list of UPS names. If empty, the list returned by `upsc -l` will be used. | | False |
-| nut_names | Each line represents an alias for one UPS. If empty, the FQDN will be used. | | False |
-| nut_timeout | How long to wait for nut to respond. | 2 | False |
-| nut_clients_chart | Set this to 1 to enable another chart showing the number of UPS clients connected to `upsd`. | 1 | False |
-| nut_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 2 | False |
-| nut_priority | The charts priority on the dashboard | 90000 | False |
-| nut_retries | The number of retries to do in case of failure before disabling the collector. | 10 | False |
-
-</details>
-
-#### Examples
-
-##### Provide names to UPS devices
-
-Map aliases to UPS devices
-
-<details><summary>Config</summary>
-
-```yaml
-# a space separated list of UPS names
-# if empty, the list returned by 'upsc -l' will be used
-#nut_ups=
-
-# each line represents an alias for one UPS
-# if empty, the FQDN will be used
-nut_names["XXXXXX"]="UPS-office"
-nut_names["YYYYYY"]="UPS-rack"
-
-# how much time in seconds, to wait for nut to respond
-#nut_timeout=2
-
-# set this to 1, to enable another chart showing the number
-# of UPS clients connected to upsd
-#nut_clients_chart=1
-
-# the data collection frequency
-# if unset, will inherit the netdata update frequency
-#nut_update_every=2
-
-# the charts priority on the dashboard
-#nut_priority=90000
-
-# the number of retries to do in case of failure
-# before disabling the module
-#nut_retries=10
-
-```
-</details>
-
-
-
-## Troubleshooting
-
-### Debug Mode
-
-To troubleshoot issues with the `nut` collector, run the `charts.d.plugin` with the debug option enabled. The output
-should give you clues as to why the collector isn't working.
-
-- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
- your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
-
- ```bash
- cd /usr/libexec/netdata/plugins.d/
- ```
-
-- Switch to the `netdata` user.
-
- ```bash
- sudo -u netdata -s
- ```
-
-- Run the `charts.d.plugin` to debug the collector:
-
- ```bash
- ./charts.d.plugin debug 1 nut
- ```
-
-
diff --git a/collectors/charts.d.plugin/nut/metadata.yaml b/collectors/charts.d.plugin/nut/metadata.yaml
deleted file mode 100644
index ed3ffebf7..000000000
--- a/collectors/charts.d.plugin/nut/metadata.yaml
+++ /dev/null
@@ -1,222 +0,0 @@
-plugin_name: charts.d.plugin
-modules:
- - meta:
- plugin_name: charts.d.plugin
- module_name: nut
- monitored_instance:
- name: Network UPS Tools (NUT)
- link: ''
- categories:
- - data-collection.ups
- icon_filename: 'plug-circle-bolt.svg'
- related_resources:
- integrations:
- list: []
- info_provided_to_referring_integrations:
- description: ''
- keywords:
- - nut
- - network ups tools
- - ups
- - pdu
- most_popular: false
- overview:
- data_collection:
- 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.'
- method_description: 'This collector uses the `nut` (Network UPS Tools) to query statistics for multiple UPS devices.'
- supported_platforms:
- include: []
- exclude: []
- multi_instance: true
- additional_permissions:
- description: ''
- default_behavior:
- auto_detection:
- description: ''
- limits:
- description: ''
- performance_impact:
- description: ''
- setup:
- prerequisites:
- list:
- - title: "Install charts.d plugin"
- description: |
- 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.
- - title: "Required software"
- description: "Make sure the Network UPS Tools (`nut`) is installed and can detect your UPS devices."
- configuration:
- file:
- name: charts.d/nut.conf
- options:
- description: |
- The config file is sourced by the charts.d plugin. It's a standard bash file.
-
- The following collapsed table contains all the options that can be configured for the nut collector.
- folding:
- title: "Config options"
- enabled: true
- list:
- - name: nut_ups
- description: A space separated list of UPS names. If empty, the list returned by `upsc -l` will be used.
- default_value: ""
- required: false
- - name: nut_names
- description: Each line represents an alias for one UPS. If empty, the FQDN will be used.
- default_value: ""
- required: false
- - name: nut_timeout
- description: How long to wait for nut to respond.
- default_value: 2
- required: false
- - name: nut_clients_chart
- description: Set this to 1 to enable another chart showing the number of UPS clients connected to `upsd`.
- default_value: 1
- required: false
- - name: nut_update_every
- description: The data collection frequency. If unset, will inherit the netdata update frequency.
- default_value: 2
- required: false
- - name: nut_priority
- description: The charts priority on the dashboard
- default_value: 90000
- required: false
- - name: nut_retries
- description: The number of retries to do in case of failure before disabling the collector.
- default_value: 10
- required: false
- examples:
- folding:
- enabled: true
- title: "Config"
- list:
- - name: Provide names to UPS devices
- description: Map aliases to UPS devices
- config: |
- # a space separated list of UPS names
- # if empty, the list returned by 'upsc -l' will be used
- #nut_ups=
-
- # each line represents an alias for one UPS
- # if empty, the FQDN will be used
- nut_names["XXXXXX"]="UPS-office"
- nut_names["YYYYYY"]="UPS-rack"
-
- # how much time in seconds, to wait for nut to respond
- #nut_timeout=2
-
- # set this to 1, to enable another chart showing the number
- # of UPS clients connected to upsd
- #nut_clients_chart=1
-
- # the data collection frequency
- # if unset, will inherit the netdata update frequency
- #nut_update_every=2
-
- # the charts priority on the dashboard
- #nut_priority=90000
-
- # the number of retries to do in case of failure
- # before disabling the module
- #nut_retries=10
- troubleshooting:
- problems:
- list: []
- alerts:
- - name: nut_ups_charge
- link: https://github.com/netdata/netdata/blob/master/health/health.d/nut.conf
- metric: nut.charge
- info: average UPS charge over the last minute
- os: "*"
- - name: nut_10min_ups_load
- link: https://github.com/netdata/netdata/blob/master/health/health.d/nut.conf
- metric: nut.load
- info: average UPS load over the last 10 minutes
- os: "*"
- - name: nut_last_collected_secs
- link: https://github.com/netdata/netdata/blob/master/health/health.d/nut.conf
- metric: nut.load
- info: number of seconds since the last successful data collection
- metrics:
- folding:
- title: Metrics
- enabled: false
- description: ""
- availability: []
- scopes:
- - name: ups
- description: "Metrics related to UPS. Each UPS provides its own set of the following metrics."
- labels: []
- metrics:
- - name: nut.charge
- description: UPS Charge
- unit: "percentage"
- chart_type: area
- dimensions:
- - name: charge
- - name: nut.runtime
- description: UPS Runtime
- unit: "seconds"
- chart_type: line
- dimensions:
- - name: runtime
- - name: nut.battery.voltage
- description: UPS Battery Voltage
- unit: "Volts"
- chart_type: line
- dimensions:
- - name: voltage
- - name: high
- - name: low
- - name: nominal
- - name: nut.input.voltage
- description: UPS Input Voltage
- unit: "Volts"
- chart_type: line
- dimensions:
- - name: voltage
- - name: fault
- - name: nominal
- - name: nut.input.current
- description: UPS Input Current
- unit: "Ampere"
- chart_type: line
- dimensions:
- - name: nominal
- - name: nut.input.frequency
- description: UPS Input Frequency
- unit: "Hz"
- chart_type: line
- dimensions:
- - name: frequency
- - name: nominal
- - name: nut.output.voltage
- description: UPS Output Voltage
- unit: "Volts"
- chart_type: line
- dimensions:
- - name: voltage
- - name: nut.load
- description: UPS Load
- unit: "percentage"
- chart_type: area
- dimensions:
- - name: load
- - name: nut.load_usage
- description: UPS Load Usage
- unit: "Watts"
- chart_type: area
- dimensions:
- - name: load_usage
- - name: nut.temperature
- description: UPS Temperature
- unit: "temperature"
- chart_type: line
- dimensions:
- - name: temp
- - name: nut.clients
- description: UPS Connected Clients
- unit: "clients"
- chart_type: area
- dimensions:
- - name: clients
diff --git a/collectors/charts.d.plugin/nut/nut.chart.sh b/collectors/charts.d.plugin/nut/nut.chart.sh
deleted file mode 100644
index 7c32b6dde..000000000
--- a/collectors/charts.d.plugin/nut/nut.chart.sh
+++ /dev/null
@@ -1,244 +0,0 @@
-# shellcheck shell=bash
-# no need for shebang - this file is loaded from charts.d.plugin
-# SPDX-License-Identifier: GPL-3.0-or-later
-
-# netdata
-# real-time performance and health monitoring, done right!
-# (C) 2016-2017 Costa Tsaousis <costa@tsaousis.gr>
-#
-
-# a space separated list of UPS names
-# if empty, the list returned by 'upsc -l' will be used
-nut_ups=
-
-# how frequently to collect UPS data
-nut_update_every=2
-
-# how much time in seconds, to wait for nut to respond
-nut_timeout=2
-
-# set this to 1, to enable another chart showing the number
-# of UPS clients connected to upsd
-nut_clients_chart=0
-
-# the priority of nut related to other charts
-nut_priority=90000
-
-declare -A nut_ids=()
-declare -A nut_names=()
-
-nut_get_all() {
- run -t $nut_timeout upsc -l
-}
-
-nut_get() {
- run -t $nut_timeout upsc "$1"
-
- if [ "${nut_clients_chart}" -eq "1" ]; then
- printf "ups.connected_clients: "
- run -t $nut_timeout upsc -c "$1" | wc -l
- fi
-}
-
-nut_check() {
-
- # this should return:
- # - 0 to enable the chart
- # - 1 to disable the chart
-
- local x
-
- require_cmd upsc || return 1
-
- [ -z "$nut_ups" ] && nut_ups="$(nut_get_all)"
-
- for x in $nut_ups; do
- nut_get "$x" > /dev/null
- # shellcheck disable=SC2181
- if [ $? -eq 0 ]; then
- if [ -n "${nut_names[${x}]}" ]; then
- nut_ids[$x]="$(fixid "${nut_names[${x}]}")"
- else
- nut_ids[$x]="$(fixid "$x")"
- fi
- continue
- fi
- error "cannot get information for NUT UPS '$x'."
- done
-
- if [ ${#nut_ids[@]} -eq 0 ]; then
- # shellcheck disable=SC2154
- error "Cannot find UPSes - please set nut_ups='ups_name' in $confd/nut.conf"
- return 1
- fi
-
- return 0
-}
-
-nut_create() {
- # create the charts
- local x
-
- for x in "${nut_ids[@]}"; do
- cat << EOF
-CHART nut_$x.charge '' "UPS Charge" "percentage" ups nut.charge area $((nut_priority + 2)) $nut_update_every
-DIMENSION battery_charge charge absolute 1 100
-
-CHART nut_$x.runtime '' "UPS Runtime" "seconds" ups nut.runtime area $((nut_priority + 3)) $nut_update_every
-DIMENSION battery_runtime runtime absolute 1 100
-
-CHART nut_$x.battery_voltage '' "UPS Battery Voltage" "Volts" ups nut.battery.voltage line $((nut_priority + 4)) $nut_update_every
-DIMENSION battery_voltage voltage absolute 1 100
-DIMENSION battery_voltage_high high absolute 1 100
-DIMENSION battery_voltage_low low absolute 1 100
-DIMENSION battery_voltage_nominal nominal absolute 1 100
-
-CHART nut_$x.input_voltage '' "UPS Input Voltage" "Volts" input nut.input.voltage line $((nut_priority + 5)) $nut_update_every
-DIMENSION input_voltage voltage absolute 1 100
-DIMENSION input_voltage_fault fault absolute 1 100
-DIMENSION input_voltage_nominal nominal absolute 1 100
-
-CHART nut_$x.input_current '' "UPS Input Current" "Ampere" input nut.input.current line $((nut_priority + 6)) $nut_update_every
-DIMENSION input_current_nominal nominal absolute 1 100
-
-CHART nut_$x.input_frequency '' "UPS Input Frequency" "Hz" input nut.input.frequency line $((nut_priority + 7)) $nut_update_every
-DIMENSION input_frequency frequency absolute 1 100
-DIMENSION input_frequency_nominal nominal absolute 1 100
-
-CHART nut_$x.output_voltage '' "UPS Output Voltage" "Volts" output nut.output.voltage line $((nut_priority + 8)) $nut_update_every
-DIMENSION output_voltage voltage absolute 1 100
-
-CHART nut_$x.load '' "UPS Load" "percentage" ups nut.load area $((nut_priority)) $nut_update_every
-DIMENSION load load absolute 1 100
-
-CHART nut_$x.load_usage '' "UPS Load Usage" "Watts" ups nut.load_usage area $((nut_priority + 1)) $nut_update_every
-DIMENSION load_usage load_usage absolute 1 100
-
-CHART nut_$x.temp '' "UPS Temperature" "temperature" ups nut.temperature line $((nut_priority + 9)) $nut_update_every
-DIMENSION temp temp absolute 1 100
-EOF
-
- if [ "${nut_clients_chart}" = "1" ]; then
- cat << EOF2
-CHART nut_$x.clients '' "UPS Connected Clients" "clients" ups nut.clients area $((nut_priority + 10)) $nut_update_every
-DIMENSION clients '' absolute 1 1
-EOF2
- fi
-
- done
-
- return 0
-}
-
-nut_update() {
- # the first argument to this function is the microseconds since last update
- # pass this parameter to the BEGIN statement (see below).
-
- # do all the work to collect / calculate the values
- # for each dimension
- # remember: KEEP IT SIMPLE AND SHORT
-
- local i x
- for i in "${!nut_ids[@]}"; do
- x="${nut_ids[$i]}"
- nut_get "$i" | awk "
-BEGIN {
- battery_charge = 0;
- battery_runtime = 0;
- battery_voltage = 0;
- battery_voltage_high = 0;
- battery_voltage_low = 0;
- battery_voltage_nominal = 0;
- input_voltage = 0;
- input_voltage_fault = 0;
- input_voltage_nominal = 0;
- input_current_nominal = 0;
- input_frequency = 0;
- input_frequency_nominal = 0;
- output_voltage = 0;
- load = 0;
- load_usage = 0;
- nompower = 0;
- temp = 0;
- client = 0;
- do_clients = ${nut_clients_chart};
-}
-/^battery.charge: .*/ { battery_charge = \$2 * 100 };
-/^battery.runtime: .*/ { battery_runtime = \$2 * 100 };
-/^battery.voltage: .*/ { battery_voltage = \$2 * 100 };
-/^battery.voltage.high: .*/ { battery_voltage_high = \$2 * 100 };
-/^battery.voltage.low: .*/ { battery_voltage_low = \$2 * 100 };
-/^battery.voltage.nominal: .*/ { battery_voltage_nominal = \$2 * 100 };
-/^input.voltage: .*/ { input_voltage = \$2 * 100 };
-/^input.voltage.fault: .*/ { input_voltage_fault = \$2 * 100 };
-/^input.voltage.nominal: .*/ { input_voltage_nominal = \$2 * 100 };
-/^input.current.nominal: .*/ { input_current_nominal = \$2 * 100 };
-/^input.frequency: .*/ { input_frequency = \$2 * 100 };
-/^input.frequency.nominal: .*/ { input_frequency_nominal = \$2 * 100 };
-/^output.voltage: .*/ { output_voltage = \$2 * 100 };
-/^ups.load: .*/ { load = \$2 * 100 };
-/^ups.realpower.nominal: .*/ { nompower = \$2 };
-/^ups.temperature: .*/ { temp = \$2 * 100 };
-/^ups.connected_clients: .*/ { clients = \$2 };
-END {
- { load_usage = nompower * load / 100 };
-
- print \"BEGIN nut_$x.charge $1\";
- print \"SET battery_charge = \" battery_charge;
- print \"END\"
-
- print \"BEGIN nut_$x.runtime $1\";
- print \"SET battery_runtime = \" battery_runtime;
- print \"END\"
-
- print \"BEGIN nut_$x.battery_voltage $1\";
- print \"SET battery_voltage = \" battery_voltage;
- print \"SET battery_voltage_high = \" battery_voltage_high;
- print \"SET battery_voltage_low = \" battery_voltage_low;
- print \"SET battery_voltage_nominal = \" battery_voltage_nominal;
- print \"END\"
-
- print \"BEGIN nut_$x.input_voltage $1\";
- print \"SET input_voltage = \" input_voltage;
- print \"SET input_voltage_fault = \" input_voltage_fault;
- print \"SET input_voltage_nominal = \" input_voltage_nominal;
- print \"END\"
-
- print \"BEGIN nut_$x.input_current $1\";
- print \"SET input_current_nominal = \" input_current_nominal;
- print \"END\"
-
- print \"BEGIN nut_$x.input_frequency $1\";
- print \"SET input_frequency = \" input_frequency;
- print \"SET input_frequency_nominal = \" input_frequency_nominal;
- print \"END\"
-
- print \"BEGIN nut_$x.output_voltage $1\";
- print \"SET output_voltage = \" output_voltage;
- print \"END\"
-
- print \"BEGIN nut_$x.load $1\";
- print \"SET load = \" load;
- print \"END\"
-
- print \"BEGIN nut_$x.load_usage $1\";
- print \"SET load_usage = \" load_usage;
- print \"END\"
-
- print \"BEGIN nut_$x.temp $1\";
- print \"SET temp = \" temp;
- print \"END\"
-
- if(do_clients) {
- print \"BEGIN nut_$x.clients $1\";
- print \"SET clients = \" clients;
- print \"END\"
- }
-}"
- # shellcheck disable=2181
- [ $? -ne 0 ] && unset "nut_ids[$i]" && error "failed to get values for '$i', disabling it."
- done
-
- [ ${#nut_ids[@]} -eq 0 ] && error "no UPSes left active." && return 1
- return 0
-}
diff --git a/collectors/charts.d.plugin/nut/nut.conf b/collectors/charts.d.plugin/nut/nut.conf
deleted file mode 100644
index b95ad9048..000000000
--- a/collectors/charts.d.plugin/nut/nut.conf
+++ /dev/null
@@ -1,33 +0,0 @@
-# no need for shebang - this file is loaded from charts.d.plugin
-
-# netdata
-# real-time performance and health monitoring, done right!
-# (C) 2018 Costa Tsaousis <costa@tsaousis.gr>
-# GPL v3+
-
-# a space separated list of UPS names
-# if empty, the list returned by 'upsc -l' will be used
-#nut_ups=
-
-# each line represents an alias for one UPS
-# if empty, the FQDN will be used
-#nut_names["FQDN1"]="alias"
-#nut_names["FQDN2"]="alias"
-
-# how much time in seconds, to wait for nut to respond
-#nut_timeout=2
-
-# set this to 1, to enable another chart showing the number
-# of UPS clients connected to upsd
-#nut_clients_chart=1
-
-# the data collection frequency
-# if unset, will inherit the netdata update frequency
-#nut_update_every=2
-
-# the charts priority on the dashboard
-#nut_priority=90000
-
-# the number of retries to do in case of failure
-# before disabling the module
-#nut_retries=10
diff --git a/collectors/charts.d.plugin/opensips/integrations/opensips.md b/collectors/charts.d.plugin/opensips/integrations/opensips.md
index 96abc3325..8c88dba0b 100644
--- a/collectors/charts.d.plugin/opensips/integrations/opensips.md
+++ b/collectors/charts.d.plugin/opensips/integrations/opensips.md
@@ -4,6 +4,7 @@ meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/charts.d.p
sidebar_label: "OpenSIPS"
learn_status: "Published"
learn_rel_path: "Data Collection/Telephony Servers"
+most_popular: False
message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
endmeta-->
@@ -128,12 +129,12 @@ The following collapsed table contains all the options that can be configured fo
| Name | Description | Default | Required |
|:----|:-----------|:-------|:--------:|
-| opensips_opts | Specify parameters to the `opensipsctl` command. If the default value fails to get global status, set here whatever options are needed to connect to the opensips server. | fifo get_statistics all | False |
-| opensips_cmd | If `opensipsctl` is not in $PATH, specify it's full path here. | | False |
-| opensips_timeout | How long to wait for `opensipsctl` to respond. | 2 | False |
-| opensips_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 5 | False |
-| opensips_priority | The charts priority on the dashboard. | 80000 | False |
-| opensips_retries | The number of retries to do in case of failure before disabling the collector. | 10 | False |
+| opensips_opts | Specify parameters to the `opensipsctl` command. If the default value fails to get global status, set here whatever options are needed to connect to the opensips server. | fifo get_statistics all | no |
+| opensips_cmd | If `opensipsctl` is not in $PATH, specify it's full path here. | | no |
+| opensips_timeout | How long to wait for `opensipsctl` to respond. | 2 | no |
+| opensips_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 5 | no |
+| opensips_priority | The charts priority on the dashboard. | 80000 | no |
+| opensips_retries | The number of retries to do in case of failure before disabling the collector. | 10 | no |
</details>
diff --git a/collectors/charts.d.plugin/sensors/integrations/linux_sensors_sysfs.md b/collectors/charts.d.plugin/sensors/integrations/linux_sensors_sysfs.md
index e0ce74d06..130352f61 100644
--- a/collectors/charts.d.plugin/sensors/integrations/linux_sensors_sysfs.md
+++ b/collectors/charts.d.plugin/sensors/integrations/linux_sensors_sysfs.md
@@ -4,6 +4,7 @@ meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/charts.d.p
sidebar_label: "Linux Sensors (sysfs)"
learn_status: "Published"
learn_rel_path: "Data Collection/Hardware Devices and Sensors"
+most_popular: False
message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
endmeta-->
@@ -130,12 +131,12 @@ The following collapsed table contains all the options that can be configured fo
| Name | Description | Default | Required |
|:----|:-----------|:-------|:--------:|
-| sensors_sys_dir | The directory the kernel exposes sensor data. | /sys/devices | False |
-| sensors_sys_depth | How deep in the tree to check for sensor data. | 10 | False |
-| sensors_source_update | If set to 1, the script will overwrite internal script functions with code generated ones. | 1 | False |
-| sensors_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 1 | False |
-| sensors_priority | The charts priority on the dashboard. | 90000 | False |
-| sensors_retries | The number of retries to do in case of failure before disabling the collector. | 10 | False |
+| sensors_sys_dir | The directory the kernel exposes sensor data. | /sys/devices | no |
+| sensors_sys_depth | How deep in the tree to check for sensor data. | 10 | no |
+| sensors_source_update | If set to 1, the script will overwrite internal script functions with code generated ones. | 1 | no |
+| sensors_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 1 | no |
+| sensors_priority | The charts priority on the dashboard. | 90000 | no |
+| sensors_retries | The number of retries to do in case of failure before disabling the collector. | 10 | no |
</details>