/[smecontribs]/rpms/smeserver-zabbix-server/contribs9/smeserver-zabbix-server-0.1-zabbix4.4.6.patch
ViewVC logotype

Diff of /rpms/smeserver-zabbix-server/contribs9/smeserver-zabbix-server-0.1-zabbix4.4.6.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.2 by jpp, Sun May 10 07:29:21 2020 UTC Revision 1.3 by jpp, Thu May 14 01:17:39 2020 UTC
# Line 69  diff -Nur smeserver-zabbix-server-0.1.ol Line 69  diff -Nur smeserver-zabbix-server-0.1.ol
69       AllowOverride None       AllowOverride None
70       Order allow,deny       Order allow,deny
71       Allow from $access       Allow from $access
72    diff -Nur smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/e-smith/sql/init/80zabbix-server smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/e-smith/sql/init/80zabbix-server
73    --- smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/e-smith/sql/init/80zabbix-server     2020-05-13 12:16:30.203000000 -0400
74    +++ smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/e-smith/sql/init/80zabbix-server 2020-05-13 21:13:00.912000000 -0400
75    @@ -1,6 +1,6 @@
76     {
77    -my $db = ${'zabbix-server'}{'DbName'} || 'zabbix';
78    -my $user = ${'zabbix-server'}{'DbUser'} || 'zabbix';
79    +my $db = ${'zabbix-server'}{'DbName'} || 'zabbixdb';
80    +my $user = ${'zabbix-server'}{'DbUser'} || 'zabbixuser';
81     my $pass = ${'zabbix-server'}{'DbPassword'} || 'secret';
82    
83     my $schema = `rpm -qd zabbix-server-mysql | grep create`;
84    @@ -9,7 +9,16 @@
85     $OUT .= <<"END";
86     #! /bin/sh
87     if [ -d /var/lib/mysql/$db ]; then
88    -       for P in \$(rpm -qd zabbix-server | grep dbpatch | grep mysql); do
89    +
90    +       # check if utf8
91    +       my $curcharset=`echo 'show variables like "character_set_database";'|mysql $db|grep character_set_database|sed -r  's/^character_set_database\\s*([a-zA-Z0-9_-]+)/\\1/'`;
92    +       chomp $curcharset;
93    +       if ( $curcharset ne "utf8" ) {
94    +               echo "ALTER DATABASE DBNAME CHARACTER SET utf8 COLLATE utf8_bin;" |/usr/bin/mysql
95    +               echo 'ALTER TABLE `'.$db.'`.`problem_tag` DROP INDEX `problem_tag_1`, ADD INDEX `problem_tag_1` (`eventid`, `tag` (100), `value`(100));' |mysql
96    +               mysql --batch --skip-column-names --execute 'select concat("alter table ",TABLE_SCHEMA,".",TABLE_NAME," CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;") from information_schema.TABLES where TABLE_SCHEMA="'.$db.'"' |mysql
97    +       }
98    +       for P in \$(rpm -qd zabbix-server-mysql | grep dbpatch | grep mysql); do
99                    /usr/bin/mysql $db < \$P
100            done
101     else


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed