[ZBX-1985] icmppingloss simple check seems offset by -100% Created: 2010 Feb 11  Updated: 2017 May 30  Resolved: 2010 Dec 27

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: 1.8.1
Fix Version/s: 1.8.4

Type: Incident report Priority: Major
Reporter: Tais P. Hansen Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Gentoo Linux


Issue Links:
Duplicate
duplicates ZBX-1876 discovery still tries to run fping6 e... Closed

 Description   

I have several simple check type items using keyt "icmppingloss[,10,200]". Type of info is set to numeric (float) and units to %. No multiplier.

Values logged seems to be offset by -100% meaning that no loss is logged as -100% and all loss is 0%.



 Comments   
Comment by Tais P. Hansen [ 2010 Feb 11 ]

This was working correctly in 1.8 by the way.

Comment by richlv [ 2010 Feb 11 ]

can't reproduce, works as expected here.
what does the last line look like from :
fping -p 200 -c 20 <some host>
on the zabbix server ?

Comment by Tais P. Hansen [ 2010 Feb 11 ]

a.b.c.d : xmt/rcv/%loss = 20/20/0%, min/avg/max = 0.83/1.88/8.50

Comment by richlv [ 2010 Feb 11 ]

grab item id from the url when configuring that item, then in the database :
select * from items where itemid='<that_itemid>' limit 10;

are values correct there or not ?

Comment by Tais P. Hansen [ 2010 Feb 11 ]

mysql> select * from history as h where h.itemid = 33713 limit 10;
---------------------------

itemid clock value

---------------------------

33713 1265886502 -100.0000
33713 1265886629 -100.0000
33713 1265886696 -100.0000
33713 1265886772 -100.0000
33713 1265886838 -100.0000
33713 1265886963 -100.0000
33713 1265887078 -100.0000
33713 1265887194 -100.0000
33713 1265887326 -100.0000
33713 1265887458 -100.0000

---------------------------
10 rows in set (0.01 sec)

Comment by Tais P. Hansen [ 2010 Feb 11 ]

mysql> select * from items as i where i.itemid = 33713 limit 10;
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

itemid type snmp_community snmp_oid snmp_port hostid description key_ delay history trends lastvalue lastclock prevvalue status value_type trapper_hosts units multiplier delta prevorgvalue snmpv3_securityname snmpv3_securitylevel snmpv3_authpassphrase snmpv3_privpassphrase formula error lastlogsize logtimefmt templateid valuemapid delay_flex params ipmi_sensor data_type authtype username password publickey privatekey mtime

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

33713 3 public interfaces.ifTable.ifEntry.ifInOctets.1 161 10546 icmppingloss icmppingloss[,10,200] 60 90 365 -100.000000 1265892194 -100.000000 0 0   % 0 0 NULL   0     0.001   0   32853 0       0 0         0

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 row in set (0.00 sec)

Comment by richlv [ 2010 Feb 11 ]

ergh, yes, the first one was what i had in mind - thanks for providing correct information despite incorrect instructions
do you have a chance to try svn head ? i don't see any changes for this part since 1.8.1, but just in case...

Comment by Tais P. Hansen [ 2010 Feb 11 ]

Took a while but I created a completely clean install on my local workstation using zabbix from svn head (r10101). I added a single host with a single item - icmppingloss. I still get the same result:

mysql> select * from history as h where h.itemid = 22162 limit 10;
---------------------------

itemid clock value

---------------------------

22162 1265902582 -100.0000
22162 1265902642 -100.0000
22162 1265902702 -100.0000

---------------------------
3 rows in set (0.00 sec)

Comment by Tais P. Hansen [ 2010 Feb 11 ]

I've figured out the problem but I'm not sure why Zabbix is doing what it is doing so I can't give you a patch.

Anyway, here's the story:

