richlv
added a comment - 2010 Feb 11 14:31 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 ?

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...

richlv
added a comment - 2010 Feb 11 14:45 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...

Tais P. Hansen
added a comment - 2010 Feb 11 17:36 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)

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.

Tais P. Hansen
added a comment - 2010 Feb 11 19:02 - edited 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.

richlv
added a comment - 2010 Feb 12 10:35 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.

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

Dmitry Borovikov
added a comment - 2010 Feb 12 14:53 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.