Path: blob/main/net-mgmt/check_mk_agent/files/patch-check__mk__agent.freebsd
16462 views
--- check_mk_agent.freebsd.orig 2024-10-02 06:30:56 UTC +++ check_mk_agent.freebsd @@ -142,6 +142,21 @@ preamble_1() { [ "${PATH#*"/usr/local/sbin"}" != "${PATH}" ] || PATH="${PATH}:/usr/local/sbin" [ -d "/var/qmail/bin" ] && { [ "${PATH#*"/var/qmail/bin"}" != "${PATH}" ] || PATH="${PATH}:/var/qmail/bin"; } + echo '<<<sysctl_mem>>>' + _page_size=$( sysctl -n vm.stats.vm.v_page_size ) + echo "mem.cache $(( _page_size * $( sysctl -n vm.stats.vm.v_cache_count ) ))" + echo "mem.free $(( _page_size * $( sysctl -n vm.stats.vm.v_free_count ) ))" + echo "mem.total $( sysctl -n hw.physmem )" + echo "mem.used $(( _page_size * ( $( sysctl -n vm.stats.vm.v_active_count ) + $( sysctl -n vm.stats.vm.v_wire_count ) ) ))" + _swap_total=$( sysctl -n vm.swap_total ) + _swap_used=$(( $( swapinfo | tail -1 | awk '{print $3}' ) * 1024 )) + echo "swap.free $(( _swap_total - _swap_used ))" + echo "swap.total ${_swap_total}" + echo "swap.used ${_swap_used}" + unset -v _page_size + unset -v _swap_total + unset -v _swap_used + # All executables in PLUGINSDIR will simply be executed and their # ouput appended to the output of the agent. Plugins define their own # sections and must output headers with '<<<' and '>>>'