[ZBX-7958] Duplicate Applications can't be assigned to same host if case is different. Created: 2014 Mar 18  Updated: 2017 May 30  Resolved: 2014 Mar 18

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.2.1, 2.2.2
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Yannick Moussette Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: applications
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Zabbix 2.2.1 on CentOs 6.5 using MySql database backend.


Issue Links:
Duplicate
duplicates ZBX-6323 instructions should call for case sen... Closed

 Description   

when assigning different templates that add items to the same application, if the Application name's case is not respected.

In Example, if I was to link a template that defines Application "os" (lowercase) to a host that already had the "OS" (uppercase) application, we get the following error message:

Error in query [INSERT INTO applications (name,hostid,applicationid) VALUES ('os','10106','597') ] [Duplicate entry '10106-os' for key 'applications_2']
SQL statement execution has failed "INSERT INTO applications (name,hostid,applicationid) VALUES ('os','10106','597') ".

If I was to change the template to use uppercase "OS" instead, I would not get the error message, and the template would be succesfully linked.

I think this is mostly a standardization issue: Either Applications are case-sensitive and allow for same-name applications with different "case" to co-exist (Application, APPLICATION, application), or they are case-insensitive, and as such should be
mapped" to the current Application name, even if "case" is different (Application, APPLICATION, application --> Application).



 Comments   
Comment by Aleksandrs Saveljevs [ 2014 Mar 18 ]

ZBX-6323 might be related. It is best to create a case-sensitive MySQL database.

Comment by Yannick Moussette [ 2014 Mar 18 ]

Understood, I'll try altering my database as outlined in ZBX-6323 and see if that fixes it.

Thanks,

Yannick.

Comment by Yannick Moussette [ 2014 Mar 18 ]

Confirmed, doing the following to change the MySQL database to case-sensitive database does resolve the issue. Adding an identical but "case-different" Application creates a new Application with respect to the "case" used.

The problem being resolved, is having multiple similar Applications with different "case" something that is wanted, or should they all be "Merged" with similar Application, irregardless of case?

I used these commands, as per ZBX-6323, to convert my database:

1- Stop Zabbix Server
2- Backup current Zabbix Database:
mysqldump -u root -p zabbix > zabbix_db_backup_pre_UTF8_case_20140318.sql
3- logon to mysql db:
mysql -u root -p
4- Alter Zabbix Database:
ALTER DATABASE zabbix DEFAULT CHARACTER SET utf8 COLLATE utf8mb4_bin;
exit
5- Alter Zabbix Tables:
for table in $(echo "show tables;" | mysql -u root -p<your_pwd> zabbix); do echo "ALTER TABLE $table CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;" | mysql -u root -p<your_pwd> zabbix; done

For anyone reading this, please refer to ZBX-6323 if any database impacts are encountered.

Thanks,

Yannick.

Comment by richlv [ 2014 Mar 18 ]

zabbix entities are mostly case-sensitive, so this works as intended - thanks for confirming

Generated at Tue Apr 23 09:40:03 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.