[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: PNG File Screenshot 2020-05-30 at 00.47.45.png    
Issue Links:
Causes
causes ZBXNEXT-593 fping detection improvements Open
caused by ZBX-17060 Auto Registration changes from IP to ... Closed
Duplicate
Sub-task
depends on ZBX-18365 Zabbix 5.0.2 incorrectly processing o... Closed
part of ZBXNEXT-593 fping detection improvements Open
Team: Team I
Sprint: Sprint 67 (Aug 2020), Sprint 68 (Sep 2020)
Story Points: 4

 Description   

Steps to reproduce:
#open https://www.zabbix.com/documentation/current/manual/config/items/itemtypes/simple_checks:

  1. open /var/log/zabbix/zabbix_server.log:
  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:
Interval should be recalculated if for example fping chnaged version from 4.X to 3.X and server was not restarted.
Correct documentation with notes about interval used and how it's calculated.



 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

fping version X Minimum interval as root/non-root/safe-limits Default
        X < ​3.14 ​1/10/- ​25
3.14 <= X <  4.0 0/1/- 25
4.0  <= X 0/0/1 10

 "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:

Distro/version fping version Minimum interval as root/non-root
Debian 7.11 (Wheezy) 3.2 1/10
Debian 8.11 (Jessie) 3.10 1/10
Debian 9.4 (Stretch) 3.15 0​/1
Debian 10.5 (Buster) 4.2 0/0
CentOS 6.10 (Final) 2.4b2-10.el6 1/10
CentOS 7.7.1908 (Core) 3.10 1/10
CentOS 8.2.2004 (Core) 4.2 0/0

 

Comment by dimir [ 2020 Sep 04 ]

Decided to not base functionality on fping version.

What is currently covered in the development branch:

  • expire detected options every hour (currently hard-coded), they will be re-detected on the next icmp check
  • capture the interval from fping output "You need i >= " (and "You need -i >= " since fping 3.16)
  • output in LogLevel>=4 detected options ("source IP" will be printed if it is set in server/proxy config), e. g.:
    • detected minimum supported fping interval (-i): 1
    • detected fping source IP option: "-S"
  • and if built with IPv6:
    • detected minimum supported fping6 interval (-i): 1
    • detected fping6 source IP option: "-S"
    • detected fping IPv6 support: yes

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:

  1. I could not find a way this could happen
  2. If it could happen, it should be fixed in ZBX-17060
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. 

 https://pastebin.com/0rFKiEaA

https://www.reddit.com/r/zabbix/comments/j1hhnw/release_notes_for_zabbix_504/?utm_source=share&utm_medium=ios_app&utm_name=iossmf

Comment by dimir [ 2020 Sep 29 ]

Is fping binary setuid-ed root? The error message handling was improved in ZBX-18365 which will be out with 5.0.5

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!

Generated at Wed May 14 08:26:54 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.