[ZBX-1038] diff in trigger on a text item does not work Created: 2009 Sep 15 Updated: 2017 May 30 Resolved: 2010 Oct 19 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Server (S) |
Affects Version/s: | 1.6.5, 1.6.6 |
Fix Version/s: | 1.8.4 |
Type: | Incident report | Priority: | Major |
Reporter: | Jasper Spit | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
RHEL5 |
Attachments: | arcconf_cli.fulltext0.txt fix-diff-on-text-item-1.8.3.patch fix-diff-on-text-item.patch | ||||||||
Issue Links: |
|
Description |
I want to receive a notification when the output of a command (item) run by the Zabbix agent changes. So I created a text item that will contain the output of said command. I can see in Latest data that this works ok. Now I create a trigger on this item: {tpl-RedHat-Linux-Cluster:cluster.clustat[].diff(0)}=1 and expect the trigger to fire when the output of the command changes, but this does not happen ! |
Comments |
Comment by Jasper Spit [ 2009 Sep 15 ] |
Tested on 1.6.5 and 1.6.6. |
Comment by Jasper Spit [ 2009 Sep 15 ] |
I found this thread just now: http://www.zabbix.com/forum/showthread.php?t=3658&highlight=text+difference so it seems this has been an issue for quite some time. |
Comment by Alexei Vladishev [ 2009 Sep 15 ] |
Thanks for reporting this. We need some time to confirm it. |
Comment by Jasper Spit [ 2009 Sep 15 ] |
I was looking at the Zabbix sources. This may have something to do with the fact that my item text contains newlines. Perhaps the strcmp function used for diff() only looks at the first line in the item text, which never changes. The entire item text contains about 15 lines. |
Comment by richlv [ 2009 Sep 17 ] |
maybe patch at http://www.zabbix.com/forum/showthread.php?p=47193 is relevant |
Comment by Jasper Spit [ 2009 Sep 22 ] |
Thanks for the patch, it was relevant to this problem. It fixes evaluate_LAST for text items so that the complete text is returned instead of the first 255 chars. Using this patch I was able to also fix evaluate_function for diff() on text items. I have incorporated both patches into one patch and attached it. It was tested on zabbix 1.6.6. |
Comment by Jasper Spit [ 2009 Dec 09 ] |
It seems this patch has not made it into 1.8. I really need this functionality to work before I can upgrade. Can you please incorporate it into 1.8.1 ? |
Comment by Uli Stärk [ 2010 Feb 26 ] |
What about this bugreport? I think I just ran into the same issue: =1 |
Comment by Jasper Spit [ 2010 Aug 17 ] |
Patch for Zabbix 1.8.3 |
Comment by Jasper Spit [ 2010 Aug 17 ] |
Here's a patch for 1.8.3. Any idea when this will be fixed properly ? It's a pain to have to patch this myself every major release. |
Comment by Alexander Vladishev [ 2010 Aug 23 ] |
This will be fixed in 2.0 by changing items.lastvalue and items.prevvalue to be of type text, rather than varchar(255). |
Comment by Aleksandrs Saveljevs [ 2010 Oct 15 ] |
Fixed for 1.8 in development branch svn://svn.zabbix.com/branches/dev/zbx-1038. The question remains how we wish this fixed in 2.0. Either we merge all changes in the branch into the trunk and revert the changes to items.lastvalue and items.prevvalue made earlier, or we merge the changes in the branch, except revision 14919, and keep the change to items.lastvalue and items.prevvalue. |
Comment by Aleksandrs Saveljevs [ 2010 Oct 19 ] |
Merged into pre-1.8.4 in r14934. For 2.0, we reverted the changes to the items table made earlier. |
Comment by Jasper Spit [ 2011 Dec 14 ] |
Hello, I am still having this issue with Zabbix 1.8.7. |
Comment by Jasper Spit [ 2011 Dec 14 ] |
Ignore that please, I made a mistake in version numbers. Will now test if it is ok. |