Overview: All calls to check_icmp return 100% packetloss and an error saying 'invalid argument'. Steps to Reproduce: 1) Install net-mgmt/nagios-plugins on FreeBSD 13.1-RELEASE 2) Run command: /usr/local/libexec/nagios/check_icmp -vvv -H 127.0.0.1 Actual Results: # /usr/local/libexec/nagios/check_icmp -vvvvvvH 127.0.0.1 address_family: 2 (IPv4 = 2; IPv6 = 10) setsockopt failed Setting alarm timeout to 10 seconds packets: 5, targets: 1 target_interval: 0.000, pkt_interval 80.000 crit.rta: 500.000 max_completion_time: 3400.000 crit = {500000, 80%}, warn = {200000, 40%} pkt_interval: 80000 target_interval: 0 retry_interval: 0 icmp_pkt_size: 76 timeout: 10 Sending ICMPv4 echo-request of len 24, id 4763, seq 0, cksum 0xF6CB to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument Sending ICMPv4 echo-request of len 24, id 4763, seq 1, cksum 0xF5A6 to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument Sending ICMPv4 echo-request of len 24, id 4763, seq 2, cksum 0xF4A1 to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument Sending ICMPv4 echo-request of len 24, id 4763, seq 3, cksum 0xF39D to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument Sending ICMPv4 echo-request of len 24, id 4763, seq 4, cksum 0xF29A to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument finish(0) called icmp_sent: 0 icmp_recv: 0 icmp_lost: 0 targets: 1 targets_alive: 1 CRITICAL - 127.0.0.1: rta nan, lost 100%| rta=0.000ms;200.000;500.000;0; pl=100%;40;80;0;100 rtmax=0.000ms;;;; rtmin=0.000ms;;;; targets: 1, targets_alive: 0, hosts_ok: 0, hosts_warn: 0, min_hosts_alive: -1 Expected Results: Should have received 0% packetloss. Build Date & Hardware: Built on FreeBSD 13.1-RELEASE on 2022-May-29. Additional Builds and Platforms: Did not occur on FreeBSD 13.0-RELEASE-p11.
same problem with monitoring-plugins. Codebase of check_icmp is mostly the same.
Not sure if this helps, but here is the truss output: # truss -o ~/check_icmp_out /usr/local/libexec/nagios/check_icmp -vvvvvvH 127.0.0.1 address_family: 2 (IPv4 = 2; IPv6 = 10) setsockopt failed Setting alarm timeout to 10 seconds packets: 5, targets: 1 target_interval: 0.000, pkt_interval 80.000 crit.rta: 500.000 max_completion_time: 3400.000 crit = {500000, 80%}, warn = {200000, 40%} pkt_interval: 80000 target_interval: 0 retry_interval: 0 icmp_pkt_size: 76 timeout: 10 Sending ICMPv4 echo-request of len 24, id 45708, seq 0, cksum 0xD184 to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument Sending ICMPv4 echo-request of len 24, id 45708, seq 1, cksum 0xCF22 to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument Sending ICMPv4 echo-request of len 24, id 45708, seq 2, cksum 0xCD4A to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument Sending ICMPv4 echo-request of len 24, id 45708, seq 3, cksum 0xCB7A to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument Sending ICMPv4 echo-request of len 24, id 45708, seq 4, cksum 0xC9A4 to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument finish(0) called icmp_sent: 0 icmp_recv: 0 icmp_lost: 0 targets: 1 targets_alive: 1 CRITICAL - 127.0.0.1: rta nan, lost 100%| rta=0.000ms;200.000;500.000;0; pl=100%;40;80;0;100 rtmax=0.000ms;;;; rtmin=0.000ms;;;; targets: 1, targets_alive: 0, hosts_ok: 0, hosts_warn: 0, min_hosts_alive: -1 # cat check_icmp_out mmap(0x0,135168,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34362044416 (0x800233000) mprotect(0x800230000,4096,PROT_READ) = 0 (0x0) issetugid() = 0 (0x0) sigfastblock(0x1,0x8002328f0) = 0 (0x0) __sysctl("kern.ostype",2,0x800232242,0x7fffffffde30,0x0,0) = 0 (0x0) __sysctl("kern.hostname",2,0x800232342,0x7fffffffde30,0x0,0) = 0 (0x0) __sysctl("kern.osrelease",2,0x800232442,0x7fffffffde30,0x0,0) = 0 (0x0) __sysctl("kern.version",2,0x800232542,0x7fffffffde30,0x0,0) = 0 (0x0) __sysctl("hw.machine",2,0x800232642,0x7fffffffde30,0x0,0) = 0 (0x0) open("/etc/libmap.conf",O_RDONLY|O_CLOEXEC,010660030) = 3 (0x3) fstat(3,{ mode=-rw-r--r-- ,inode=99729,size=47,blksize=32768 }) = 0 (0x0) read(3,"# $FreeBSD$\nincludedir /usr/loc"...,47) = 47 (0x2f) close(3) = 0 (0x0) open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165) ERR#2 'No such file or directory' open("/usr/local/lib/libintl.so.8",O_RDONLY|O_CLOEXEC|O_VERIFY,066000) = 3 (0x3) fstat(3,{ mode=-rw-r--r-- ,inode=166266,size=56288,blksize=32768 }) = 0 (0x0) mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362179584 (0x800254000) mmap(0x0,61440,PROT_NONE,MAP_GUARD,-1,0x0) = 34362183680 (0x800255000) mmap(0x800255000,16384,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34362183680 (0x800255000) mmap(0x800259000,28672,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x3000) = 34362200064 (0x800259000) mmap(0x800260000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x9000) = 34362228736 (0x800260000) mmap(0x800261000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x9000) = 34362232832 (0x800261000) mmap(0x800262000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 34362236928 (0x800262000) munmap(0x800254000,4096) = 0 (0x0) close(3) = 0 (0x0) open("/usr/local/lib/libssl.so.50",O_RDONLY|O_CLOEXEC|O_VERIFY,014232266000) = 3 (0x3) fstat(3,{ mode=-rw-r--r-- ,inode=148813,size=408640,blksize=32768 }) = 0 (0x0) mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362179584 (0x800254000) mmap(0x0,421888,PROT_NONE,MAP_GUARD,-1,0x0) = 34362245120 (0x800264000) mmap(0x800264000,155648,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34362245120 (0x800264000) mmap(0x80028a000,229376,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x25000) = 34362400768 (0x80028a000) mmap(0x8002c2000,24576,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x5c000) = 34362630144 (0x8002c2000) mmap(0x8002c8000,12288,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x61000) = 34362654720 (0x8002c8000) munmap(0x800254000,4096) = 0 (0x0) close(3) = 0 (0x0) open("/usr/local/lib/libcrypto.so.47",O_RDONLY|O_CLOEXEC|O_VERIFY,014232266000) = 3 (0x3) fstat(3,{ mode=-rw-r--r-- ,inode=148799,size=2154232,blksize=32768 }) = 0 (0x0) mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362179584 (0x800254000) mmap(0x0,2174976,PROT_NONE,MAP_GUARD,-1,0x0) = 34362667008 (0x8002cb000) mmap(0x8002cb000,892928,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34362667008 (0x8002cb000) mmap(0x8003a5000,1118208,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0xd9000) = 34363559936 (0x8003a5000) mmap(0x8004b6000,126976,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1e9000) = 34364678144 (0x8004b6000) mmap(0x8004d5000,28672,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x207000) = 34364805120 (0x8004d5000) mmap(0x8004dc000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 34364833792 (0x8004dc000) munmap(0x800254000,4096) = 0 (0x0) close(3) = 0 (0x0) open("/usr/local/lib/libthr.so.3",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such file or directory' open("/usr/local/lib/libthr.so.3",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such file or directory' open("/var/run/ld-elf.so.hints",O_RDONLY|O_CLOEXEC,010013144) = 3 (0x3) read(3,"Ehnt\^A\0\0\0\M^@\0\0\0\M-B\0\0"...,128) = 128 (0x80) fstat(3,{ mode=-r--r--r-- ,inode=98792,size=322,blksize=32768 }) = 0 (0x0) pread(3,"/lib:/usr/lib:/usr/lib/compat:/u"...,194,0x80) = 194 (0xc2) close(3) = 0 (0x0) open("/lib/libthr.so.3",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3) fstat(3,{ mode=-r--r--r-- ,inode=51121,size=128224,blksize=32768 }) = 0 (0x0) mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362179584 (0x800254000) mmap(0x0,188416,PROT_NONE,MAP_GUARD,-1,0x0) = 34364841984 (0x8004de000) mmap(0x8004de000,53248,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34364841984 (0x8004de000) mmap(0x8004eb000,73728,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0xc000) = 34364895232 (0x8004eb000) mmap(0x8004fd000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1d000) = 34364968960 (0x8004fd000) mmap(0x8004ff000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1e000) = 34364977152 (0x8004ff000) mmap(0x800500000,49152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 34364981248 (0x800500000) munmap(0x800254000,4096) = 0 (0x0) close(3) = 0 (0x0) open("/usr/local/lib/libdl.so.1",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such file or directory' open("/usr/local/lib/libdl.so.1",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such file or directory' open("/lib/libdl.so.1",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such file or directory' open("/usr/lib/libdl.so.1",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3) fstat(3,{ mode=-r--r--r-- ,inode=99379,size=6240,blksize=32768 }) = 0 (0x0) mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362179584 (0x800254000) mmap(0x0,16384,PROT_NONE,MAP_GUARD,-1,0x0) = 34365030400 (0x80050c000) mmap(0x80050c000,4096,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34365030400 (0x80050c000) mmap(0x80050d000,4096,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34365034496 (0x80050d000) mmap(0x80050e000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x0) = 34365038592 (0x80050e000) mmap(0x80050f000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x0) = 34365042688 (0x80050f000) munmap(0x800254000,4096) = 0 (0x0) close(3) = 0 (0x0) open("/usr/local/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,012320443000) ERR#2 'No such file or directory' open("/usr/local/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,012320443000) ERR#2 'No such file or directory' open("/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,012320443000) = 3 (0x3) fstat(3,{ mode=-r--r--r-- ,inode=51100,size=1955744,blksize=32768 }) = 0 (0x0) mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362179584 (0x800254000) mmap(0x0,4235264,PROT_NONE,MAP_GUARD,-1,0x0) = 34365046784 (0x800510000) mmap(0x800510000,540672,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34365046784 (0x800510000) mmap(0x800594000,1359872,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x83000) = 34365587456 (0x800594000) mmap(0x8006e0000,36864,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1ce000) = 34366947328 (0x8006e0000) mmap(0x8006e9000,28672,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1d6000) = 34366984192 (0x8006e9000) mmap(0x8006f0000,2269184,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 34367012864 (0x8006f0000) munmap(0x800254000,4096) = 0 (0x0) close(3) = 0 (0x0) mprotect(0x800260000,4096,PROT_READ) = 0 (0x0) mprotect(0x8002c2000,20480,PROT_READ) = 0 (0x0) mprotect(0x8004b6000,122880,PROT_READ) = 0 (0x0) mprotect(0x8004fd000,4096,PROT_READ) = 0 (0x0) mprotect(0x8006e0000,32768,PROT_READ) = 0 (0x0) mprotect(0x8006e0000,32768,PROT_READ|PROT_WRITE) = 0 (0x0) mprotect(0x8006e0000,32768,PROT_READ) = 0 (0x0) readlink("/etc/malloc.conf",0x7fffffffd600,1024) ERR#2 'No such file or directory' issetugid() = 0 (0x0) __sysctl("vm.overcommit",2,0x7fffffffbb8c,0x7fffffffbb80,0x0,0) = 0 (0x0) mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0) = 34370224128 (0x800a00000) clock_gettime(4,{ 59738.164773182 }) = 0 (0x0) clock_gettime(4,{ 59738.164794317 }) = 0 (0x0) clock_gettime(4,{ 59738.164815638 }) = 0 (0x0) mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0) = 34372321280 (0x800c00000) mmap(0x0,4194304,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0) = 34374418432 (0x800e00000) __sysctl("kern.usrstack",2,0x8004ffc88,0x7fffffffda88,0x0,0) = 0 (0x0) getrlimit(RLIMIT_STACK,{ cur=536870912,max=536870912 }) = 0 (0x0) thr_self(0x800c12000) = 0 (0x0) mmap(0x7fffdfffe000,4096,PROT_NONE,MAP_ANON,-1,0x0) = 140736951476224 (0x7fffdfffe000) rtprio_thread(RTP_LOOKUP,106254,0x7fffffffda48) = 0 (0x0) sigaction(SIGTHR,{ 0x8004f7b50 SA_SIGINFO ss_t },0x0) = 0 (0x0) sigprocmask(SIG_UNBLOCK,{ },0x0) = 0 (0x0) _umtx_op(0x7fffffffda40,UMTX_OP_WAKE,0x1,0x0,0x0) = 0 (0x0) mprotect(0x0,0,PROT_NONE) = 0 (0x0) getpid() = 45708 (0xb28c) getpid() = 45708 (0xb28c) sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0) sigfastblock(0x3,0x0) = 0 (0x0) sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0) sigfastblock(0x1,0x800c12038) = 0 (0x0) getcontext(0x7fffffffd530) = 0 (0x0) sysarch(AMD64_GET_XFPUSTATE,0x7fffffffd4f8) = 0 (0x0) open("/usr/share/locale/C.UTF-8/LC_CTYPE",O_RDONLY|O_CLOEXEC,013720646057) = 3 (0x3) fstat(3,{ mode=-r--r--r-- ,inode=1035065,size=51056,blksize=32768 }) = 0 (0x0) mmap(0x0,51056,PROT_READ,MAP_PRIVATE,3,0x0) = 34369282048 (0x80091a000) close(3) = 0 (0x0) munmap(0x80091a000,51056) = 0 (0x0) geteuid() = 0 (0x0) socket(PF_INET,SOCK_RAW,IPPROTO_ICMP) = 3 (0x3) getuid() = 0 (0x0) setuid(0x0) = 0 (0x0) setsockopt(3,SOL_SOCKET,SO_TIMESTAMP,0x7fffffffea0c,4) = 0 (0x0) getpid() = 45708 (0xb28c) fstat(1,{ mode=crw--w---- ,inode=98,size=0,blksize=4096 }) = 0 (0x0) ioctl(1,TIOCGETA,0x7fffffffe370) = 0 (0x0) write(1,"address_family: 2 (IPv4 = 2; IPv"...,40) = 40 (0x28) setsockopt(3,IPPROTO_IP,IP_TTL,0x213810,1) ERR#22 'Invalid argument' write(1,"setsockopt failed\n",18) = 18 (0x12) sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0) sigaction(SIGINT,{ 0x8004f7a00 SA_RESTART|SA_SIGINFO ss_t },{ SIG_DFL SA_RESTART ss_t }) = 0 (0x0) sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0) sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0) sigaction(SIGHUP,{ 0x8004f7a00 SA_RESTART|SA_SIGINFO ss_t },{ SIG_DFL 0x0 ss_t }) = 0 (0x0) sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0) sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0) sigaction(SIGTERM,{ 0x8004f7a00 SA_RESTART|SA_SIGINFO ss_t },{ SIG_DFL 0x0 ss_t }) = 0 (0x0) sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0) sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0) sigaction(SIGALRM,{ 0x8004f7a00 SA_RESTART|SA_SIGINFO ss_t },{ SIG_DFL 0x0 ss_t }) = 0 (0x0) sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0) write(1,"Setting alarm timeout to 10 seco"...,36) = 36 (0x24) setitimer(0,{ 0.000000, 10.000000 },{ 0.000000, 0.000000 }) = 0 (0x0) gettimeofday({ 1653934661.406285 },0x213830) = 0 (0x0) write(1,"packets: 5, targets: 1\n",23) = 23 (0x17) write(1,"target_interval: 0.000, pkt_inte"...,44) = 44 (0x2c) write(1,"crit.rta: 500.000\n",18) = 18 (0x12) write(1,"max_completion_time: 3400.000\n",30) = 30 (0x1e) write(1,"crit = {500000, 80%}, warn = {20"...,43) = 43 (0x2b) write(1,"pkt_interval: 80000 target_inte"...,59) = 59 (0x3b) write(1,"icmp_pkt_size: 76 timeout: 10\n",31) = 31 (0x1f) gettimeofday({ 1653934661.406742 },0x213830) = 0 (0x0) write(1,"Sending ICMPv4 echo-request of l"...,87) = 87 (0x57) sendmsg(3,{{ AF_INET 127.0.0.1:0 },128,[{"\b\0\M^D\M-Q\M-2\M^L\0\0E\n\M^Ub"...,76}],1,{},0,0},0) ERR#22 'Invalid argument' fstatat(AT_FDCWD,"/usr/share/nls/C.UTF-8/libc.cat",0x7fffffffe790,0x0) ERR#2 'No such file or directory' fstatat(AT_FDCWD,"/usr/share/nls/libc/C.UTF-8",0x7fffffffe790,0x0) ERR#2 'No such file or directory' fstatat(AT_FDCWD,"/usr/local/share/nls/C.UTF-8/libc.cat",0x7fffffffe790,0x0) ERR#2 'No such file or directory' fstatat(AT_FDCWD,"/usr/local/share/nls/libc/C.UTF-8",0x7fffffffe790,0x0) ERR#2 'No such file or directory' write(1,"Failed to send ping to 127.0.0.1"...,52) = 52 (0x34) gettimeofday({ 1653934661.407096 },0x213830) = 0 (0x0) write(1,"Sending ICMPv4 echo-request of l"...,87) = 87 (0x57) sendmsg(3,{{ AF_INET 127.0.0.1:0 },128,[{"\b\0"\M-O\M-2\M^L\0\^AE\n\M^Ub\0"...,76}],1,{},0,0},0) ERR#22 'Invalid argument' write(1,"Failed to send ping to 127.0.0.1"...,52) = 52 (0x34) gettimeofday({ 1653934661.407312 },0x213830) = 0 (0x0) write(1,"Sending ICMPv4 echo-request of l"...,87) = 87 (0x57) sendmsg(3,{{ AF_INET 127.0.0.1:0 },128,[{"\b\0J\M-M\M-2\M^L\0\^BE\n\M^Ub\0"...,76}],1,{},0,0},0) ERR#22 'Invalid argument' write(1,"Failed to send ping to 127.0.0.1"...,52) = 52 (0x34) gettimeofday({ 1653934661.407520 },0x213830) = 0 (0x0) write(1,"Sending ICMPv4 echo-request of l"...,87) = 87 (0x57) sendmsg(3,{{ AF_INET 127.0.0.1:0 },128,[{"\b\0z\M-K\M-2\M^L\0\^CE\n\M^Ub\0"...,76}],1,{},0,0},0) ERR#22 'Invalid argument' write(1,"Failed to send ping to 127.0.0.1"...,52) = 52 (0x34) gettimeofday({ 1653934661.407734 },0x213830) = 0 (0x0) write(1,"Sending ICMPv4 echo-request of l"...,87) = 87 (0x57) sendmsg(3,{{ AF_INET 127.0.0.1:0 },128,[{"\b\0\M-$\M-I\M-2\M^L\0\^DE\n\M^U"...,76}],1,{},0,0},0) ERR#22 'Invalid argument' write(1,"Failed to send ping to 127.0.0.1"...,52) = 52 (0x34) setitimer(0,{ 0.000000, 0.000000 },{ 0.000000, 9.998296 }) = 0 (0x0) write(1,"finish(0) called\n",17) = 17 (0x11) close(3) = 0 (0x0) close(0) = 0 (0x0) close(0) ERR#9 'Bad file descriptor' write(1,"icmp_sent: 0 icmp_recv: 0 icmp"...,41) = 41 (0x29) write(1,"targets: 1 targets_alive: 1\n",29) = 29 (0x1d) write(1,"CRITICAL - \n",12) = 12 (0xc) write(1,"127.0.0.1: rta nan, lost 100%|\n",31) = 31 (0x1f) write(1,"rta=0.000ms;200.000;500.000;0; p"...,88) = 88 (0x58) write(1,"targets: 1, targets_alive: 0, ho"...,78) = 78 (0x4e) exit(0x2) process exit, rval = 2
Had the same error with FreeBSD 11 and FreeBSD 12 but only with IPv6 (check_icmp -6) Opened a issue https://github.com/nagios-plugins/nagios-plugins/issues/658
(In reply to saznik from comment #3) issue with patch at upstream: https://github.com/monitoring-plugins/monitoring-plugins/pull/1771 tested on one 13.1 box, looks fine. testbuilds, looks fine.
Created attachment 234597 [details] patch Add this patchfile to net-mgmt/monitoring-plugins/files/ and rebuild. Testbuilds done.
(In reply to Kurt Jaeger from comment #5) See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269229 for an update for monitoring-plugins which should also fix this bug.
(In reply to Kurt Jaeger from comment #6) https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269230 has an update to nagios-plugins, which should also fix this bug.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=7a21c687507056370e9213a387ac15f6c0a38b2e commit 7a21c687507056370e9213a387ac15f6c0a38b2e Author: Kurt Jaeger <pi@FreeBSD.org> AuthorDate: 2023-01-31 17:37:41 +0000 Commit: Nuno Teixeira <eduardo@FreeBSD.org> CommitDate: 2023-01-31 17:42:17 +0000 net-mgmt/nagios-plugins: Update to 2.4.3 - fix check_icmp bug from PR#264342 ChangeLog: https://github.com/nagios-plugins/nagios-plugins/blob/master/NEWS PR: 264342, 269230 net-mgmt/nagios-plugins/Makefile | 3 +-- net-mgmt/nagios-plugins/distinfo | 6 +++--- .../nagios-plugins/files/patch-plugins_check__smtp.c (gone) | 10 ---------- 3 files changed, 4 insertions(+), 15 deletions(-)
The Problem still persists on my system after portupgrade of nagios-plugins # uname -a FreeBSD xxx 13.1-RELEASE-p5 FreeBSD 13.1-RELEASE-p5 releng/13.1-n250174-753d65a19a55 xxx amd64 # portversion -v | grep nagios-plugins [Reading data from pkg(8) ... - 393 packages found - done] nagios-plugins-2.4.3,1 = up-to-date with port [kinz@pm-watcher01 ~]$ sudo truss -o ~/check_icmp_out /usr/local/libexec/nagios/./check_icmp -vvvvvvH 127.0.0.1 address_family: 2 (IPv4 = 2; IPv6 = 10) setsockopt failed Setting alarm timeout to 10 seconds packets: 5, targets: 1 target_interval: 0.000, pkt_interval 80.000 crit.rta: 500.000 max_completion_time: 3400.000 crit = {500000, 80%}, warn = {200000, 40%} pkt_interval: 80000 target_interval: 0 retry_interval: 0 icmp_pkt_size: 76 timeout: 10 Sending ICMPv4 echo-request of len 24, id 30259, seq 0, cksum 0x83BD to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument Sending ICMPv4 echo-request of len 24, id 30259, seq 1, cksum 0x80E0 to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument Sending ICMPv4 echo-request of len 24, id 30259, seq 2, cksum 0x7EF2 to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument Sending ICMPv4 echo-request of len 24, id 30259, seq 3, cksum 0x7D12 to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument Sending ICMPv4 echo-request of len 24, id 30259, seq 4, cksum 0x7B38 to host 127.0.0.1 Failed to send ping to 127.0.0.1 = Invalid argument finish(0) called icmp_sent: 0 icmp_recv: 0 icmp_lost: 0 targets: 1 targets_alive: 1 CRITICAL - 127.0.0.1: rta nan, lost 100%| rta=0.000ms;200.000;500.000;0; pl=100%;40;80;0;100 rtmax=0.000ms;;;; rtmin=0.000ms;;;; targets: 1, targets_alive: 0, hosts_ok: 0, hosts_warn: 0, min_hosts_alive: -1
Created attachment 240163 [details] Patch to fix addrlen in check_icmp.c There seems to have been a regression, as noted in your GitHub issue. I recreated the patch and it seems to have resolved the issue for me (again).
Reopening.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=c0bd039ca44643af1dc89899707f61ab4c3b7a03 commit c0bd039ca44643af1dc89899707f61ab4c3b7a03 Author: Kurt Jaeger <pi@FreeBSD.com> AuthorDate: 2023-02-16 18:46:51 +0000 Commit: Jochen Neumeister <joneum@FreeBSD.org> CommitDate: 2023-02-16 18:48:39 +0000 net-mgmt/monitoring-plugins: Update to 2.3.3 Update to 2.3.2, fick check_icmp bug PR: 269229 264342 Sponsored by: Netzkommune GmbH net-mgmt/monitoring-plugins/Makefile | 2 +- net-mgmt/monitoring-plugins/distinfo | 6 +++--- .../files/patch-plugins_check__procs.c | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 15 deletions(-)