summaryrefslogtreecommitdiffstats
path: root/daemon/system-info.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-08-12 07:26:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-08-12 07:26:11 +0000
commit3c315f0fff93aa072472abc10815963ac0035268 (patch)
treea95f6a96e0e7bd139c010f8dc60b40e5b3062a99 /daemon/system-info.sh
parentAdding upstream version 1.35.1. (diff)
downloadnetdata-3c315f0fff93aa072472abc10815963ac0035268.tar.xz
netdata-3c315f0fff93aa072472abc10815963ac0035268.zip
Adding upstream version 1.36.0.upstream/1.36.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xdaemon/system-info.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/daemon/system-info.sh b/daemon/system-info.sh
index 12553e3da..101ccb0bf 100755
--- a/daemon/system-info.sh
+++ b/daemon/system-info.sh
@@ -44,9 +44,11 @@ if [ -z "${VIRTUALIZATION}" ]; then
[ -n "$VIRTUALIZATION" ] && VIRT_DETECTION="dmidecode"
fi
- if [ -z "${VIRTUALIZATION}" ] && [ "${KERNEL_NAME}" = "FreeBSD" ]; then
- VIRTUALIZATION=$(sysctl kern.vm_guest 2>/dev/null | cut -d: -f 2 | awk '{$1=$1};1')
- [ -n "$VIRTUALIZATION" ] && VIRT_DETECTION="sysctl"
+ if [ -z "${VIRTUALIZATION}" ] || [ "$VIRTUALIZATION" = "unknown" ]; then
+ if [ "${KERNEL_NAME}" = "FreeBSD" ]; then
+ VIRTUALIZATION=$(sysctl kern.vm_guest 2>/dev/null | cut -d: -f 2 | awk '{$1=$1};1')
+ [ -n "$VIRTUALIZATION" ] && VIRT_DETECTION="sysctl"
+ fi
fi
if [ -z "${VIRTUALIZATION}" ]; then
@@ -336,7 +338,7 @@ if [ "${KERNEL_NAME}" = FreeBSD ]; then
TOTAL_RAM="$(sysctl -n hw.physmem)"
elif [ "${KERNEL_NAME}" = Darwin ]; then
RAM_DETECTION="sysctl"
- TOTAL_RAM="$(sysctl -n hw.physmem)"
+ TOTAL_RAM="$(sysctl -n hw.memsize)"
elif [ -r /proc/meminfo ]; then
RAM_DETECTION="procfs"
TOTAL_RAM="$(grep -F MemTotal /proc/meminfo | cut -f 2 -d ':' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | cut -f 1 -d ' ')"