[ZBX-8030] HOSTNAME macro is incorrect in map Created: 2014 Apr 03  Updated: 2017 May 30  Resolved: 2014 Apr 07

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.0.11, 2.2.3rc1
Fix Version/s: 2.0.12rc1, 2.2.4rc1, 2.3.0

Type: Incident report Priority: Trivial
Reporter: MATSUDA Daiki Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: macros, maps
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

HOSTNAME macros is incorrect in map.

Followings is the souce code frontends/php/include/maps.inc.php of 2.0.11.
309 // resolves basic macros
310 // $hostsByNr possible keys: '' and 1-9
311 foreach ($hostsByNr as $i => $host) {
312 $replace = array(
313 '

{HOST.NAME'.$i.'}

' => $host['name'],
314 '

{HOSTNAME'.$i.'}' => $host['name'],
315 '{HOST.HOST'.$i.'}' => $host['host'],
316 '{HOST.DNS'.$i.'}' => $host['dns'],
317 '{HOST.IP'.$i.'}' => $host['ip'],
318 '{IPADDRESS'.$i.'}' => $host['ip'],
319 '{HOST.CONN'.$i.'}' => $host['useip'] ? $host['ip'] : $host['dns'],
320 );
321 $label = str_replace(array_keys($replace), $replace, $label);
322 }

l.314 must be
'{HOSTNAME'.$i.'}

' => $host['host'],



 Comments   
Comment by Eduards Samersovs (Inactive) [ 2014 Apr 07 ]

2.0 fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-8030
trunk fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-8030-trunk

Comment by Pavels Jelisejevs (Inactive) [ 2014 Apr 07 ]

TESTED.

Comment by Eduards Samersovs (Inactive) [ 2014 Apr 07 ]

Fixed in versions 2.3.0 (trunk) r.44148, 2.2.4rc1 r.44146, 2.0.12rc1 r.44145

Generated at Fri Apr 19 09:58:00 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.