Skip to content

Commit

Permalink
Merge pull request #1076 from it-novum/development
Browse files Browse the repository at this point in the history
openITCOCKPIT 4.1
  • Loading branch information
nook24 authored Oct 19, 2020
2 parents c31e1fe + cea0a8e commit 892025c
Show file tree
Hide file tree
Showing 14 changed files with 233 additions and 45 deletions.
25 changes: 14 additions & 11 deletions bin/scripts/oitc3to4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,10 @@ echo ""

if [ "$VERSION_CODENAME" == "stretch" ]; then

openitcockpit_upd=$(apt-mark showmanual | grep openitcockpit | grep -v -e openitcockpit-message -e openitcockpit-statusengine-naemon -e openitcockpit-module-nrpe -e openitcockpit-module-mk | xargs echo)
openitcockpit_rem=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$2 ~ /openitcockpit-/ {print $2} $2 ~ /phpnsta/ {print $2}' | grep -e 'openitcockpit-wkhtmltopdf' -e 'phpnsta') | xargs echo)
php_upd=$(while read pkg; do echo "$pkg-"; if [ "$pkg" != "php7.0-mcrypt" ]; then echo "$pkg"|sed 's/php7.0/php7.3/'; fi; done< <(dpkg -l | awk '$2 ~ /php7.0/ {print $2}') | xargs echo)
openitcockpit_upd=$(apt-mark showmanual | grep openitcockpit | grep -v -e openitcockpit-message -e openitcockpit-statusengine-naemon -e openitcockpit-module-nrpe -e openitcockpit-module-mk -e openitcockpit-release -e openitcockpit-mysql -e openitcockpit-npcd | xargs echo)
openitcockpit_rem=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-/ {print $2} $1 ~ /ii/ && $2 ~ /phpnsta/ {print $2}' | grep -e 'openitcockpit-wkhtmltopdf' -e 'phpnsta' -e openitcockpit-release -e openitcockpit-mysql -e openitcockpit-npcd) | xargs echo)
php_upd=$(while read pkg; do echo "$pkg-"; if [ "$pkg" != "php7.0-mcrypt" ]; then echo "$pkg"|sed 's/php7.0/php7.3/'; fi; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /php7.0/ {print $2}') | xargs echo)
php5_rm=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /php5/ {print $2}') | xargs echo)
always="openitcockpit openitcockpit-graphing wkhtmltox"

if [ ! -z "$(dpkg -l | awk '$2 ~ /openitcockpit-module-distribute/')" ]; then
Expand Down Expand Up @@ -382,17 +383,18 @@ if [ "$VERSION_CODENAME" == "stretch" ]; then
echo ""
echo "# Upgrade the distribution and openITCOCKPIT"
echo "apt-get update"
echo "apt-get dist-upgrade $php_upd $openitcockpit_upd $openitcockpit_rem $always"
echo "apt-get dist-upgrade $php_upd $openitcockpit_upd $openitcockpit_rem $php5_rm $always"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "###############################################################################"
echo "${Reset}"
fi

if [ "$VERSION_CODENAME" == "xenial" ]; then

openitcockpit_upd=$(apt-mark showmanual | grep openitcockpit | grep -v -e openitcockpit-message -e openitcockpit-statusengine-naemon -e openitcockpit-module-nrpe -e openitcockpit-module-mk | xargs echo)
openitcockpit_rem=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$2 ~ /openitcockpit-/ {print $2} $2 ~ /phpnsta/ {print $2}' | grep -e 'openitcockpit-wkhtmltopdf' -e 'phpnsta') | xargs echo)
php_upd=$(while read pkg; do echo "$pkg-"; if [ "$pkg" != "php7.0-mcrypt" ]; then echo "$pkg"|sed 's/php7.0/php7.2/'; fi; done< <(dpkg -l | awk '$2 ~ /php7.0/ {print $2}') | xargs echo)
openitcockpit_upd=$(apt-mark showmanual | grep openitcockpit | grep -v -e openitcockpit-message -e openitcockpit-statusengine-naemon -e openitcockpit-module-nrpe -e openitcockpit-module-mk -e openitcockpit-release -e openitcockpit-mysql -e openitcockpit-npcd | xargs echo)
openitcockpit_rem=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-/ {print $2} $1 ~ /ii/ && $2 ~ /phpnsta/ {print $2}' | grep -e 'openitcockpit-wkhtmltopdf' -e 'phpnsta' -e openitcockpit-release -e openitcockpit-mysql -e openitcockpit-npcd) | xargs echo)
php_upd=$(while read pkg; do echo "$pkg-"; if [ "$pkg" != "php7.0-mcrypt" ]; then echo "$pkg"|sed 's/php7.0/php7.2/'; fi; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /php7.0/ {print $2}') | xargs echo)
php5_rm=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /php5/' {print $2}) | xargs echo)
always="openitcockpit openitcockpit-graphing wkhtmltox"

if [ ! -z "$(dpkg -l | awk '$2 ~ /openitcockpit-module-distribute/')" ]; then
Expand Down Expand Up @@ -423,16 +425,17 @@ if [ "$VERSION_CODENAME" == "xenial" ]; then
echo ""
echo "# Upgrade the distribution and openITCOCKPIT"
echo "apt-get update"
echo "apt-get dist-upgrade $php_upd $openitcockpit_upd $openitcockpit_rem $always"
echo "apt-get dist-upgrade $php_upd $openitcockpit_upd $openitcockpit_rem $php5_rm $always"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "###############################################################################"
echo "${Reset}"
fi

if [ "$VERSION_CODENAME" == "bionic" ]; then

openitcockpit_upd=$(apt-mark showmanual | grep openitcockpit | grep -v -e openitcockpit-message -e openitcockpit-statusengine-naemon -e openitcockpit-module-nrpe -e openitcockpit-module-mk | xargs echo)
openitcockpit_rem=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$2 ~ /openitcockpit-/ {print $2} $2 ~ /phpnsta/ {print $2}' | grep -e 'openitcockpit-wkhtmltopdf' -e 'phpnsta') | xargs echo)
openitcockpit_upd=$(apt-mark showmanual | grep openitcockpit | grep -v -e openitcockpit-message -e openitcockpit-statusengine-naemon -e openitcockpit-module-nrpe -e openitcockpit-module-mk -e openitcockpit-release -e openitcockpit-mysql -e openitcockpit-npcd | xargs echo)
openitcockpit_rem=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-/ {print $2} $1 ~ /ii/ && $2 ~ /phpnsta/ {print $2}' | grep -e 'openitcockpit-wkhtmltopdf' -e 'phpnsta' -e openitcockpit-release -e openitcockpit-mysql -e openitcockpit-npcd) | xargs echo)
php5_rm=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /php5/' {print $2}) | xargs echo)
always="openitcockpit openitcockpit-graphing wkhtmltox"

if [ ! -z "$(dpkg -l | awk '$2 ~ /openitcockpit-module-distribute/')" ]; then
Expand All @@ -459,7 +462,7 @@ if [ "$VERSION_CODENAME" == "bionic" ]; then
echo ""
echo "# Upgrade the distribution and openITCOCKPIT"
echo "apt-get update"
echo "apt-get dist-upgrade $openitcockpit_upd $openitcockpit_rem $always"
echo "apt-get dist-upgrade $openitcockpit_upd $openitcockpit_rem $php5_rm $always"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "###############################################################################"
echo "${Reset}"
Expand Down
37 changes: 20 additions & 17 deletions bin/scripts/oitcSat3to4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,20 @@ fi
if [ "$VERSION_CODENAME" == "stretch" ]; then

openitcockpit_upd=$(apt-mark showmanual | grep openitcockpit | grep -v -e 'openitcockpit-statusengine3-oitc-mysql' -e 'openitcockpit-nagios-sat' -e 'openitcockpit-naemon-sat' -e 'openitcockpit-checkmk-sat' -e 'openitcockpit-statusengine3-broker-sat-nagios' -e 'openitcockpit-statusengine3-broker-sat-naemon' -e 'openitcockpit-statusengine-broker-sat-nagios' -e 'openitcockpit-statusengine-broker-sat-naemon' | xargs echo)
openitcockpit_rem=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$2 ~ /openitcockpit-/ {print $2}' | grep -e 'openitcockpit-statusengine3-oitc-mysql' -e 'openitcockpit-nagios-sat' -e 'openitcockpit-naemon-sat' -e 'openitcockpit-checkmk-sat' -e 'openitcockpit-statusengine3-broker-sat-nagios' -e 'openitcockpit-statusengine3-broker-sat-naemon' -e 'openitcockpit-statusengine-broker-sat-nagios' -e 'openitcockpit-statusengine-broker-sat-naemon') | xargs echo)
php_upd=$(while read pkg; do echo "$pkg-"; if [ "$pkg" != "php7.0-mcrypt" ]; then echo "$pkg"|sed 's/php7.0/php7.3/'; fi; done< <(dpkg -l | awk '$2 ~ /php7.0/ {print $2}') | xargs echo)
openitcockpit_rem=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-/ {print $2}' | grep -e 'openitcockpit-statusengine3-oitc-mysql' -e 'openitcockpit-nagios-sat' -e 'openitcockpit-naemon-sat' -e 'openitcockpit-checkmk-sat' -e 'openitcockpit-statusengine3-broker-sat-nagios' -e 'openitcockpit-statusengine3-broker-sat-naemon' -e 'openitcockpit-statusengine-broker-sat-nagios' -e 'openitcockpit-statusengine-broker-sat-naemon') | xargs echo)
php_upd=$(while read pkg; do echo "$pkg-"; if [ "$pkg" != "php7.0-mcrypt" ]; then echo "$pkg"|sed 's/php7.0/php7.3/'; fi; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /php7.0/ {print $2}') | xargs echo)
php5_rm=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /php5/ {print $2}') | xargs echo)
always="openitcockpit-satellite"

if [ ! -z "$(dpkg -l | awk '$2 ~ /openitcockpit-checkmk-sat/')" ]; then
if [ ! -z "$(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-checkmk-sat/')" ]; then
always="$always openitcockpit-checkmk"
fi

if [ ! -z "$(dpkg -l | awk '$2 ~ /openitcockpit-nagios-sat/')" ]; then
if [ ! -z "$(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-nagios-sat/')" ]; then
always="$always openitcockpit-naemon"
fi

if [ ! -z "$(dpkg -l | awk '$2 ~ /openitcockpit-naemon-sat/')" ]; then
if [ ! -z "$(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-naemon-sat/')" ]; then
always="$always openitcockpit-naemon"
fi

Expand All @@ -258,7 +259,7 @@ if [ "$VERSION_CODENAME" == "stretch" ]; then
if dpkg -s "openitcockpit-satellite-frontend" >/dev/null 2>&1; then
echo "mkdir -p /opt/openitc/etc/frontend && touch /opt/openitc/etc/frontend/enable_web_interface"
fi
echo "apt-get dist-upgrade $php_upd $openitcockpit_upd $openitcockpit_rem $always"
echo "apt-get dist-upgrade $php_upd $openitcockpit_upd $openitcockpit_rem $php5_rm $always"

echo ""
check_package_installed_sat_frontend
Expand All @@ -271,19 +272,20 @@ fi
if [ "$VERSION_CODENAME" == "xenial" ]; then

openitcockpit_upd=$(apt-mark showmanual | grep openitcockpit | grep -v -e 'openitcockpit-statusengine3-oitc-mysql' -e 'openitcockpit-nagios-sat' -e 'openitcockpit-naemon-sat' -e 'openitcockpit-checkmk-sat' -e 'openitcockpit-statusengine3-broker-sat-nagios' -e 'openitcockpit-statusengine3-broker-sat-naemon' -e 'openitcockpit-statusengine-broker-sat-nagios' -e 'openitcockpit-statusengine-broker-sat-naemon' | xargs echo)
openitcockpit_rem=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$2 ~ /openitcockpit-/ {print $2}' | grep -e 'openitcockpit-statusengine3-oitc-mysql' -e 'openitcockpit-nagios-sat' -e 'openitcockpit-naemon-sat' -e 'openitcockpit-checkmk-sat' -e 'openitcockpit-statusengine3-broker-sat-nagios' -e 'openitcockpit-statusengine3-broker-sat-naemon' -e 'openitcockpit-statusengine-broker-sat-nagios' -e 'openitcockpit-statusengine-broker-sat-naemon') | xargs echo)
php_upd=$(while read pkg; do echo "$pkg-"; if [ "$pkg" != "php7.0-mcrypt" ]; then echo "$pkg"|sed 's/php7.0/php7.2/'; fi; done< <(dpkg -l | awk '$2 ~ /php7.0/ {print $2}') | xargs echo)
openitcockpit_rem=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-/ {print $2}' | grep -e 'openitcockpit-statusengine3-oitc-mysql' -e 'openitcockpit-nagios-sat' -e 'openitcockpit-naemon-sat' -e 'openitcockpit-checkmk-sat' -e 'openitcockpit-statusengine3-broker-sat-nagios' -e 'openitcockpit-statusengine3-broker-sat-naemon' -e 'openitcockpit-statusengine-broker-sat-nagios' -e 'openitcockpit-statusengine-broker-sat-naemon') | xargs echo)
php_upd=$(while read pkg; do echo "$pkg-"; if [ "$pkg" != "php7.0-mcrypt" ]; then echo "$pkg"|sed 's/php7.0/php7.2/'; fi; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /php7.0/ {print $2}') | xargs echo)
php5_rm=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /php5/ {print $2}') | xargs echo)
always="openitcockpit-satellite"

if [ ! -z "$(dpkg -l | awk '$2 ~ /openitcockpit-checkmk-sat/')" ]; then
if [ ! -z "$(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-checkmk-sat/')" ]; then
always="$always openitcockpit-checkmk"
fi

if [ ! -z "$(dpkg -l | awk '$2 ~ /openitcockpit-nagios-sat/')" ]; then
if [ ! -z "$(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-nagios-sat/')" ]; then
always="$always openitcockpit-naemon"
fi

if [ ! -z "$(dpkg -l | awk '$2 ~ /openitcockpit-naemon-sat/')" ]; then
if [ ! -z "$(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-naemon-sat/')" ]; then
always="$always openitcockpit-naemon"
fi

Expand All @@ -306,7 +308,7 @@ if [ "$VERSION_CODENAME" == "xenial" ]; then
if dpkg -s "openitcockpit-satellite-frontend" >/dev/null 2>&1; then
echo "mkdir -p /opt/openitc/etc/frontend && touch /opt/openitc/etc/frontend/enable_web_interface"
fi
echo "apt-get dist-upgrade $php_upd $openitcockpit_upd $openitcockpit_rem $always"
echo "apt-get dist-upgrade $php_upd $openitcockpit_upd $openitcockpit_rem $php5_rm $always"

echo ""
check_package_installed_sat_frontend
Expand All @@ -319,18 +321,19 @@ fi
if [ "$VERSION_CODENAME" == "bionic" ]; then

openitcockpit_upd=$(apt-mark showmanual | grep openitcockpit | grep -v -e 'openitcockpit-statusengine3-oitc-mysql' -e 'openitcockpit-nagios-sat' -e 'openitcockpit-naemon-sat' -e 'openitcockpit-checkmk-sat' -e 'openitcockpit-statusengine3-broker-sat-nagios' -e 'openitcockpit-statusengine3-broker-sat-naemon' -e 'openitcockpit-statusengine-broker-sat-nagios' -e 'openitcockpit-statusengine-broker-sat-naemon' | xargs echo)
openitcockpit_rem=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$2 ~ /openitcockpit-/ {print $2}' | grep -e 'openitcockpit-statusengine3-oitc-mysql' -e 'openitcockpit-nagios-sat' -e 'openitcockpit-naemon-sat' -e 'openitcockpit-checkmk-sat' -e 'openitcockpit-statusengine3-broker-sat-nagios' -e 'openitcockpit-statusengine3-broker-sat-naemon' -e 'openitcockpit-statusengine-broker-sat-nagios' -e 'openitcockpit-statusengine-broker-sat-naemon') | xargs echo)
openitcockpit_rem=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-/ {print $2}' | grep -e 'openitcockpit-statusengine3-oitc-mysql' -e 'openitcockpit-nagios-sat' -e 'openitcockpit-naemon-sat' -e 'openitcockpit-checkmk-sat' -e 'openitcockpit-statusengine3-broker-sat-nagios' -e 'openitcockpit-statusengine3-broker-sat-naemon' -e 'openitcockpit-statusengine-broker-sat-nagios' -e 'openitcockpit-statusengine-broker-sat-naemon') | xargs echo)
php5_rm=$(while read pkg; do echo "$pkg-"; done< <(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /php5/ {print $2}') | xargs echo)
always="openitcockpit-satellite"

if [ ! -z "$(dpkg -l | awk '$2 ~ /openitcockpit-checkmk-sat/')" ]; then
if [ ! -z "$(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-checkmk-sat/')" ]; then
always="$always openitcockpit-checkmk"
fi

if [ ! -z "$(dpkg -l | awk '$2 ~ /openitcockpit-nagios-sat/')" ]; then
if [ ! -z "$(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-nagios-sat/')" ]; then
always="$always openitcockpit-naemon"
fi

if [ ! -z "$(dpkg -l | awk '$2 ~ /openitcockpit-naemon-sat/')" ]; then
if [ ! -z "$(dpkg -l | awk '$1 ~ /ii/ && $2 ~ /openitcockpit-naemon-sat/')" ]; then
always="$always openitcockpit-naemon"
fi

Expand All @@ -349,7 +352,7 @@ if [ "$VERSION_CODENAME" == "bionic" ]; then
if dpkg -s "openitcockpit-satellite-frontend" >/dev/null 2>&1; then
echo "mkdir -p /opt/openitc/etc/frontend && touch /opt/openitc/etc/frontend/enable_web_interface"
fi
echo "apt-get dist-upgrade $openitcockpit_upd $openitcockpit_rem $always"
echo "apt-get dist-upgrade $openitcockpit_upd $openitcockpit_rem $php5_rm $always"

echo ""
check_package_installed_sat_frontend
Expand Down
54 changes: 54 additions & 0 deletions config/Migrations/20201013093523_DisableAgentProxy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
// Copyright (C) <2015> <it-novum GmbH>
//
// This file is dual licensed
//
// 1.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// 2.
// If you purchased an openITCOCKPIT Enterprise Edition you can use this file
// under the terms of the openITCOCKPIT Enterprise Edition license agreement.
// License agreement and license key will be shipped with the order
// confirmation.

declare(strict_types=1);

use Migrations\AbstractMigration;

/**
* Class OAuth
*
* Created:
* oitc migrations create DisableAgentProxy
*
* Usage:
* openitcockpit-update
*/
class DisableAgentProxy extends AbstractMigration {

/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change() {
$this->table('agentconfigs')
->changeColumn('proxy', 'boolean', [
'default' => false
])
->update();
}
}
Loading

0 comments on commit 892025c

Please sign in to comment.