diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2022-03-03 14:41:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-03 14:41:35 +0200 |
commit | c86664092e710f173d91750c21f7846a6dbdbedd (patch) | |
tree | d1d5928c96e7f6ce31e72f787c7e05259159f034 /daemon/system-info.sh | |
parent | 0d0e5ab9011b83a9e0ba5c81706c9769e367b9eb (diff) |
fix: CPU frequency detection for some containers (#12306)
Diffstat (limited to 'daemon/system-info.sh')
-rwxr-xr-x | daemon/system-info.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/daemon/system-info.sh b/daemon/system-info.sh index 0e88bb08d5..f3236e892f 100755 --- a/daemon/system-info.sh +++ b/daemon/system-info.sh @@ -200,6 +200,9 @@ if [ -n "${lscpu}" ] && lscpu > /dev/null 2>&1; then if [ "${possible_cpu_freq}" = " MHz" ]; then possible_cpu_freq="$(echo "${lscpu_output}" | grep -F "CPU MHz:" | cut -f 2 -d ':' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | grep -o '^[0-9]*') MHz" fi + if [ "${possible_cpu_freq}" = " MHz" ]; then + possible_cpu_freq="$(echo "${lscpu_output}" | grep "^Model name:" | grep -Eo "[0-9\.]+GHz" | grep -o "^[0-9\.]*" | awk '{print int($0*1000)}') MHz" + fi elif [ -n "${dmidecode}" ] && dmidecode -t processor > /dev/null 2>&1; then dmidecode_output="$(${dmidecode} -t processor 2> /dev/null)" CPU_INFO_SOURCE="dmidecode" |