From 1e6c93250172946eeb38e94a92a1fd12c9d3011e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 7 Nov 2018 13:22:44 +0100 Subject: Merging upstream version 1.11.0+dfsg. Signed-off-by: Daniel Baumann --- charts.d/nut.chart.sh | 222 -------------------------------------------------- 1 file changed, 222 deletions(-) delete mode 100644 charts.d/nut.chart.sh (limited to 'charts.d/nut.chart.sh') diff --git a/charts.d/nut.chart.sh b/charts.d/nut.chart.sh deleted file mode 100644 index 6137639f9..000000000 --- a/charts.d/nut.chart.sh +++ /dev/null @@ -1,222 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016-2017 Costa Tsaousis -# GPL v3+ -# - -# 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=() - -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 - if [ $? -eq 0 ] - then - nut_ids[$x]="$( fixid "$x" )" - continue - fi - error "cannot get information for NUT UPS '$x'." - done - - if [ ${#nut_ids[@]} -eq 0 ] - then - 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 <