1 |
diff -Nur smeserver-zabbix-server-0.1.old/createlinks smeserver-zabbix-server-0.1/createlinks |
diff -Nur smeserver-zabbix-server-0.1.old/createlinks smeserver-zabbix-server-0.1/createlinks |
2 |
--- smeserver-zabbix-server-0.1.old/createlinks 2020-05-10 01:38:01.417000000 -0400 |
--- smeserver-zabbix-server-0.1.old/createlinks 2020-05-13 22:05:14.431000000 -0400 |
3 |
+++ smeserver-zabbix-server-0.1/createlinks 2020-05-10 03:07:02.122000000 -0400 |
+++ smeserver-zabbix-server-0.1/createlinks 2020-05-13 22:18:11.840000000 -0400 |
4 |
@@ -15,10 +15,11 @@ |
@@ -8,6 +8,8 @@ |
5 |
|
templates2events("/etc/httpd/conf/httpd.conf", $event); |
6 |
|
templates2events("/etc/zabbix/zabbix_server.conf", qw(zabbix-server-update bootstrap-console-save)); |
7 |
|
templates2events("/etc/zabbix/zabbix.conf.php", qw(zabbix-server-update bootstrap-console-save)); |
8 |
|
+# new path with zabbix 4.4.6 |
9 |
|
+templates2events("/etc/zabbix/web/zabbix.conf.php", qw(zabbix-server-update bootstrap-console-save)); |
10 |
|
templates2events("/etc/sudoers", $event); |
11 |
|
templates2events("/var/lib/zabbix/bin/sendxmpp", $event); |
12 |
|
templates2events("/var/lib/zabbix/.sendxmpprc", $event); |
13 |
|
@@ -15,10 +17,11 @@ |
14 |
templates2events("/etc/rc.d/init.d/masq", $event); |
templates2events("/etc/rc.d/init.d/masq", $event); |
15 |
|
|
16 |
# Services to restart |
# Services to restart |
25 |
safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/etc/zabbix/zabbix.conf.php/template-begin"); |
safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/etc/zabbix/zabbix.conf.php/template-begin"); |
26 |
diff -Nur smeserver-zabbix-server-0.1.old/root/etc/e-smith/events/actions/zabbix-server smeserver-zabbix-server-0.1/root/etc/e-smith/events/actions/zabbix-server |
diff -Nur smeserver-zabbix-server-0.1.old/root/etc/e-smith/events/actions/zabbix-server smeserver-zabbix-server-0.1/root/etc/e-smith/events/actions/zabbix-server |
27 |
--- smeserver-zabbix-server-0.1.old/root/etc/e-smith/events/actions/zabbix-server 1969-12-31 19:00:00.000000000 -0500 |
--- smeserver-zabbix-server-0.1.old/root/etc/e-smith/events/actions/zabbix-server 1969-12-31 19:00:00.000000000 -0500 |
28 |
+++ smeserver-zabbix-server-0.1/root/etc/e-smith/events/actions/zabbix-server 2020-05-10 03:05:06.278000000 -0400 |
+++ smeserver-zabbix-server-0.1/root/etc/e-smith/events/actions/zabbix-server 2020-05-13 22:05:54.925000000 -0400 |
29 |
@@ -0,0 +1,7 @@ |
@@ -0,0 +1,7 @@ |
30 |
+#!/bin/bash |
+#!/bin/bash |
31 |
+# restart mysql.init |
+# restart mysql.init |
35 |
+exit 0 |
+exit 0 |
36 |
+ |
+ |
37 |
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 |
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 |
38 |
--- smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/e-smith/sql/init/80zabbix-server 2020-05-10 01:38:01.438000000 -0400 |
--- smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/e-smith/sql/init/80zabbix-server 2020-05-13 22:05:14.450000000 -0400 |
39 |
+++ smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/e-smith/sql/init/80zabbix-server 2020-05-10 02:48:12.255000000 -0400 |
+++ smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/e-smith/sql/init/80zabbix-server 2020-05-13 22:07:18.871000000 -0400 |
40 |
@@ -3,13 +3,8 @@ |
@@ -1,27 +1,30 @@ |
41 |
my $user = ${'zabbix-server'}{'DbUser'} || 'zabbix'; |
{ |
42 |
|
-my $db = ${'zabbix-server'}{'DbName'} || 'zabbix'; |
43 |
|
-my $user = ${'zabbix-server'}{'DbUser'} || 'zabbix'; |
44 |
|
+my $db = ${'zabbix-server'}{'DbName'} || 'zabbixdb'; |
45 |
|
+my $user = ${'zabbix-server'}{'DbUser'} || 'zabbixuser'; |
46 |
my $pass = ${'zabbix-server'}{'DbPassword'} || 'secret'; |
my $pass = ${'zabbix-server'}{'DbPassword'} || 'secret'; |
47 |
|
|
48 |
-my $schema = `rpm -qd zabbix-server-mysql | grep schema | grep mysql`; |
-my $schema = `rpm -qd zabbix-server-mysql | grep schema | grep mysql`; |
54 |
- |
- |
55 |
+my $schema = `rpm -qd zabbix-server-mysql | grep create`; |
+my $schema = `rpm -qd zabbix-server-mysql | grep create`; |
56 |
+chomp $schema; |
+chomp $schema; |
57 |
|
+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/'`; |
58 |
|
+chomp $curcharset; |
59 |
|
|
60 |
$OUT .= <<"END"; |
$OUT .= <<"END"; |
61 |
#! /bin/sh |
#! /bin/sh |
62 |
@@ -18,10 +13,9 @@ |
if [ -d /var/lib/mysql/$db ]; then |
63 |
|
- for P in \$(rpm -qd zabbix-server | grep dbpatch | grep mysql); do |
64 |
|
+ |
65 |
|
+ # check if utf8 |
66 |
|
+ if [[ "$curcharset" != "utf8" ]] ;then |
67 |
|
+ echo "ALTER DATABASE $db CHARACTER SET utf8 COLLATE utf8_bin;" |/usr/bin/mysql |
68 |
|
+ echo 'ALTER TABLE `$db`.`problem_tag` DROP INDEX `problem_tag_1`, ADD INDEX `problem_tag_1` (`eventid`, `tag` (100), `value`(100));' |mysql |
69 |
|
+ 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 |
70 |
|
+ fi |
71 |
|
+ for P in \$(rpm -qd zabbix-server-mysql | grep dbpatch | grep mysql); do |
72 |
/usr/bin/mysql $db < \$P |
/usr/bin/mysql $db < \$P |
73 |
done |
done |
74 |
else |
else |
83 |
|
|
84 |
/usr/bin/mysql <<EOF |
/usr/bin/mysql <<EOF |
85 |
diff -Nur smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98zabbix-web smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98zabbix-web |
diff -Nur smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98zabbix-web smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98zabbix-web |
86 |
--- smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98zabbix-web 2020-05-10 01:38:01.436000000 -0400 |
--- smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98zabbix-web 2020-05-13 22:05:14.446000000 -0400 |
87 |
+++ smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98zabbix-web 2020-05-10 02:47:42.612000000 -0400 |
+++ smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98zabbix-web 2020-05-13 22:05:54.925000000 -0400 |
88 |
@@ -24,6 +24,7 @@ |
@@ -24,6 +24,7 @@ |
89 |
php_admin_value memory_limit 256M |
php_admin_value memory_limit 256M |
90 |
php_admin_value date.timezone $tz |
php_admin_value date.timezone $tz |
93 |
AllowOverride None |
AllowOverride None |
94 |
Order allow,deny |
Order allow,deny |
95 |
Allow from $access |
Allow from $access |
96 |
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 |
diff -Nur smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates.metadata/etc/zabbix/web/zabbix.conf.php smeserver-zabbix-server-0.1/root/etc/e-smith/templates.metadata/etc/zabbix/web/zabbix.conf.php |
97 |
--- 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 |
--- smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates.metadata/etc/zabbix/web/zabbix.conf.php 1969-12-31 19:00:00.000000000 -0500 |
98 |
+++ 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 |
+++ smeserver-zabbix-server-0.1/root/etc/e-smith/templates.metadata/etc/zabbix/web/zabbix.conf.php 2020-05-13 22:15:54.659000000 -0400 |
99 |
@@ -1,6 +1,6 @@ |
@@ -0,0 +1,3 @@ |
100 |
{ |
+TEMPLATE_PATH="/etc/zabbix/zabbix.conf.php" |
101 |
-my $db = ${'zabbix-server'}{'DbName'} || 'zabbix'; |
+OUTPUT_FILENAME="/etc/zabbix/web/zabbix.conf.php" |
|
-my $user = ${'zabbix-server'}{'DbUser'} || 'zabbix'; |
|
|
+my $db = ${'zabbix-server'}{'DbName'} || 'zabbixdb'; |
|
|
+my $user = ${'zabbix-server'}{'DbUser'} || 'zabbixuser'; |
|
|
my $pass = ${'zabbix-server'}{'DbPassword'} || 'secret'; |
|
|
|
|
|
my $schema = `rpm -qd zabbix-server-mysql | grep create`; |
|
|
@@ -9,7 +9,16 @@ |
|
|
$OUT .= <<"END"; |
|
|
#! /bin/sh |
|
|
if [ -d /var/lib/mysql/$db ]; then |
|
|
- for P in \$(rpm -qd zabbix-server | grep dbpatch | grep mysql); do |
|
102 |
+ |
+ |
|
+ # check if utf8 |
|
|
+ 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/'`; |
|
|
+ chomp $curcharset; |
|
|
+ if ( $curcharset ne "utf8" ) { |
|
|
+ echo "ALTER DATABASE DBNAME CHARACTER SET utf8 COLLATE utf8_bin;" |/usr/bin/mysql |
|
|
+ echo 'ALTER TABLE `'.$db.'`.`problem_tag` DROP INDEX `problem_tag_1`, ADD INDEX `problem_tag_1` (`eventid`, `tag` (100), `value`(100));' |mysql |
|
|
+ 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 |
|
|
+ } |
|
|
+ for P in \$(rpm -qd zabbix-server-mysql | grep dbpatch | grep mysql); do |
|
|
/usr/bin/mysql $db < \$P |
|
|
done |
|
|
else |
|