View | Details | Raw Unified | Return to bug 281384 | Differences between
and this patch

Collapse All | Expand All

(-)b/net-mgmt/check_mk_agent/files/patch-check__mk__agent.freebsd (-17 / +25 lines)
Lines 1-26 Link Here
1
--- check_mk_agent.freebsd.orig	2024-08-15 18:32:18 UTC
1
--- check_mk_agent.freebsd.orig	2024-09-10 08:17:05 UTC
2
+++ check_mk_agent.freebsd
2
+++ check_mk_agent.freebsd
3
@@ -117,9 +117,9 @@ set_variable_defaults() {
3
@@ -118,8 +118,8 @@ set_variable_defaults() {
4
 #
5
 
4
 
6
 set_variable_defaults() {
5
 set_variable_defaults() {
7
-    : "${MK_LIBDIR:=/usr/local/lib/check_mk_agent}"
6
     : "${MK_LIBDIR:=/usr/local/lib/check_mk_agent}"
8
-    : "${MK_CONFDIR:=/etc/check_mk}"
7
-    : "${MK_CONFDIR:=/etc/check_mk}"
9
-    : "${MK_VARDIR:=/var/lib/check_mk_agent}"
8
-    : "${MK_VARDIR:=/var/lib/check_mk_agent}"
10
+    : "${MK_LIBDIR:=%%CHECKMK_LIBDIR%%}"
9
+    : "${MK_CONFDIR:=/usr/local/etc/check_mk}"
11
+    : "${MK_CONFDIR:=%%CHECKMK_CONFDIR%%}"
12
+    : "${MK_VARDIR:=/var/db/check_mk_agent}"
10
+    : "${MK_VARDIR:=/var/db/check_mk_agent}"
13
     : "${MK_LOGDIR:=/var/log/check_mk_agent}"
11
     : "${MK_LOGDIR:=/var/log/check_mk_agent}"
14
 
12
 
15
     # some 'booleans'
13
     # some 'booleans'
16
@@ -138,8 +138,8 @@ preamble_1() {
14
@@ -597,6 +597,21 @@ run_purely_synchronous_sections() {
17
     # Make sure locally installed binaries are found
15
 
18
     # Only add binaries if they are not already in the path! If you append to path in a loop the process will
16
         rm -f "${tmpfile}"
19
     # eventually each the 128k size limit for the environment and become a zombie process. See execve manpage.
17
     fi
20
-    [ "${PATH#*"/usr/local/bin"}" != "${PATH}" ] || PATH="${PATH}:/usr/local/bin"
18
+
21
-    [ "${PATH#*"/usr/local/sbin"}" != "${PATH}" ] || PATH="${PATH}:/usr/local/sbin"
19
+    echo '<<<sysctl_mem>>>'
22
+    [ "${PATH#*"%%LOCALBASE%%/bin"}" != "${PATH}" ] || PATH="${PATH}:%%LOCALBASE%%/bin"
20
+    _page_size=$( sysctl -n vm.stats.vm.v_page_size )
23
+    [ "${PATH#*"%%LOCALBASE%%/sbin"}" != "${PATH}" ] || PATH="${PATH}:%%LOCALBASE%%/sbin"
21
+    echo "mem.cache $(( _page_size * $( sysctl -n vm.stats.vm.v_cache_count ) ))"
24
     [ -d "/var/qmail/bin" ] && { [ "${PATH#*"/var/qmail/bin"}" != "${PATH}" ] || PATH="${PATH}:/var/qmail/bin"; }
22
+    echo "mem.free $(( _page_size * $( sysctl -n vm.stats.vm.v_free_count ) ))"
23
+    echo "mem.total $( sysctl -n hw.physmem )"
24
+    echo "mem.used $(( _page_size * ( $( sysctl -n vm.stats.vm.v_active_count ) + $( sysctl -n vm.stats.vm.v_wire_count ) ) ))"
25
+    _swap_total=$( sysctl -n vm.swap_total )
26
+    _swap_used=$(( $( swapinfo | tail -1 | awk '{print $3}' ) * 1024 ))
27
+    echo "swap.free $(( _swap_total - _swap_used ))"
28
+    echo "swap.total ${_swap_total}"
29
+    echo "swap.used ${_swap_used}"
30
+    unset -v _page_size
31
+    unset -v _swap_total
32
+    unset -v _swap_used
33
 }
25
 
34
 
26
     # All executables in PLUGINSDIR will simply be executed and their
35
 #
27
- 

Return to bug 281384