From a64a253794ac64cb40befee54db53bde17dd0d49 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 7 Nov 2018 13:19:29 +0100 Subject: New upstream version 1.11.0+dfsg Signed-off-by: Daniel Baumann --- charts.d/apcupsd.chart.sh | 198 ---------------------------------------------- 1 file changed, 198 deletions(-) delete mode 100644 charts.d/apcupsd.chart.sh (limited to 'charts.d/apcupsd.chart.sh') diff --git a/charts.d/apcupsd.chart.sh b/charts.d/apcupsd.chart.sh deleted file mode 100644 index 9878fd36c..000000000 --- a/charts.d/apcupsd.chart.sh +++ /dev/null @@ -1,198 +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 Costa Tsaousis -# GPL v3+ -# - -apcupsd_ip= -apcupsd_port= - -declare -A apcupsd_sources=( - ["local"]="127.0.0.1:3551" -) - -# how frequently to collect UPS data -apcupsd_update_every=10 - -apcupsd_timeout=3 - -# the priority of apcupsd related to other charts -apcupsd_priority=90000 - -apcupsd_get() { - run -t $apcupsd_timeout apcaccess status "$1" -} - -apcupsd_check() { - - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - require_cmd apcaccess || return 1 - - # backwards compatibility - if [ "${apcupsd_ip}:${apcupsd_port}" != ":" ] - then - apcupsd_sources["local"]="${apcupsd_ip}:${apcupsd_port}" - fi - - local host working=0 failed=0 - for host in "${!apcupsd_sources[@]}" - do - run apcupsd_get "${apcupsd_sources[${host}]}" >/dev/null - if [ $? -ne 0 ] - then - error "cannot get information for apcupsd server ${host} on ${apcupsd_sources[${host}]}." - failed=$((failed + 1)) - elif [ $(apcupsd_get "${apcupsd_sources[${host}]}" | awk '/^STATUS.*/{ print $3 }') != "ONLINE" ] - then - error "APC UPS ${host} on ${apcupsd_sources[${host}]} is not online." - failed=$((failed + 1)) - else - working=$((working + 1)) - fi - done - - if [ ${working} -eq 0 ] - then - error "No APC UPSes found available." - return 1 - fi - - return 0 -} - -apcupsd_create() { - local host src - for host in "${!apcupsd_sources[@]}" - do - src=${apcupsd_sources[${host}]} - - # create the charts - cat <