From bed7e5b6a0b9ea0ddfc76c6f77eb91df81b92521 Mon Sep 17 00:00:00 2001 From: Federico Ceratto Date: Sun, 30 Apr 2017 17:09:37 +0100 Subject: New upstream version 1.6.0+dfsg --- charts.d/nut.chart.sh | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) mode change 100755 => 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 old mode 100755 new mode 100644 index e0b1b4cf9..6137639f9 --- a/charts.d/nut.chart.sh +++ b/charts.d/nut.chart.sh @@ -2,7 +2,7 @@ # netdata # real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis +# (C) 2016-2017 Costa Tsaousis # GPL v3+ # @@ -13,8 +13,13 @@ 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 @@ -26,6 +31,12 @@ nut_get_all() { 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() { @@ -97,6 +108,15 @@ DIMENSION load load absolute 1 100 CHART nut_$x.temp '' "UPS Temperature" "temperature" ups nut.temperature line $((nut_priority + 7)) $nut_update_every DIMENSION temp temp absolute 1 100 EOF + + if [ "${nut_clients_chart}" = "1" ] + then + cat <