[ZBX-4303] Trigger name field truncates {ITEM.LASTVALUE} to 20 characters Created: 2011 Nov 01 Updated: 2019 Jan 31 Resolved: 2015 Sep 18 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F) |
Affects Version/s: | 1.8.8 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Minor |
Reporter: | Duane Hughes | Assignee: | Unassigned |
Resolution: | Duplicate | Votes: | 0 |
Labels: | macros, triggers | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Alpine Linux 2.3 (linux-grsec 3.0.8) |
Attachments: |
![]() ![]() |
||||||||
Issue Links: |
|
Description |
When using the {ITEM.LASTVALUE} in the name field of a trigger, the output of ITEM.LASTVALUE is truncated to 20 characters. Where can I configure this? Or can this be fixed or increased to a saner value? Here is an example of the trigger name field I'm using: This yields a result of: This is truncated regardless of the width of the column. In the Monitoring > Events screen, this custom trigger's values are truncated, while other events are not truncated. |
Comments |
Comment by Duane Hughes [ 2011 Nov 01 ] |
shows typical trigger that appears correctly, followed by custom triggers with truncated values. In each case, output of {ITEM.LASTVALUE} is truncated to 20 characters. |
Comment by Igor Danoshaites (Inactive) [ 2011 Nov 01 ] |
Hi, Yes, you are right, value length of the {ITEM.LASTVALUE} macro (when used in the trigger name) is truncated to 20 symbols. But this is not a bug, this has been done by design. I just checked it in v 1.8.8 and in the latest revision from the 1.8 branch (v1.8.9rc1, rev #22853) and the behaour is the same. As I know, at this moment we do not plan to increase it's length, but you can do it on your own by changing this limit in the src code. For this you need in the frontends/php/include/items.inc.php file in the row #1433 and #1434 change this limit (for example, from 20 to 40) : if(zbx_strlen($lastvalue) > 40) $lastvalue = zbx_substr($lastvalue,0,40)." ..."; In the result in the "Monitoring->Triggers" report and in the "Monitoring->Events" report length of this field will be increased. Considering this issue resolved. |
Comment by Igor Danoshaites (Inactive) [ 2011 Nov 01 ] |
Please see my answer above. This could be changed by setting another limit in the src code. |
Comment by Duane Hughes [ 2011 Nov 01 ] |
Many thanks for the help. that worked nicely. |
Comment by Igor Danoshaites (Inactive) [ 2011 Nov 01 ] |
Thank you for your reply. Closing this answered issue. |
Comment by Arthur Ivanov [ 2015 Feb 19 ] |
why you just close that case? adding dynamic value based on profile data would be more goodness than hardcode. |
Comment by Marc [ 2015 Feb 20 ] |
See |
Comment by Divya Anurag [ 2015 Mar 18 ] |
Hi Igor, where an I find the "frontends/php/include/items.inc.php file". Does it exits on zabbix server, if yes then could you tell me the full path of it? |
Comment by Divya Anurag [ 2015 Mar 18 ] |
Just for information I am using Zabbix server version 2.2.1 on Linux. |
Comment by richlv [ 2015 Sep 18 ] |
let's handle all latest value trimming in ZBXNEXT-1016 thanks to asaveljevs for coming up with a list of related issues |
Comment by tony [ 2016 Jul 28 ] |
Somebody knows where to change the php code in version 3.0.3? We cannot find the lines in /frontends/php/items.inc.php. |
Comment by Christopher Demmer [ 2016 Aug 10 ] |
In Zabbix versions 3.0.1 you change line 901 & line 902 in the items.inc.php file from 20 to whatever length you desire. And in Zabbix versions 3.0.3 you change line 932 & line 933 in the items.inc.php file from 20 to whatever length you desire. Review screenshot-2 for the exact lines of code that need to be altered. |
Comment by Arilson Barcelos [ 2019 Jan 31 ] |
Hi everyone! Just to share that I'm using Zabbix 3.2.3 and on this version the lines that must be edited are 878 and 879. Worked fine for me! Thank you! |