[ZBX-9455] host prototype name limit is still 64chars Created: 2015 Apr 06  Updated: 2017 May 30  Resolved: 2016 Jun 06

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.4.4
Fix Version/s: 3.0.4rc1, 3.2.0alpha1

Type: Incident report Priority: Trivial
Reporter: Peter Kubicsek Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: api, lld, patch
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

all



 Description   

According to ZBX-7720, limit for host prototype name and visible name should be longer than 64 characters. Frontend doesn't allow that. Fix is easy in frontend, but i'm not sure about other things, although i tested it through lld discovery. Probably fix is needed on network discovery too.

+++ include/classes/api/services/CHostPrototype.php	2015-04-06 02:46:05.347462890 +0300
@@ -168,7 +168,7 @@
 		return array(
 			'validators' => array(
 				'host' => new CLldMacroStringValidator(array(
-					'maxLength' => 64,
+					'maxLength' => 128,
 					'regex' => '/^('.ZBX_PREG_INTERNAL_NAMES.'|\{#'.ZBX_PREG_MACRO_NAME_LLD.'\})+$/',
 					'messageEmpty' => _('Empty host.'),
 					'messageMaxLength' => _('Host name "%1$s" is too long, it must not be longer than %2$d characters.'),

+++ include/views/configuration.host.prototype.edit.php	2015-04-06 02:31:14.751925319 +0300
@@ -61,13 +61,13 @@
 }

 $hostTB = new CTextBox('host', $hostPrototype['host'], ZBX_TEXTBOX_STANDARD_SIZE, (bool) $hostPrototype['templateid']);
-$hostTB->setAttribute('maxlength', 64);
+$hostTB->setAttribute('maxlength', 128);
 $hostTB->setAttribute('autofocus', 'autofocus');
 $hostList->addRow(_('Host name'), $hostTB);

 $name = ($hostPrototype['name'] != $hostPrototype['host']) ? $hostPrototype['name'] : '';
 $visiblenameTB = new CTextBox('name', $name, ZBX_TEXTBOX_STANDARD_SIZE, (bool) $hostPrototype['templateid']);
-$visiblenameTB->setAttribute('maxlength', 64);
+$visiblenameTB->setAttribute('maxlength', 128);
 $hostList->addRow(_('Visible name'), $visiblenameTB);

// display inherited parameters only for hosts prototypes on hosts



 Comments   
Comment by Gunars Pujats (Inactive) [ 2016 May 30 ]

(1) No translation strings changed.

sasha Changes in r60501:

Strings deleted:

  • Host name "%1$s" is too long, it must not be longer than %2$d characters.

RESOLVED

sasha CLOSED

Comment by Gunars Pujats (Inactive) [ 2016 May 30 ]

RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-9455

Comment by Alexander Vladishev [ 2016 Jun 03 ]

Successfully tested! Take a look at my changes in r60501.

gunarspujats CLOSED

Comment by Gunars Pujats (Inactive) [ 2016 Jun 06 ]

Fixed in:

  • pre-3.0.4rc1 r60531
  • pre-3.1.0 (trunk) r60532
Comment by Gunars Pujats (Inactive) [ 2016 Jun 06 ]

(2) updated API documentation:

sasha CLOSED

Generated at Thu Mar 28 19:19:48 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.