Created attachment 234225 [details] output of "sysctl -a | egrep -i ^hw." with nagios-plugins-2.4.0,1 check_swap returns always DOUBLE the size of swap, if an additional swap file ist added create a swap file as shown at https://www.freebsdnews.com/2015/07/03/add-swap-file-freebsd-10-1/ cat /etc/fstab # Device Mountpoint FStype Options Dump Pass# /dev/da0p2 / ufs rw 1 1 /dev/da0p3 none swap sw 0 0 /dev/da1p1 /usr/local/poudriere ufs rw 0 0 /dev/cd0 /media/cdrom cd9660 ro,noauto 0 0 linproc /compat/linux/proc linprocfs rw,late 0 0 md43 none swap sw,file=/usr/local/poudriere/swapfile_1G 0 0 swapctl -l Device: 1024-blocks Used: /dev/da0p3 838656 0 /dev/md43 1048576 0 /usr/local/libexec/nagios/check_swap -w 30% -c 10% SWAP OK - 100% free (3686 MB out of 3686 MB) |swap=3686MB;1105;368;0;3686 swapoff /dev/md43 swapctl -l Device: 1024-blocks Used: /dev/da0p3 838656 0 /usr/local/libexec/nagios/check_swap -w 30% -c 10% SWAP OK - 100% free (819 MB out of 819 MB) |swap=819MB;245;81;0;819 swapon /dev/md43 /usr/local/libexec/nagios/check_swap -w 30% -c 10% SWAP OK - 100% free (3686 MB out of 3686 MB) |swap=3686MB;1105;368;0;3686 top (top: version FreeBSD) and htop (3.2.0) allways show the correct size uname -a FreeBSD xxx 13.0-RELEASE-p11 FreeBSD 13.0-RELEASE-p11 #0: Tue Apr 5 18:54:35 UTC 2022 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
this bug seems not to be related to "swap files" but to the number of swap devices: If I turn off swap partition /dev/da0p3, check_swap calculates the right size of swap mem. If there are more than one swap device, check_swap seems to sum up each single divice plus the sum of all devices...