--- rpms/smeserver-cacti/contribs10/smeserver-cacti-1.1.19-sme10.patch 2022/07/27 20:32:07 1.8 +++ rpms/smeserver-cacti/contribs10/smeserver-cacti-1.1.19-sme10.patch 2022/07/28 04:29:42 1.18 @@ -9,7 +9,7 @@ diff -Nur --no-dereference smeserver-cac )) { templates2events("/etc/cacti/db.php", $event); -@@ -22,3 +23,32 @@ +@@ -22,3 +23,34 @@ } templates2events("/etc/e-smith/sql/init/80cacti", "post-upgrade"); @@ -19,6 +19,7 @@ diff -Nur --no-dereference smeserver-cac + /etc/cacti/db.php + /etc/httpd/conf/httpd.conf + /etc/crontab ++ /etc/my.cnf + /etc/opt/remi/php74/php-fpm.d/www.conf + /etc/e-smith/sql/init/80cacti +)); @@ -26,13 +27,14 @@ diff -Nur --no-dereference smeserver-cac +event_services($event, + 'crond' => 'restart', + 'mysql.init' => 'restart', ++ 'mariadb' => 'restart', + 'httpd-e-smith' => 'sigusr1', + 'php74-php-fpm' => 'reload-or-restart' +); + +event_actions($event, -+'cacti-conf' => '50', -+'cacti-ldap' => '95' ++'cacti-conf' => '2', ++'cacti-install' => '94', +); + + @@ -136,7 +138,7 @@ diff -Nur --no-dereference smeserver-cac +#/sbin/e-smith/config getprop php74 MemoryLimit 1>/dev/null || ( config setprop php74 MemoryLimit 800M ; echo "setting php74 memory_limit 800M" ; psomething=1) +# install detect cli for php not php74 even if $php_path is set + -+[ $something == 1 ] && /usr/sbin/e-smith/expand-template /etc/my.cnf && /usr/bin/systemctl restart mariadb.service ++#[ $something == 1 ] && /sbin/e-smith/expand-template /etc/my.cnf +#[ $psomething == 1 ] && /usr/sbin/e-smith/expand-template /etc/opt/remi/php74/php.ini && /usr/bin/systemctl restart php74-php-fpm.service diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-ldap --- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap 1969-12-31 19:00:00.000000000 -0500 @@ -564,3 +566,171 @@ diff -Nur --no-dereference smeserver-cac +UID="root" GID="www" PERMS=0640 +diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/my.cnf/020cacti smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/my.cnf/020cacti +--- smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/my.cnf/020cacti 1969-12-31 19:00:00.000000000 -0500 ++++ smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/my.cnf/020cacti 2022-07-27 17:18:19.452000000 -0400 +@@ -0,0 +1,4 @@ ++#for cacti use ++innodb_buffer_pool_size=483M ++innodb_additional_mem_pool_size=80M ++innodb_flush_log_at_trx_commit=2 +diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-install smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-install +--- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-install 1969-12-31 19:00:00.000000000 -0500 ++++ smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-install 2022-07-28 00:00:45.319000000 -0400 +@@ -0,0 +1,17 @@ ++#!/bin/bash ++exit 0 ++# move to cli dir ++cd /usr/share/cacti/cli ++ ++#install, we put away, it seems that inside the event it just do not work ++/usr/bin/php74 install_cacti.php --accept-eula --install & ++pids=$! ; wait $pid; ++ ++ ++#TODO: ++#--automationmode ++#--automationrange with LAN if server-gateway; or only interface if server only ++#--lang (using an array between cacti option and system language) ++# using this to set ldap ? --ldap:dn:... ++# do we need a --mode=upgrade and a --mode=install ++ +diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-ldap +--- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap 2022-07-27 22:43:12.847000000 -0400 ++++ smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-ldap 2022-07-27 23:58:46.807000000 -0400 +@@ -19,24 +19,26 @@ + #ldap_group_require 'on' or '' + # then set our admin password + /usr/bin/mysql <,ou=Users,$DN') ; ++REPLACE INTO ${db}.settings VALUES ('auth_method','3') ; ++REPLACE INTO ${db}.settings VALUES ('cn_full_name','cn') ; ++REPLACE INTO ${db}.settings VALUES ('cn_email','mail') ; ++REPLACE INTO ${db}.settings VALUES ('path_php_binary','/usr/bin/php74') ; + ++REPLACE INTO ${db}.settings VALUES ('user_template','3'); + + # set password of admin + UPDATE ${db}.user_auth SET email_address='admin@${domain}', must_change_password='',password=md5('$adminpass'), enabled='on' WHERE username='admin' and id='1'; +diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-install smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-install +--- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-install 2022-07-28 00:24:34.405000000 -0400 ++++ smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-install 2022-07-28 00:26:59.373000000 -0400 +@@ -15,3 +15,39 @@ + # using this to set ldap ? --ldap:dn:... + # do we need a --mode=upgrade and a --mode=install + ++db=$(config getprop cacti DbDatabase || echo 'cacti_sme'); ++user=$(config getprop cacti DbUser || echo 'cacti'); ++pass=$(config getprop cacti DbPassword || echo 'changeme'); ++adminpass=$(config getprop cacti AdminPassword || echo 'changeme'); ++domain=$(config get DomainName) ++DN=$(perl -Mesmith::util -e "print esmith::util::ldapBase(\"$domain\");") ++ ++# set ldap auth with optional group ++# ldap_group_require 'on' or '': user will enable if needed. ++# then set our admin password ++/usr/bin/mysql <,ou=Users,$DN') ; ++REPLACE INTO ${db}.settings VALUES ('auth_method','3') ; ++REPLACE INTO ${db}.settings VALUES ('cn_full_name','cn') ; ++REPLACE INTO ${db}.settings VALUES ('cn_email','mail') ; ++REPLACE INTO ${db}.settings VALUES ('path_php_binary','/usr/bin/php74') ; ++ ++REPLACE INTO ${db}.settings VALUES ('user_template','3'); ++ ++# set password of admin ++UPDATE ${db}.user_auth SET email_address='admin@${domain}', must_change_password='',password=md5('$adminpass'), enabled='on' WHERE username='admin' and id='1'; ++EOF ++ +diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-ldap +--- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap 2022-07-28 00:24:34.405000000 -0400 ++++ smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-ldap 1969-12-31 19:00:00.000000000 -0500 +@@ -1,46 +0,0 @@ +-#!/bin/bash +- +-#use esmith::ConfigDB; +-#use esmith::util; +-#my $cdb = esmith::ConfigDB->open_ro(); +-#my $domain = $cdb->get_value('DomainName'); +-#my $baseDN = esmith::util::ldapBase($cdb->get_value('DomainName')); +-#print $baseDN . "\n"; +- +-db=$(config getprop cacti DbDatabase || echo 'cacti_sme'); +-user=$(config getprop cacti DbUser || echo 'cacti'); +-pass=$(config getprop cacti DbPassword || echo 'changeme'); +-adminpass=$(config getprop cacti AdminPassword || echo 'changeme'); +-domain=$(config get DomainName) +-DN=$(perl -Mesmith::util -e "print esmith::util::ldapBase(\"$domain\");") +- +- +-# set ldap auth with optional group +-#ldap_group_require 'on' or '' +-# then set our admin password +-/usr/bin/mysql <,ou=Users,$DN') ; +-REPLACE INTO ${db}.settings VALUES ('auth_method','3') ; +-REPLACE INTO ${db}.settings VALUES ('cn_full_name','cn') ; +-REPLACE INTO ${db}.settings VALUES ('cn_email','mail') ; +-REPLACE INTO ${db}.settings VALUES ('path_php_binary','/usr/bin/php74') ; +- +-REPLACE INTO ${db}.settings VALUES ('user_template','3'); +- +-# set password of admin +-UPDATE ${db}.user_auth SET email_address='admin@${domain}', must_change_password='',password=md5('$adminpass'), enabled='on' WHERE username='admin' and id='1'; +-EOF +-