[ZBXNEXT-702] Compare last "text" value with any other string Created: 2011 Mar 15 Updated: 2024 Apr 10 Resolved: 2020 Jun 04 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Server (S) |
Affects Version/s: | 1.8.3, 4.0.4 |
Fix Version/s: | 5.0.0rc1, 5.0 (plan) |
Type: | New Feature Request | Priority: | Minor |
Reporter: | Bernard SCHÜPBACH | Assignee: | Artjoms Rimdjonoks |
Resolution: | Fixed | Votes: | 48 |
Labels: | expressions, newtriggerfunction, trigger | ||
Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
Environment: |
Zabbix 1.8.3 Server on SLES 10, mySQL DB |
Attachments: |
![]() ![]() |
||||||||||||||||||||||||||||||||||||||||||||
Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||
Sub-Tasks: |
|
||||||||||||||||||||||||||||||||||||||||||||
Team: | |||||||||||||||||||||||||||||||||||||||||||||
Sprint: | Sprint 61 (Feb 2020), Sprint 62 (Mar 2020), Sprint 63 (Apr 2020), Sprint 64 (May 2020), Sprint 65 (Jun 2020) | ||||||||||||||||||||||||||||||||||||||||||||
Story Points: | 2 |
Description |
http://www.zabbix.com/forum/showthread.php?p=81507 I want to be able to compare text value (containing space, slash, colon) with earlier value, not previous. somthing like: ({host:list_partition[].last(#1)}={host:list_partition[].last(#2)})&({host:list_partition[].last(#1)}#{host:list_partition[].last(#3)}) But I have the following error in my server log: How can I do this compare ? |
Comments |
Comment by Oleksii Zagorskyi [ 2011 Mar 27 ] |
Just a note: "1) All functions return numeric values only. Comparison to strings is not supported, for example." |
Comment by Pascal Uhlmann [ 2014 Jun 05 ] |
Comparing two string items is very important. So I hope this feature will be added soon. |
Comment by Alexei Vladishev [ 2014 Sep 26 ] |
See also |
Comment by tagwolf [ 2014 Dec 10 ] |
I know you guys probably look at number of requests for a feature. In this instance, I ask that you please don't do that, but instead look at what having this ability, and the abilities in ZBXNEXT-2527 would give the user. We basically wouldn't need to utilize userparameters and scripts anymore for a large percentage of the checks and triggers that we do today. Thank you for your time! |
Comment by Robin Roevens [ 2015 Apr 27 ] |
A suggestion to implement this request is to add the ability to functions like change and abschange to not only compare between last and previous values, but also between other values: ({host:list_partition[].last(#1)}={host:list_partition[].last(#2)})&({host:list_partition[].last(#1)}#{host:list_partition[].last(#3)}) could then be implemented as such where .change compares between last value and the given most recent value: ({host:list_partition[].change(#2)}=0&({host:list_partition[].change(#3)}=1 Extending this even more to comparing any value to any value by supporting 2 parameters: ({host:list_partition[].change(#3,#5)}=0&({host:list_partition[].change(#4,#6)}=1 which would compare the 3th against the 5th value and the 4th against the 6th value. (not sure what use case it would have in this example, but for flexibility I think it is best to consider this also) This method of-course is not so flexible that it could be used for |
Comment by richlv [ 2015 Nov 02 ] |
(1) it would be also useful to specify how the comparison of greater/less than works - enabling version comparison, for example. see "sort -V" : $ echo -e "11.2\n2.11" | sort 11.2 2.11 $ echo -e "11.2\n2.11" | sort -V 2.11 11.2 otherwise comparing software versions would be unreliable glebs.ivanovskis Slightly better illustration: $ echo -e "1.9\n2.2\n2.10" | sort 1.9 2.10 2.2 $ echo -e "1.9\n2.2\n2.10" | sort -r 2.2 2.10 1.9 $ echo -e "1.9\n2.2\n2.10" | sort -V 1.9 2.2 2.10 $ echo -e "1.9\n2.2\n2.10" | sort -V -r 2.10 2.2 1.9 |
Comment by Johannes T. [ 2016 Sep 21 ] |
|
Comment by Brian Smyk [ 2016 Oct 28 ] |
I vote for this issue. I need to be able to compare the last 3 values of a text item to ensure they match. |
Comment by Sean Nienaber [ 2017 Feb 06 ] |
I would also like to see this feature please. |
Comment by Shane Arnold [ 2018 Mar 27 ] |
Adding my vote, would also help address the feature request I just added (ZBXNEXT-4449). |
Comment by richlv [ 2018 Jun 27 ] |
Johannes, the issue you referenced is titled "Capability to rotate the labels" - you probably intended to link to a different issue. |
Comment by Ian Kelly [ 2018 Sep 11 ] |
Just wanted to add my support for this. I'm trying to compare strings from system.localtime<local> which returns strings, whereas UTC returns a number. I've got a regex to get just the timezone info eg +01:00 I'd like to create a trigger that goes off if the value returned differs from a reference comparison value, in the same trigger something like. {Template Timezone CET Check:system.localtime[local].str == {ALT_HOST:system.localtime[local].str} this is not a sync check, but to ensure servers in the various templates are on the correct TZ. But the ability to compare strings would seem like a HUGE advantage. Please consider seriously this feature request.
Thanks |
Comment by Justin Addams [ 2019 Jan 30 ] |
As per Forum Post this feature would be greatly appreciated, I've added my vote |
Comment by Alexei Vladishev [ 2020 Jan 24 ] |
Thanks for your votes. We already started initial research, if everything goes fine this functionality has all chances to be included into Zabbix 5.0. Finally! |
Comment by Héctor Sánchez [ 2020 Mar 25 ] |
I would like this feature also ( |
Comment by Artjoms Rimdjonoks [ 2020 Apr 17 ] |
Available in versions:
|
Comment by dimir [ 2020 Apr 20 ] |
Could not quickly make it out of the spec, do I understand it correctly that this task is limited to single item, i. e. I will not be able to compare the strings returned by different items, e. g.: {host:foo.last()} = {host:bar.last()} ? <dimir> OK, will update ticket title then, it's misleading to users. |