summaryrefslogtreecommitdiffstats
path: root/core/modules/hardware-stats
diff options
context:
space:
mode:
authorSimon Rettberg2020-09-23 12:09:06 +0200
committerSimon Rettberg2020-09-23 12:09:06 +0200
commitf45c52690483e02dcd6dfe60eec67ef578e50986 (patch)
treef908a5606f60ed9886039049cb6d94e534abe1ef /core/modules/hardware-stats
parent[run-virt] fix math (diff)
downloadmltk-f45c52690483e02dcd6dfe60eec67ef578e50986.tar.gz
mltk-f45c52690483e02dcd6dfe60eec67ef578e50986.tar.xz
mltk-f45c52690483e02dcd6dfe60eec67ef578e50986.zip
[hardware-stats] Fix awk output format for numbers > 2^31
Diffstat (limited to 'core/modules/hardware-stats')
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update2
1 files changed, 1 insertions, 1 deletions
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 08338808..5b8362e8 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
@@ -45,7 +45,7 @@ fi
# CPU temp and load
set --
if $full; then
- current="$( awk '$1 == "cpu" {print ($5+$6) " " ($2+$3+$4+$5+$6+$7+$8)}' /proc/stat )"
+ current="$( awk '$1 == "cpu" {printf "%.0f %.0f", ($5+$6), ($2+$3+$4+$5+$6+$7+$8)}' /proc/stat )"
c_count=${current#* }
write=false
if [ -s "/run/openslx/usage.state" ]; then