diff options
author | David O'Rourke <phyber@users.noreply.github.com> | 2019-05-14 23:42:36 +0100 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2019-06-04 18:38:40 +0200 |
commit | 8c47f973111cfc65a9c252ce5ad7f67ecf1798e7 (patch) | |
tree | 8b54bb00534751f3458cb3a336104c0ec3cd0d96 | |
parent | f97f01c46cfde2ff97b5539b7964f3044c04947b (diff) | |
download | prometheus_node_collector-8c47f973111cfc65a9c252ce5ad7f67ecf1798e7.tar.bz2 prometheus_node_collector-8c47f973111cfc65a9c252ce5ad7f67ecf1798e7.tar.xz prometheus_node_collector-8c47f973111cfc65a9c252ce5ad7f67ecf1798e7.zip |
meminfo: Fix the size mismatch in the swapTotal check mib for BSD. (#1345)
Signed-off-by: David O'Rourke <david.orourke@gmail.com>
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | collector/memory_bsd.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 281f088..f5ab4fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
@@ -7,7 +7,7 @@ | |||
7 | * [CHANGE] | 7 | * [CHANGE] |
8 | * [FEATURE] | 8 | * [FEATURE] |
9 | * [ENHANCEMENT] | 9 | * [ENHANCEMENT] |
10 | * [BUGFIX] | 10 | * [BUGFIX] Fix incorrect sysctl call in BSD meminfo collector, resulting in broken swap metrics on FreeBSD #1345 |
11 | 11 | ||
12 | ## 0.18.0 / 2019-05-09 | 12 | ## 0.18.0 / 2019-05-09 |
13 | 13 | ||
diff --git a/collector/memory_bsd.go b/collector/memory_bsd.go index 00bf3e5..cc6bc08 100644 --- a/collector/memory_bsd.go +++ b/collector/memory_bsd.go | |||
@@ -47,7 +47,7 @@ func NewMemoryCollector() (Collector, error) { | |||
47 | 47 | ||
48 | mibSwapTotal := "vm.swap_total" | 48 | mibSwapTotal := "vm.swap_total" |
49 | /* swap_total is FreeBSD specific. Fall back to Dfly specific mib if not present. */ | 49 | /* swap_total is FreeBSD specific. Fall back to Dfly specific mib if not present. */ |
50 | _, err = unix.SysctlUint32(mibSwapTotal) | 50 | _, err = unix.SysctlUint64(mibSwapTotal) |
51 | if err != nil { | 51 | if err != nil { |
52 | mibSwapTotal = "vm.swap_size" | 52 | mibSwapTotal = "vm.swap_size" |
53 | } | 53 | } |