If Zabbix is compiled with IPv6 support it expects CONFIG_FPING6_LOCATION to be set or it won't ping at all. On Gentoo fping6 doesn't exist because fping contains the necessary patches for handling IPv6 addresses and as of v1.8.1 Gentoo enables the IPv6 useflag. To get pings working I had to point FPING6 to /usr/sbin/fping.

Next, Zabbix checks if CONFIG_SOURCE_IP is set, which it is not in my case (because I have multiple ip addresses to reach different networks). That means it'll fallback to run BOTH the fping and fping6 commands (line 93 in libs/zbxicmpping/icmpping.c "%s %s 2>&1 <%s;%s %s 2>&1 <%s") against the host effectively creating twice as many pings as requested (host->rcv is twice the items[i].count requested). This again screws up the "value_dbl = 100 * (1 - (double)hosts[h].rcv / (double)items[i].count);" calculation in pinger.c causing it to say x = 100 * (1 - 20 / 10) which gives -100.

Comment by richlv [ 2010 Feb 12 ]

thanks for the analysis, that should help a lot. issues related to fping/fping6 existence are being currently looked at, maybe this problem can be solved with that.

as for gentoo, are you installing from source or from gentoo data ? if the latter, it might be worth reporting a problem downstream so that gentoo would modify fping6 location.

Comment by Dmitry Borovikov [ 2010 Feb 12 ]

Thank You very much for the deep analysis of the issue. It really helped a lot!

Comment by Dmitry Borovikov [ 2010 Feb 12 ]

Issue ZBX-1876 will contain a necessary fix for this issue.

Comment by Dmitry Borovikov [ 2010 Feb 12 ]

Dear Tais P. Hansen,

Thank you very much for reporting this issue. It will contain a fix in the linked one.
There is a workaround for you. Your "fping" can process both IPv4 and IPv6 addresses. Besides, you make SourceIP empty due to your network conditions, so Zabbix will ping both "fping" and "fping6". So, make "Fping6Location" parameter empty by adding "Fping6Location=". Then Zabbix will use only "FpingLocation".

But such behavior will be introduced in ZBX-1876.

Regards.

Comment by Tais P. Hansen [ 2010 Feb 12 ]

Thank you. I removed ipv6 support from zabbix to work around my problem for now. We're not currently monitoring ipv6 hosts anyway so it's no loss.

Comment by Paulo Ferreira [ 2010 Oct 27 ]

Hello, as requested by Richlv after discussion on IRC channel,
This problem seems to still exist in 1.8.3:

System Information:
CentOS 5.3 : Linux hercules.sim.local 2.6.18-128.2.1.el5.028stab064.4 #1 SMP Mon Jul 27 12:45:01 MSD 2009 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=hercules.sim.local
GATEWAY=10.0.0.1

Solution, as suggested by Richlv was to uncomment the Fping6Location option on the zabbix_server.conf and set to empty

  1. Fping6Location=/usr/sbin/fping6
    Fping6Location=
    This solved the problem (please note that renaming fping6 binary also solved the problem)

server was installed from yum repository (http://centos.karan.org/ - [kbs-CentOS-Testing])

Comment by richlv [ 2010 Oct 27 ]

this was supposed to be fixed in 1.8.2, but apparently has regressed

Comment by Paulo Ferreira [ 2010 Oct 27 ]

Sorry forgot to include zabbix_server version and rpm's installed
zabbix_server_mysql -V
Zabbix Server v1.8.3 (revision 13928) (16 August 2010)
Compilation time: Sep 22 2010 12:23:29

rpm -qa * zabbix*
zabbix-web-1.8.3-2.el5.kb
zabbix-server-1.8.3-2.el5.kb
zabbix-agent-1.8.3-2.el5.kb
zabbix-server-mysql-1.8.3-2.el5.kb
zabbix-1.8.3-2.el5.kb
zabbix-web-mysql-1.8.3-2.el5.kb

Comment by Aleksandrs Saveljevs [ 2010 Dec 27 ]

Fixed in pre-1.8.4 in r16416.

Generated at Thu Apr 25 08:28:01 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.