Case sensitivity in object names

Ton Voon ton.voon at altinity.com
Mon Apr 2 22:47:24 CEST 2007


Hi!

We noticed a problem with the storage of objects in the  
nagios_objects table. If you had two hosts with the same name, but in  
different cases, then only one row would be created for the both of  
them. This is because the = and LIKE operator in mysql is case  
insensitive: http://dev.mysql.com/doc/refman/4.1/en/case- 
sensitivity.html

As nagios considers these as two different objects, ndo should do too.

We fixed by altering the nagios_objects table so that the name1 and  
name2 columns were always case sensitive:

ALTER TABLE nagios_objects MODIFY name1 varchar(128) COLLATE  
latin1_bin NOT NULL default '';
ALTER TABLE nagios_objects MODIFY name2 varchar(128) COLLATE  
latin1_bin default NULL;

Is this a valid fix?

Ton

http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV




More information about the Developers mailing list