/[smecontribs]/rpms/smeserver-cacti/contribs10/smeserver-cacti-1.1.19-sme10.patch
ViewVC logotype

Diff of /rpms/smeserver-cacti/contribs10/smeserver-cacti-1.1.19-sme10.patch

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

Revision 1.8 by jpp, Wed Jul 27 20:32:07 2022 UTC Revision 1.21 by jpp, Thu Jul 28 04:57:42 2022 UTC
# Line 9  diff -Nur --no-dereference smeserver-cac Line 9  diff -Nur --no-dereference smeserver-cac
9          ))          ))
10   {   {
11       templates2events("/etc/cacti/db.php", $event);       templates2events("/etc/cacti/db.php", $event);
12  @@ -22,3 +23,32 @@  @@ -22,3 +23,34 @@
13   }   }
14    
15   templates2events("/etc/e-smith/sql/init/80cacti", "post-upgrade");   templates2events("/etc/e-smith/sql/init/80cacti", "post-upgrade");
# Line 19  diff -Nur --no-dereference smeserver-cac Line 19  diff -Nur --no-dereference smeserver-cac
19  +  /etc/cacti/db.php  +  /etc/cacti/db.php
20  +  /etc/httpd/conf/httpd.conf  +  /etc/httpd/conf/httpd.conf
21  +  /etc/crontab  +  /etc/crontab
22    +  /etc/my.cnf
23  +  /etc/opt/remi/php74/php-fpm.d/www.conf  +  /etc/opt/remi/php74/php-fpm.d/www.conf
24  +  /etc/e-smith/sql/init/80cacti  +  /etc/e-smith/sql/init/80cacti
25  +));  +));
# Line 26  diff -Nur --no-dereference smeserver-cac Line 27  diff -Nur --no-dereference smeserver-cac
27  +event_services($event,  +event_services($event,
28  +  'crond' => 'restart',  +  'crond' => 'restart',
29  +  'mysql.init' => 'restart',  +  'mysql.init' => 'restart',
30    +  'mariadb' => 'restart',
31  +  'httpd-e-smith' => 'sigusr1',  +  'httpd-e-smith' => 'sigusr1',
32  +  'php74-php-fpm' => 'reload-or-restart'  +  'php74-php-fpm' => 'reload-or-restart'
33  +);  +);
34  +  +
35  +event_actions($event,  +event_actions($event,
36  +'cacti-conf' => '50',  +'cacti-conf' => '2',
37  +'cacti-ldap' => '95'  +'cacti-install' => '94',
38  +);  +);
39  +  +
40  +  +
# Line 136  diff -Nur --no-dereference smeserver-cac Line 138  diff -Nur --no-dereference smeserver-cac
138  +#/sbin/e-smith/config getprop php74 MemoryLimit  1>/dev/null || ( config setprop  php74 MemoryLimit 800M ; echo "setting php74 memory_limit 800M" ; psomething=1)  +#/sbin/e-smith/config getprop php74 MemoryLimit  1>/dev/null || ( config setprop  php74 MemoryLimit 800M ; echo "setting php74 memory_limit 800M" ; psomething=1)
139  +# install detect cli for php not php74 even if $php_path is set  +# install detect cli for php not php74 even if $php_path is set
140  +  +
141  +[ $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
142  +#[ $psomething == 1 ] && /usr/sbin/e-smith/expand-template /etc/opt/remi/php74/php.ini && /usr/bin/systemctl restart php74-php-fpm.service  +#[ $psomething == 1 ] && /usr/sbin/e-smith/expand-template /etc/opt/remi/php74/php.ini && /usr/bin/systemctl restart php74-php-fpm.service
143  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  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
144  --- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap       1969-12-31 19:00:00.000000000 -0500  --- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap       1969-12-31 19:00:00.000000000 -0500
# Line 564  diff -Nur --no-dereference smeserver-cac Line 566  diff -Nur --no-dereference smeserver-cac
566  +UID="root"  +UID="root"
567   GID="www"   GID="www"
568   PERMS=0640   PERMS=0640
569    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
570    --- smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/my.cnf/020cacti   1969-12-31 19:00:00.000000000 -0500
571    +++ smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/my.cnf/020cacti       2022-07-27 17:18:19.452000000 -0400
572    @@ -0,0 +1,4 @@
573    +#for cacti use
574    +innodb_buffer_pool_size=483M
575    +innodb_additional_mem_pool_size=80M
576    +innodb_flush_log_at_trx_commit=2
577    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
578    --- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-install    1969-12-31 19:00:00.000000000 -0500
579    +++ smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-install        2022-07-28 00:00:45.319000000 -0400
580    @@ -0,0 +1,17 @@
581    +#!/bin/bash
582    +
583    +# move to cli dir
584    +cd /usr/share/cacti/cli
585    +
586    +#install, we put away, it fails in the temp event in yum at first
587    +/usr/bin/php install_cacti.php    
588    +/usr/bin/php install_cacti.php  --accept-eula --install   || exit 0
589    +
590    +
591    +#TODO:
592    +#--automationmode
593    +#--automationrange with LAN if server-gateway; or only interface if server only
594    +#--lang (using an array between cacti option and system language)
595    +# using this to set ldap ? --ldap:dn:...
596    +# do we need a --mode=upgrade and a --mode=install
597    +
598    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
599    --- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap       2022-07-27 22:43:12.847000000 -0400
600    +++ smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-ldap   2022-07-27 23:58:46.807000000 -0400
601    @@ -19,24 +19,26 @@
602     #ldap_group_require    'on' or ''
603     # then set our admin password
604     /usr/bin/mysql <<EOF
605    -UPDATE ${db}.settings SET value='memberUid' WHERE name='ldap_group_attrib';
606    -UPDATE ${db}.settings SET value='uid=cactigroup,ou=Groups,$DN' WHERE name='ldap_group_dn';
607    +REPLACE INTO ${db}.settings VALUES ('ldap_group_attrib','memberUid') ;
608    +REPLACE INTO ${db}.settings VALUES ('ldap_group_dn','uid=cactigroup,ou=Groups,$DN') ;
609    
610    -UPDATE ${db}.settings SET value='0' WHERE name='ldap_tls_certificate';
611    -UPDATE ${db}.settings SET value='3' WHERE name='ldap_version';
612    -UPDATE ${db}.settings SET value='localhost' WHERE name='ldap_server';
613    -UPDATE ${db}.settings SET value='objectClass=inetOrgPerson' WHERE name='ldap_search_filter';
614    -UPDATE ${db}.settings SET value='ou=Users,$DN' WHERE name='ldap_search_base';
615    -UPDATE ${db}.settings SET value='0' WHERE name='ldap_referrals';
616    -UPDATE ${db}.settings SET value='636' WHERE name='ldap_port_ssl';
617    -UPDATE ${db}.settings SET value='389' WHERE name='ldap_port';
618    -UPDATE ${db}.settings SET value='0' WHERE name='ldap_mode';
619    -UPDATE ${db}.settings SET value='0' WHERE name='ldap_encryption';
620    -UPDATE ${db}.settings SET value='uid=<username>,ou=Users,$DN' WHERE name='ldap_dn';
621    -UPDATE ${db}.settings SET value='3' WHERE name='auth_method';
622    -UPDATE ${db}.settings SET value='cn' WHERE name='cn_full_name';
623    -UPDATE ${db}.settings SET value='mail' WHERE name='cn_email';
624    +REPLACE INTO ${db}.settings VALUES ('ldap_tls_certificate','0') ;
625    +REPLACE INTO ${db}.settings VALUES ('ldap_version','3') ;
626    +REPLACE INTO ${db}.settings VALUES ('ldap_server','localhost') ;
627    +REPLACE INTO ${db}.settings VALUES ('ldap_search_filter','objectClass=inetOrgPerson') ;
628    +REPLACE INTO ${db}.settings VALUES ('ldap_search_base','ou=Users,$DN') ;
629    +REPLACE INTO ${db}.settings VALUES ('ldap_referrals','0') ;
630    +REPLACE INTO ${db}.settings VALUES ('ldap_port_ssl','636') ;
631    +REPLACE INTO ${db}.settings VALUES ('ldap_port','389') ;
632    +REPLACE INTO ${db}.settings VALUES ('ldap_mode','0') ;
633    +REPLACE INTO ${db}.settings VALUES ('ldap_encryption','0') ;
634    +REPLACE INTO ${db}.settings VALUES ('ldap_dn','uid=<username>,ou=Users,$DN') ;
635    +REPLACE INTO ${db}.settings VALUES ('auth_method','3') ;
636    +REPLACE INTO ${db}.settings VALUES ('cn_full_name','cn') ;
637    +REPLACE INTO ${db}.settings VALUES ('cn_email','mail') ;
638    +REPLACE INTO ${db}.settings VALUES ('path_php_binary','/usr/bin/php74') ;
639    
640    +REPLACE INTO ${db}.settings VALUES ('user_template','3');
641    
642     # set password of admin
643     UPDATE ${db}.user_auth SET email_address='admin@${domain}', must_change_password='',password=md5('$adminpass'), enabled='on'  WHERE username='admin' and id='1';
644    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
645    --- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-install    2022-07-28 00:24:34.405000000 -0400
646    +++ smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-install        2022-07-28 00:26:59.373000000 -0400
647    @@ -15,3 +15,39 @@
648     # using this to set ldap ? --ldap:dn:...
649     # do we need a --mode=upgrade and a --mode=install
650    
651    +db=$(config getprop cacti DbDatabase || echo 'cacti_sme');
652    +user=$(config getprop cacti DbUser || echo 'cacti');
653    +pass=$(config getprop cacti DbPassword || echo 'changeme');
654    +adminpass=$(config getprop cacti AdminPassword || echo 'changeme');
655    +domain=$(config get DomainName)
656    +DN=$(perl  -Mesmith::util  -e "print esmith::util::ldapBase(\"$domain\");")
657    +
658    +# set ldap auth with optional group
659    +# ldap_group_require     'on' or '': user will enable if needed.
660    +# then set our admin password
661    +/usr/bin/mysql <<EOF
662    +REPLACE INTO ${db}.settings VALUES ('ldap_group_attrib','memberUid') ;
663    +REPLACE INTO ${db}.settings VALUES ('ldap_group_dn','uid=cactigroup,ou=Groups,$DN') ;
664    +
665    +REPLACE INTO ${db}.settings VALUES ('ldap_tls_certificate','0') ;
666    +REPLACE INTO ${db}.settings VALUES ('ldap_version','3') ;
667    +REPLACE INTO ${db}.settings VALUES ('ldap_server','localhost') ;
668    +REPLACE INTO ${db}.settings VALUES ('ldap_search_filter','objectClass=inetOrgPerson') ;
669    +REPLACE INTO ${db}.settings VALUES ('ldap_search_base','ou=Users,$DN') ;
670    +REPLACE INTO ${db}.settings VALUES ('ldap_referrals','0') ;
671    +REPLACE INTO ${db}.settings VALUES ('ldap_port_ssl','636') ;
672    +REPLACE INTO ${db}.settings VALUES ('ldap_port','389') ;
673    +REPLACE INTO ${db}.settings VALUES ('ldap_mode','0') ;
674    +REPLACE INTO ${db}.settings VALUES ('ldap_encryption','0') ;
675    +REPLACE INTO ${db}.settings VALUES ('ldap_dn','uid=<username>,ou=Users,$DN') ;
676    +REPLACE INTO ${db}.settings VALUES ('auth_method','3') ;
677    +REPLACE INTO ${db}.settings VALUES ('cn_full_name','cn') ;
678    +REPLACE INTO ${db}.settings VALUES ('cn_email','mail') ;
679    +REPLACE INTO ${db}.settings VALUES ('path_php_binary','/usr/bin/php74') ;
680    +
681    +REPLACE INTO ${db}.settings VALUES ('user_template','3');
682    +
683    +# set password of admin
684    +UPDATE ${db}.user_auth SET email_address='admin@${domain}', must_change_password='',password=md5('$adminpass'), enabled='on'  WHERE username='admin' and id='1';
685    +EOF
686    +
687    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
688    --- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap       2022-07-28 00:24:34.405000000 -0400
689    +++ smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-ldap   1969-12-31 19:00:00.000000000 -0500
690    @@ -1,46 +0,0 @@
691    -#!/bin/bash
692    -
693    -#use esmith::ConfigDB;
694    -#use esmith::util;
695    -#my $cdb = esmith::ConfigDB->open_ro();
696    -#my $domain = $cdb->get_value('DomainName');
697    -#my $baseDN = esmith::util::ldapBase($cdb->get_value('DomainName'));
698    -#print $baseDN . "\n";
699    -
700    -db=$(config getprop cacti DbDatabase || echo 'cacti_sme');
701    -user=$(config getprop cacti DbUser || echo 'cacti');
702    -pass=$(config getprop cacti DbPassword || echo 'changeme');
703    -adminpass=$(config getprop cacti AdminPassword || echo 'changeme');
704    -domain=$(config get DomainName)
705    -DN=$(perl  -Mesmith::util  -e "print esmith::util::ldapBase(\"$domain\");")
706    -
707    -
708    -# set ldap auth with optional group
709    -#ldap_group_require    'on' or ''
710    -# then set our admin password
711    -/usr/bin/mysql <<EOF
712    -REPLACE INTO ${db}.settings VALUES ('ldap_group_attrib','memberUid') ;
713    -REPLACE INTO ${db}.settings VALUES ('ldap_group_dn','uid=cactigroup,ou=Groups,$DN') ;
714    -
715    -REPLACE INTO ${db}.settings VALUES ('ldap_tls_certificate','0') ;
716    -REPLACE INTO ${db}.settings VALUES ('ldap_version','3') ;
717    -REPLACE INTO ${db}.settings VALUES ('ldap_server','localhost') ;
718    -REPLACE INTO ${db}.settings VALUES ('ldap_search_filter','objectClass=inetOrgPerson') ;
719    -REPLACE INTO ${db}.settings VALUES ('ldap_search_base','ou=Users,$DN') ;
720    -REPLACE INTO ${db}.settings VALUES ('ldap_referrals','0') ;
721    -REPLACE INTO ${db}.settings VALUES ('ldap_port_ssl','636') ;
722    -REPLACE INTO ${db}.settings VALUES ('ldap_port','389') ;
723    -REPLACE INTO ${db}.settings VALUES ('ldap_mode','0') ;
724    -REPLACE INTO ${db}.settings VALUES ('ldap_encryption','0') ;
725    -REPLACE INTO ${db}.settings VALUES ('ldap_dn','uid=<username>,ou=Users,$DN') ;
726    -REPLACE INTO ${db}.settings VALUES ('auth_method','3') ;
727    -REPLACE INTO ${db}.settings VALUES ('cn_full_name','cn') ;
728    -REPLACE INTO ${db}.settings VALUES ('cn_email','mail') ;
729    -REPLACE INTO ${db}.settings VALUES ('path_php_binary','/usr/bin/php74') ;
730    -
731    -REPLACE INTO ${db}.settings VALUES ('user_template','3');
732    -
733    -# set password of admin
734    -UPDATE ${db}.user_auth SET email_address='admin@${domain}', must_change_password='',password=md5('$adminpass'), enabled='on'  WHERE username='admin' and id='1';
735    -EOF
736    -


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