/[smecontribs]/rpms/smeserver-zabbix-server/contribs10/smeserver-zabbix-server-0.1-z50.patch
ViewVC logotype

Diff of /rpms/smeserver-zabbix-server/contribs10/smeserver-zabbix-server-0.1-z50.patch

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

Revision 1.1 by jpp, Sun Dec 11 01:45:54 2022 UTC Revision 1.3 by jpp, Sun Dec 11 07:04:10 2022 UTC
# Line 1  Line 1 
1  diff -Nur --no-dereference smeserver-zabbix-server-0.1.old/createlinks smeserver-zabbix-server-0.1/createlinks  diff -Nur --no-dereference smeserver-zabbix-server-0.1.old/createlinks smeserver-zabbix-server-0.1/createlinks
2  --- smeserver-zabbix-server-0.1.old/createlinks 2022-12-10 02:37:45.031000000 -0500  --- smeserver-zabbix-server-0.1.old/createlinks 2022-12-10 02:37:45.031000000 -0500
3  +++ smeserver-zabbix-server-0.1/createlinks     2022-12-10 20:44:05.704000000 -0500  +++ smeserver-zabbix-server-0.1/createlinks     2022-12-10 21:14:41.987000000 -0500
4  @@ -40,6 +40,7 @@  @@ -15,7 +15,7 @@
5     templates2events("/etc/sudoers", $event);
6     templates2events("/var/lib/zabbix/bin/sendxmpp", $event);
7     templates2events("/var/lib/zabbix/.sendxmpprc", $event);
8    -templates2events("/etc/e-smith/sql/init/80zabbix-server", qw(zabbix-server-update bootstrap-console-save));
9    +templates2events("/etc/e-smith/sql/init105/80zabbix-server", qw(zabbix-server-update bootstrap-console-save));
10     templates2events("/etc/rc.d/init.d/masq", $event);
11    
12     # Services to restart
13    @@ -40,10 +40,11 @@
14   #Systemd start stop   #Systemd start stop
15   # rpm update action (invoked by yum on install and update   # rpm update action (invoked by yum on install and update
16   $contrib = "smeserver-zabbix-server";   $contrib = "smeserver-zabbix-server";
17  +safe_symlink("/etc/e-smith/events/$contrib-update", "root/etc/e-smith/events/$contrib-z50-update");  +safe_symlink("/etc/e-smith/events/$contrib-update", "root/etc/e-smith/events/$contrib-z50-update");
18   event_actions("$contrib-update", qw(   event_actions("$contrib-update", qw(
19     systemd-default 10  -  systemd-default 10
20     systemd-reload 12  -  systemd-reload 12
21    -  zabbix-server 50
22    +  systemd-default 88
23    +  systemd-reload 89
24    +  zabbix-server 92
25     ));
26    
27     event_templates("$contrib-update", qw(
28    @@ -51,7 +52,7 @@
29       /etc/crontab
30       /etc/rc.d/init.d/masq
31       /etc/sudoers
32    -  /etc/e-smith/sql/init/80zabbix-server
33    +  /etc/e-smith/sql/init105/80zabbix-server
34       /etc/zabbix/zabbix.conf.php
35       /etc/zabbix/web/zabbix.conf.php
36       /var/lib/zabbix/bin/sendxmpp
37    @@ -67,6 +68,8 @@
38       httpd-e-smith sigusr1
39       php74-php-fpm  reload
40       masq          adjust
41    -  zabbix-server restart
42     ));
43    
44    +#zabbix server 92 will stop zabbix, restart mariadb105-mysql.init and start zabbix
45    +#that is why those services are not listed in event_service. order matter.
46    +#also this is at the end to be sure that mariadb105 is installed and running
47    diff -Nur --no-dereference 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
48    --- smeserver-zabbix-server-0.1.old/root/etc/e-smith/events/actions/zabbix-server       2022-12-10 02:37:44.990000000 -0500
49    +++ smeserver-zabbix-server-0.1/root/etc/e-smith/events/actions/zabbix-server   2022-12-10 21:12:05.409000000 -0500
50    @@ -1,7 +1,7 @@
51     #!/bin/bash
52     # restart mysql.init
53     /usr/bin/systemctl stop zabbix-server  1>/dev/null
54    -/usr/bin/systemctl restart mysql.init  1>/dev/null
55    +/usr/bin/systemctl restart mariadb105-mysql.init  1>/dev/null
56     /usr/bin/systemctl start zabbix-server 1>/dev/null
57     exit 0
58    
59    diff -Nur --no-dereference 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
60    --- smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/e-smith/sql/init/80zabbix-server     2022-12-10 02:37:45.025000000 -0500
61    +++ smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/e-smith/sql/init/80zabbix-server 1969-12-31 19:00:00.000000000 -0500
62    @@ -1,93 +0,0 @@
63    -{
64    -my $db = ${'zabbix-server'}{'DbName'} || 'zabbixdb';
65    -my $user = ${'zabbix-server'}{'DbUser'} || 'zabbixuser';
66    -my $pass = ${'zabbix-server'}{'DbPassword'} || 'secret';
67    -
68    -my $schema = `rpm -qd zabbix-server-mysql | grep create`;
69    -chomp $schema;
70    -my $curcharset=  ( -d "/var/lib/mysql/$db" ) ? `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/'` : "utf8";
71    -chomp $curcharset;
72    -my $adminpass= ${'zabbix-server'}{'AdminPassword'} || 'zabbix';
73    -
74    -$OUT .= <<"END";
75    -#! /bin/sh
76    -if [ -d /var/lib/mysql/$db ]; then
77    -
78    -       # check if utf8
79    -        if [[ "$curcharset" != "utf8" ]] ;then
80    -                echo "ALTER DATABASE $db CHARACTER SET utf8 COLLATE utf8_bin;" |/usr/bin/mysql
81    -                echo 'ALTER TABLE `$db`.`problem_tag` DROP INDEX `problem_tag_1`, ADD INDEX `problem_tag_1` (`eventid`, `tag` (100), `value`(100));' |mysql
82    -                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
83    -        fi
84    -       for P in \$(rpm -qd zabbix-server-mysql | grep dbpatch | grep mysql); do
85    -               /usr/bin/mysql $db < \$P
86    -       done
87    -else
88    -       echo "CREATE DATABASE $db CHARACTER SET utf8 COLLATE utf8_bin;" | /usr/bin/mysql
89    -       /usr/bin/gunzip < $schema |     /usr/bin/mysql $db
90    -
91    -fi
92    -
93    -/usr/bin/mysql <<EOF
94    -USE $db;
95    -update users set passwd=md5('$adminpass') where alias='Admin' and passwd=md5('zabbix');
96    -EOF
97    -
98    -
99    -/usr/bin/mysql <<EOF
100    -USE mysql;
101    -
102    -REPLACE INTO user (
103    -                     host,
104    -                     user,
105    -                     password)
106    -            VALUES (
107    -                     'localhost',
108    -                     '${'zabbix-server'}{DbUser}',
109    -                     PASSWORD ('${'zabbix-server'}{DbPassword}'));
110    -
111    -
112    -REPLACE INTO db (
113    -                   host,
114    -                   db,
115    -                   user,
116    -                   select_priv, insert_priv, update_priv, delete_priv,
117    -                   create_priv, alter_priv, index_priv, drop_priv, create_tmp_table_priv,
118    -                   grant_priv, lock_tables_priv, references_priv)
119    -          VALUES (
120    -                   'localhost',
121    -                   '${'zabbix-server'}{DbName}',
122    -                   '${'zabbix-server'}{DbUser}',
123    -                   'Y', 'Y', 'Y', 'Y',
124    -                   'Y', 'Y', 'Y', 'Y', 'Y',
125    -                   'N', 'Y', 'Y');
126    -
127    -FLUSH PRIVILEGES;
128    -
129    -USE ${'zabbix-server'}{DbName};
130    -
131    -INSERT IGNORE INTO media_type (
132    -               mediatypeid,
133    -               type, description,
134    -               smtp_server,
135    -               smtp_helo,
136    -               smtp_email,
137    -               exec_path,
138    -               gsm_modem,
139    -               username,
140    -               passwd)
141    -       VALUES(
142    -               4,
143    -               1,
144    -               'xmpp',
145    -               '',
146    -               '',
147    -               '',
148    -               'sendxmpp',
149    -               '',
150    -               '',
151    -               '');
152    -
153    -EOF
154    -END
155    -}
156    diff -Nur --no-dereference smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/e-smith/sql/init105/80zabbix-server smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/e-smith/sql/init105/80zabbix-server
157    --- smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/e-smith/sql/init105/80zabbix-server  1969-12-31 19:00:00.000000000 -0500
158    +++ smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/e-smith/sql/init105/80zabbix-server      2022-12-11 02:02:45.993000000 -0500
159    @@ -0,0 +1,73 @@
160    +{
161    +my $db = ${'zabbix-server'}{'DbName'} || 'zabbixdb';
162    +my $user = ${'zabbix-server'}{'DbUser'} || 'zabbixuser';
163    +my $pass = ${'zabbix-server'}{'DbPassword'} || 'secret';
164    +
165    +my $schema = `rpm -qd zabbix-server-mysql | grep create`;
166    +chomp $schema;
167    +my $curcharset=  ( -d "/var/lib/mysql/$db" ) ? `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/'` : "utf8";
168    +chomp $curcharset;
169    +my $adminpass= ${'zabbix-server'}{'AdminPassword'} || 'zabbix';
170    +$hashpass=`/usr/bin/htpasswd -bnBC 10 '' $adminpass | tr -d ':'`;
171    +$hashpass =~ tr/\r\n//d;
172    +$version = `/bin/ls -d /usr/share/doc/zabbix-web*|grep -Eo '[0-9.]+\$'|cut -d. -f1 || echo 4 `;
173    +$modpass=($version > 4)? "update users set passwd='$hashpass' where alias='Admin';": "#$version";
174    +$OUT .= <<"END";
175    +#! /bin/sh
176    +if [ -d /var/opt/rh/rh-mariadb105/lib/mysql/$db ]; then
177    +       # check if utf8
178    +        if [[ "$curcharset" != "utf8" ]] ;then
179    +                echo "ALTER DATABASE $db CHARACTER SET utf8 COLLATE utf8_bin;" |/usr/bin/mysql105
180    +                echo 'ALTER TABLE `$db`.`problem_tag` DROP INDEX `problem_tag_1`, ADD INDEX `problem_tag_1` (`eventid`, `tag` (100), `value`(100));' |/usr/bin/mysql105
181    +                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"' | /usr/bin/mysql105
182    +        fi
183    +       for P in \$(rpm -qd zabbix-server-mysql | grep dbpatch | grep mysql); do
184    +               /usr/bin/mysql105 $db < \$P
185    +       done
186    +else
187    +       echo "CREATE DATABASE $db CHARACTER SET utf8 COLLATE utf8_bin;" | /usr/bin/mysql105
188    +       /usr/bin/gunzip < $schema |     /usr/bin/mysql105 $db
189    +
190    +fi
191    +
192    +/usr/bin/mysql105 <<EOF
193    +USE $db;
194    +update users set passwd=md5('$adminpass') where alias='Admin' and passwd=md5('zabbix');
195    +$modpass
196    +EOF
197    +
198    +
199    +/usr/bin/mysql105 <<EOF
200    +USE mysql;
201    +
202    +grant all on $db.* to '${'zabbix-server'}{DbUser}'\@'localhost' identified by '${'zabbix-server'}{DbPassword}';
203    +
204    +FLUSH PRIVILEGES;
205    +
206    +USE ${'zabbix-server'}{DbName};
207    +
208    +INSERT IGNORE INTO media_type (
209    +               mediatypeid,
210    +               type, description,
211    +               smtp_server,
212    +               smtp_helo,
213    +               smtp_email,
214    +               exec_path,
215    +               gsm_modem,
216    +               username,
217    +               passwd)
218    +       VALUES(
219    +               4,
220    +               1,
221    +               'xmpp',
222    +               '',
223    +               '',
224    +               '',
225    +               'sendxmpp',
226    +               '',
227    +               '',
228    +               '');
229    +
230    +EOF
231    +END
232    +}
233    diff -Nur --no-dereference smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/20zabbix-server smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/20zabbix-server
234    --- smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/20zabbix-server   2022-12-10 02:37:45.009000000 -0500
235    +++ smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/20zabbix-server       2022-12-11 00:10:00.668000000 -0500
236    @@ -8,6 +8,8 @@
237         $disablefunctions = 'system, show_source, symlink, exec, dl, shell_exec, passthru, phpinfo, ' .
238                 'escapeshellarg, escapeshellcmd';
239    
240    +$socket = ( -d "/var/lib/mysql/zabbixdb") ? "/var/lib/mysql/mysql.sock" : "/var/lib/mysql/mariadb105.sock";
241    +
242         $OUT .=<<_EOF;
243    
244     [php$PHP_VERSION-$id]
245    @@ -38,14 +40,16 @@
246     php_admin_value[max_input_time] = 600
247     php_admin_value[post_max_size] = 32M
248     php_admin_value[upload_max_filesize] = 16M
249    -php_admin_value[disable_functions] = $disablefunctions;
250    -php_admin_value[open_basedir] = $openbasedir;
251    +php_admin_value[disable_functions] = $disablefunctions
252    +php_admin_value[open_basedir] = $openbasedir
253     php_admin_flag[allow_url_fopen] = on
254     php_admin_flag[file_upload] = off
255     php_admin_flag[session.cookie_httponly] = on
256     php_admin_flag[allow_url_include] = off
257     php_admin_value[session.save_handler] = files
258     php_admin_value[always_populate_raw_post_data] = -1
259    +php_value[mysqli.default_socket] = $socket
260    +php_value[mysql.default_socket] = $socket
261    
262     _EOF
263       }
264    diff -Nur --no-dereference smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/zabbix/zabbix_server.conf/80database smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_server.conf/80database
265    --- smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates/etc/zabbix/zabbix_server.conf/80database 2022-12-10 02:37:44.939000000 -0500
266    +++ smeserver-zabbix-server-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_server.conf/80database     2022-12-10 21:28:53.268000000 -0500
267    @@ -28,7 +28,8 @@
268    
269     # Connect to MySQL using Unix socket?
270    
271    -DBSocket=/var/lib/mysql/mysql.sock
272    +#DBSocket=/var/lib/mysql/mysql.sock
273    +DBSocket=/var/lib/mysql/{$OUT = ( -d "/var/lib/mysql/zabbixdb") ? "mysql" : "mariadb105"}.sock
274    
275     # Enable database cache module
276     StartDBSyncers=1
277    diff -Nur --no-dereference smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zabbix-server smeserver-zabbix-server-0.1/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zabbix-server
278    --- smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zabbix-server    2009-02-02 17:40:29.000000000 -0500
279    +++ smeserver-zabbix-server-0.1/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/80zabbix-server        1969-12-31 19:00:00.000000000 -0500
280    @@ -1 +0,0 @@
281    -PERMS=0750
282    diff -Nur --no-dereference smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init105/80zabbix-server smeserver-zabbix-server-0.1/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init105/80zabbix-server
283    --- smeserver-zabbix-server-0.1.old/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init105/80zabbix-server 1969-12-31 19:00:00.000000000 -0500
284    +++ smeserver-zabbix-server-0.1/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init105/80zabbix-server     2009-02-02 17:40:29.000000000 -0500
285    @@ -0,0 +1 @@
286    +PERMS=0750


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