From 4f64ad32c4b61155e0dee196d39a638f4e9819f1 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 30 Apr 2020 17:27:17 +0200 Subject: [hardware-stats] ... --- .../hardware-stats/data/opt/openslx/scripts/cron-system_usage_update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/modules/hardware-stats') diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update b/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update index c162fec4..64bd7729 100755 --- a/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update +++ b/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update @@ -58,7 +58,7 @@ if $full; then # sloppy way to prevent rapid updates; counter speed varies depending on HZ and core count if [ "$(( c_count - l_count ))" -gt 12000 ]; then write=true - set -- "$@" "--data-urlencode" "cputemp=$( echo "$current $old" | awk '{ print (100 - ($1 - $3)/($2 - $4) * 100) }' )" + set -- "$@" "--data-urlencode" "cpuload=$( echo "$current $old" | awk '{ print (100 - ($1 - $3)/($2 - $4) * 100) }' )" fi else write=true @@ -69,7 +69,7 @@ if $full; then if command -v sensors > /dev/null; then # TODO JSON support arrived recently, port after base system is updated from 18.04 # Try to get the package id reading, use core temps as fallback - set -- "$@" "--data-urlencode" "cpuload=$( sensors | tr 'A-Z' 'a-z' \ + set -- "$@" "--data-urlencode" "cputemp=$( sensors | tr 'A-Z' 'a-z' \ | awk 'BEGIN{p=0;pc=0;c=0;cc=0} {if ($1 == "package" && substr($4, 1, 1) == "+") {gsub("[^0-9.]", "", $4); p += $4; pc++} if ($1 ~ /^core/ && substr($3, 1, 1) == "+") {gsub("[^0-9.]", "", $3); c += $3; cc++} } END{if (pc > 0) print (p / pc); else if (cc > 0) print (c / cc);}' )" fi fi -- cgit v1.2.3-55-g7522