@cryptotaxi247 / netdata-1 / commits / c86664092

fix: CPU frequency detection for some containers (#12306)

Ilya Mashchenko committed Mar 3, 2022 at 14:41 UTC c86664092e710f173d91750c21f7846a6dbdbedd
1 file changed +3
daemon/system-info.sh
+3
@@ -200,6 +200,9 @@ if [ -n "${lscpu}" ] && lscpu > /dev/null 2>&1; then
200 if [ "${possible_cpu_freq}" = " MHz" ]; then
201 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"
202 fi
203 + if [ "${possible_cpu_freq}" = " MHz" ]; then
204 + possible_cpu_freq="$(echo "${lscpu_output}" | grep "^Model name:" | grep -Eo "[0-9\.]+GHz" | grep -o "^[0-9\.]*" | awk '{print int($0*1000)}') MHz"
205 + fi
206 elif [ -n "${dmidecode}" ] && dmidecode -t processor > /dev/null 2>&1; then
207 dmidecode_output="$(${dmidecode} -t processor 2> /dev/null)"
208 CPU_INFO_SOURCE="dmidecode"