1 |
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 |
3 |
+++ smeserver-zabbix-server-0.1/createlinks 2020-05-10 03:07:02.122000000 -0400 |
4 |
@@ -15,10 +15,11 @@ |
5 |
templates2events("/etc/rc.d/init.d/masq", $event); |
6 |
|
7 |
# Services to restart |
8 |
-safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init"); |
9 |
+#safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init"); |
10 |
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); |
11 |
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/zabbix-server"); |
12 |
safe_symlink("adjust", "root/etc/e-smith/events/$event/services2adjust/masq"); |
13 |
+safe_symlink("/etc/e-smith/events/actions/zabbix-server","root/etc/e-smith/events/$event/50zabbix-server"); |
14 |
|
15 |
# PHP header and footer |
16 |
safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/etc/zabbix/zabbix.conf.php/template-begin"); |
17 |
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 |
18 |
--- smeserver-zabbix-server-0.1.old/root/etc/e-smith/events/actions/zabbix-server 1969-12-31 19:00:00.000000000 -0500 |
19 |
+++ smeserver-zabbix-server-0.1/root/etc/e-smith/events/actions/zabbix-server 2020-05-10 03:05:06.278000000 -0400 |
20 |
@@ -0,0 +1,7 @@ |
21 |
+#!/bin/bash |
22 |
+# restart mysql.init |
23 |
+/sbin/service zabbix-server stop 1>/dev/null |
24 |
+/sbin/service mysql.init restart 1>/dev/null |
25 |
+/sbin/service zabbix-server start 1>/dev/null |
26 |
+exit 0 |
27 |
+ |
28 |
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 |
29 |
--- 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 |
30 |
+++ 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 |
31 |
@@ -3,13 +3,8 @@ |
32 |
my $user = ${'zabbix-server'}{'DbUser'} || 'zabbix'; |
33 |
my $pass = ${'zabbix-server'}{'DbPassword'} || 'secret'; |
34 |
|
35 |
-my $schema = `rpm -qd zabbix-server-mysql | grep schema | grep mysql`; |
36 |
-$schema = `rpm -qd zabbix-server | grep schema | grep mysql` if $schema eq ''; |
37 |
-my $data = `rpm -qd zabbix-server-mysql | grep data.sql`; |
38 |
-$data = `rpm -qd zabbix-server| grep mysql | grep data.sql` if $data eq ''; |
39 |
-my $images = `rpm -qd zabbix-server-mysql | grep images_mysql`; |
40 |
-$images = `rpm -qd zabbix-server | grep mysql |grep images` if $images eq ''; |
41 |
- |
42 |
+my $schema = `rpm -qd zabbix-server-mysql | grep create`; |
43 |
+chomp $schema; |
44 |
|
45 |
$OUT .= <<"END"; |
46 |
#! /bin/sh |
47 |
@@ -18,10 +13,9 @@ |
48 |
/usr/bin/mysql $db < \$P |
49 |
done |
50 |
else |
51 |
- /usr/bin/mysqladmin create $db |
52 |
- /usr/bin/mysql $db < $schema |
53 |
- /usr/bin/mysql $db < $data |
54 |
- /usr/bin/mysql $db < $images |
55 |
+ echo "CREATE DATABASE $db CHARACTER SET utf8 COLLATE utf8_bin;" | /usr/bin/mysql |
56 |
+ /usr/bin/gunzip < $schema | /usr/bin/mysql $db |
57 |
+ |
58 |
fi |
59 |
|
60 |
/usr/bin/mysql <<EOF |
61 |
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 |
62 |
--- 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 |
63 |
+++ 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 |
64 |
@@ -24,6 +24,7 @@ |
65 |
php_admin_value memory_limit 256M |
66 |
php_admin_value date.timezone $tz |
67 |
php_admin_value post_max_size 32M |
68 |
+ php_admin_value always_populate_raw_post_data -1 |
69 |
AllowOverride None |
70 |
Order allow,deny |
71 |
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 |