[ZBX-17848] Fix fping interval detection and confusing documentation of ICMP checks interval Created: 2020 May 30 Updated: 2024 Apr 10 Resolved: 2020 Oct 09 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Documentation (D), Proxy (P), Server (S) |
Affects Version/s: | 3.0.31, 4.0.21, 4.4.9, 5.0.1 |
Fix Version/s: | 4.0.25rc1, 5.0.4rc1, 5.2.0alpha3, 5.2 (plan) |
Type: | Problem report | Priority: | Critical |
Reporter: | Edgar Akhmetshin | Assignee: | dimir |
Resolution: | Fixed | Votes: | 1 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() |
||||||||||||||||||||||||||||
Issue Links: |
|
||||||||||||||||||||||||||||
Team: | |||||||||||||||||||||||||||||
Sprint: | Sprint 67 (Aug 2020), Sprint 68 (Sep 2020) | ||||||||||||||||||||||||||||
Story Points: | 4 |
Description |
Steps to reproduce:
5198:20200529:191836.432 item "xxxxxxxx:icmppingloss[,100,20,50,500]" became not supported: fping failed: /usr/sbin/fping: You need i >= 10, p >= 20, r < 20, and t >= 50 5198:20200529:191836.432 item "xxxxxxxx:icmppingloss[,100,20,50,500]" became not supported: fping failed: /usr/sbin/fping: You need i >= 10, p >= 20, r < 20, and t >= 50 Problem: -i is set internally according to the ./src/libs/zbxicmpping/icmpping.c in get_interval_option: * Comments: starting with fping (4.x), the packets interval can be 0ms, 1ms, * * otherwise minimum value is 10ms * ****************************************************************************** ... zbx_snprintf(tmp, sizeof(tmp), "%s -c1 -t50 -i0 %s", fping, dst); ... zbx_snprintf(tmp, sizeof(tmp), "%s -c1 -t50 -i1 %s", fping, dst); ... else { *value = 10; Expected: |
Comments |
Comment by dimir [ 2020 Aug 31 ] | ||||||||||||||||||||||||
Current functionality of detecting interval of the fping binary in Zabbix is pretty messed up. It is based on fping exit code (which is different in different versions) and multiple attempts to run fping with different -i options. I propose to add functionality to detect fping version and move from there. Luckily, all versions of fping support -v option to get the version major and minor numbers and the output is in the same format. Supported minimum and default interval values (in ms) in different fping versions. History of fping versions
"Safe limits" is compile-time option supported since fping 4.0. Distribution packages provide fping binary without "safe limits". | ||||||||||||||||||||||||
Comment by dimir [ 2020 Sep 02 ] | ||||||||||||||||||||||||
fping versions and allowed intervals in distributions:
| ||||||||||||||||||||||||
Comment by dimir [ 2020 Sep 04 ] | ||||||||||||||||||||||||
Decided to not base functionality on fping version. What is currently covered in the development branch:
Sharing detected fping options between processes was left out of scope of this ticket. To me it's worth fixing it in 5.0 as well. | ||||||||||||||||||||||||
Comment by dimir [ 2020 Sep 07 ] | ||||||||||||||||||||||||
Fixed in development branch: 17073060fa | ||||||||||||||||||||||||
Comment by dimir [ 2020 Sep 09 ] | ||||||||||||||||||||||||
I left checking for empty host name out of the scope of this task because:
| ||||||||||||||||||||||||
Comment by dimir [ 2020 Sep 15 ] | ||||||||||||||||||||||||
Fixed in
| ||||||||||||||||||||||||
Comment by dimir [ 2020 Sep 23 ] | ||||||||||||||||||||||||
Documented 4.0 version here: https://www.zabbix.com/documentation/4.0/manual/config/items/itemtypes/simple_checks#icmp_pings . martins-v please take a look. | ||||||||||||||||||||||||
Comment by dimir [ 2020 Sep 24 ] | ||||||||||||||||||||||||
Documented auto-detecting options (-i and -S), re-detection every hour (2 sections below the fping options table) in
| ||||||||||||||||||||||||
Comment by Marco Hofmann [ 2020 Sep 29 ] | ||||||||||||||||||||||||
There might be a problem with this ZBX in 5.0.4 according to Telegram, reddit and IRC. | ||||||||||||||||||||||||
Comment by dimir [ 2020 Sep 29 ] | ||||||||||||||||||||||||
Is fping binary setuid-ed root? The error message handling was improved in | ||||||||||||||||||||||||
Comment by Daniel Berteaud [ 2020 Oct 08 ] | ||||||||||||||||||||||||
The new detection of the minimum interval is breaking all pings (even IPv4) if IPv6 is disabled on the server/proxy. Here's an extract of the logs on my EL7 proxy, with DebugLevel=4 oct. 08 08:39:22 adm zabbix_proxy[21669]: testing interval 1 using command "/usr/sbin/fping6 -c1 -t50 -i1 sw1.lapiole.org" oct. 08 08:39:22 adm zabbix_proxy[21669]: In zbx_popen() command:'/usr/sbin/fping6 -c1 -t50 -i1 sw1.lapiole.org' oct. 08 08:39:22 adm zabbix_proxy[21669]: End of zbx_popen():8 oct. 08 08:39:22 adm zabbix_proxy[21683]: zbx_popen(): executing script oct. 08 08:39:22 adm zabbix_proxy[21669]: In zbx_waitpid() oct. 08 08:39:22 adm zabbix_proxy[21669]: zbx_waitpid() exited, status:4 oct. 08 08:39:22 adm zabbix_proxy[21669]: End of zbx_waitpid():21683 oct. 08 08:39:22 adm zabbix_proxy[21669]: testing interval 10 using command "/usr/sbin/fping6 -c1 -t50 -i10 sw1.lapiole.org" oct. 08 08:39:22 adm zabbix_proxy[21669]: In zbx_popen() command:'/usr/sbin/fping6 -c1 -t50 -i10 sw1.lapiole.org' oct. 08 08:39:22 adm zabbix_proxy[21669]: End of zbx_popen():8 oct. 08 08:39:22 adm zabbix_proxy[21688]: zbx_popen(): executing script oct. 08 08:39:22 adm zabbix_proxy[21669]: In zbx_waitpid() oct. 08 08:39:22 adm zabbix_proxy[21669]: zbx_waitpid() exited, status:4 oct. 08 08:39:22 adm zabbix_proxy[21669]: End of zbx_waitpid():21688 oct. 08 08:39:22 adm zabbix_proxy[21669]: Cannot detect the minimum interval of /usr/sbin/fping6 oct. 08 08:39:22 adm zabbix_proxy[21669]: End of zbx_ping():NOTSUPPORTED oct. 08 08:39:22 adm zabbix_proxy[21669]: In process_values() oct. 08 08:39:22 adm zabbix_proxy[21669]: host [sw1.lapiole.org] Cannot detect the minimum interval of /usr/sbin/fping6 Then, no more pings are sent. Running the fping6 command manually fails, not because of privileges issue, but because IPv6 is completly disabled :
[root@adm ~]# /usr/sbin/fping6 -c1 -t50 -i10 sw1.lapiole.org
(null): can't create raw socket (must run as root?) : Address family not supported by protocol
[root@adm ~]#
To work arround this, I must add in my zabbix_proxy.conf : Fping6Location=/usr/sbin/fping This way, zabbix only tries to use the IPv4 variant, and pings works again | ||||||||||||||||||||||||
Comment by dimir [ 2020 Oct 08 ] | ||||||||||||||||||||||||
Oh, that one is bad. Could you please create a new ZBX issue? | ||||||||||||||||||||||||
Comment by Daniel Berteaud [ 2020 Oct 08 ] | ||||||||||||||||||||||||
Donne : ZBX-18467 | ||||||||||||||||||||||||
Comment by dimir [ 2020 Oct 08 ] | ||||||||||||||||||||||||
Thanks! |