X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=charts.d%2Fnut.chart.sh;h=6137639f982621277caa6fe21fce46133ef400eb;hb=8a870a65d0afc49455b4b5ff2b0ce585e0bd8339;hp=e0b1b4cf981bedbb6e0a8de8c59cecb414d1c77d;hpb=0b006a56cf575d7fdb05fb2614db8411a1542ca7;p=netdata.git diff --git a/charts.d/nut.chart.sh b/charts.d/nut.chart.sh old mode 100755 new mode 100644 index e0b1b4cf..6137639f --- 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 <