[ZBX-3423] value mapping not performed for {ITEM.VALUE} inside trigger names Created: 2011 Jan 14 Updated: 2017 May 30 Resolved: 2012 Jun 19 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F) |
Affects Version/s: | 1.8.3, 1.8.4, 1.8.10, 1.9.9 (beta) |
Fix Version/s: | 1.8.14rc1, 2.0.1, 2.1.0 |
Type: | Incident report | Priority: | Major |
Reporter: | Dmitrij Gavrilenko | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 1 |
Labels: | macros, valuemapping | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Zabbix 1.8.4 |
Attachments: | 2011.01.13 ValueMapping - ConfigVM.JPG 2011.01.13 ValueMapping - Email.JPG 2011.01.13 ValueMapping - Events.JPG 2011.01.13 ValueMapping - ItemConfig.JPG 2011.01.13 ValueMapping - LastValue.JPG 2011.01.13 ValueMapping - TriggerConfig.JPG | ||||||||
Issue Links: |
|
Description |
Problem similar to that described by me in For the macro {ITEM.VALUE} data correctly substituted for notification via e-mail. ??? ??????? {ITEM.VALUE} ?????? ????????? ????????????? ??? ??????????? ?? ??????????? ?????. |
Comments |
Comment by José Roberto Prado [ 2011 May 11 ] |
I suffer with this problem. I do not use {ITEM.LASTVALUE} lose because the historical of events, which is only possible with {ITEM.VALUE}. Can anything be done to bypass this problem? Any predictions to fix? Zabbix Version 1.8.4 |
Comment by Dmitrij Gavrilenko [ 2011 Jun 01 ] |
Для решения данной проблемы выполнил модификацию файла zabbix-1.8.5/frontends/php/include/triggers.inc.php в строках 1633-1639 строки: $macro = '{ITEM.VALUE'.($i ? $i : '').'}'; if(zbx_strstr($description, $macro)){ $value=($flag==ZBX_FLAG_TRIGGER)? trigger_get_func_value($row['expression'],ZBX_FLAG_TRIGGER,$i ? $i : 1, 1): trigger_get_func_value($row['expression'],ZBX_FLAG_EVENT,$i ? $i : 1, $row['clock']); $description = str_replace($macro, $value, $description); } заменил на: $macro = '{ITEM.VALUE'.($i ? $i : '').'}'; if(zbx_strstr($description, $macro)){ $value=($flag==ZBX_FLAG_TRIGGER)? trigger_get_func_value($row['expression'],ZBX_FLAG_TRIGGER,$i ? $i : 1, 1): trigger_get_func_value($row['expression'],ZBX_FLAG_EVENT,$i ? $i : 1, $row['clock']) // $description = str_replace($macro, $value, $description); $functionid = trigger_get_N_functionid($row['expression'], $i ? $i : 1); if(isset($functionid)){ $sql = 'SELECT i.lastvalue, i.value_type, i.itemid, i.valuemapid, i.units '. ' FROM items i, functions f '. ' WHERE i.itemid=f.itemid '. ' AND f.functionid='.$functionid; $row2=DBfetch(DBselect($sql)); $row2['lastvalue'] = $value; $description = str_replace($macro, format_lastvalue($row2), $description); } } Сдела некий симбиоз обработки маппирования для макросов {ITEM.VALUE} и {ITEM.LASTVALUE} |
Comment by José Roberto Prado [ 2011 Jun 06 ] |
Thank you. It worked very well in both the 1.8.3 and the 1.8.5 version. Just an observation: with the change I noticed that the text of trigger were shortened. But this is no problem for me. |
Comment by Alexander Vladishev [ 2012 Jun 19 ] |
Fixed with |