View Full Version : Zabbix Version 1.1.5 - Can not add host names with a dash
Palmertree
27-01-2007, 07:28
Is anyone else experiencing this issue in version 1.1.5. If you try and add a host name with a dash "-", I get an error saying that it is not allowed but it's showen in the allowed list. I used dashes plenty of times before in the hostname. :eek:
I get this message:
[ERROR:Cannot update host]
Hostname should contain '0-9a-zA-Z_.-$' characters only
Host I am trying to add is Computer-Test
Palmertree
27-01-2007, 08:05
Compared the hosts.inc.php to a Zabbix version 1.1.4 and I found that the line below was different:
Version 1.1.5:
function db_save_host($host,$port,$status,$useip,$ip,$templ ateid,$hostid=NULL)
{
if (!eregi('^([0-9a-zA-Z\_\.-\$]+)$', $host))
Version 1.1.4:
function db_save_host($host,$port,$status,$useip,$ip,$templ ateid,$hostid=NULL)
{
if (!eregi('^([0-9a-zA-Z\_\.-]+)$', $host))
I remodified the code in 1.1.5 and it seems to be working again with dashes. Hopefully I did not break anything else.
;)
Sorry for this problem. Correct fix is:
function db_save_host($host,$port,$status,$useip,$ip,$templ ateid,$hostid=NULL)
{
if (!eregi('^([0-9a-zA-Z\_\.\$-]+)$', $host))
Palmertree
27-01-2007, 19:26
Thanks Alex for the quick reply. I will make the adjustments. :)
I applied this patch, but I still get "expression does not match" errors for all my hosts that have dashes in their hostname! This happens if I update a trigger, for example.
James Wells
29-01-2007, 22:57
Greetings,
I applied this patch, but I still get "expression does not match" errors for all my hosts that have dashes in their hostname! This happens if I update a trigger, for example.
Please see BUG: Arithmetic Minus Not Supported In Triggers (http://www.zabbix.com/forum/showthread.php?t=4989) to see how to fix that one.
Greetings,
Please see BUG: Arithmetic Minus Not Supported In Triggers (http://www.zabbix.com/forum/showthread.php?t=4989) to see how to fix that one.
Although I probably would have hit that bug eventually, I found my problem is in config.inc.php line 683:
if (eregi('^\{([0-9a-zA-Z\_\.-\$]+)\: ......
should be
if (eregi('^\{([0-9a-zA-Z\_\.\$-]+)\: .....
nevzorofff
24-10-2008, 10:47
Why dosn't allowed to use national characters in hostname(not in DNS)?
Russian trigger i can set, but hostname - can't.
Same issue here in version 1.6.1: It's not possible to add hostnames with dashes. This should be filed as bug because the hostname field must accept any character that is allowed for hostnames.