--- rpms/smeserver-cacti/contribs10/smeserver-cacti-1.1.19-sme10.patch 2022/07/27 21:43:39 1.9 +++ rpms/smeserver-cacti/contribs10/smeserver-cacti-1.1.19-sme10.patch 2022/07/28 04:38:16 1.19 @@ -34,7 +34,7 @@ diff -Nur --no-dereference smeserver-cac + +event_actions($event, +'cacti-conf' => '2', -+'cacti-ldap' => '95' ++'cacti-install' => '94', +); + + @@ -574,3 +574,163 @@ diff -Nur --no-dereference smeserver-cac +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 ++ ++# 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 || exit 0 ++ ++ ++ ++#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 +-