From d7d6d6096f3c04fb510616d1f04a2ef1803bc23c Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 14 Oct 2014 18:32:15 +0200 Subject: [PATCH] Remove icinga2-enable-feature and icinga2-disable-feature refs #7250 --- agent/icinga2-setup-agent.cmake | 4 +- debian/icinga2-classicui.postinst | 2 +- debian/icinga2-common.postinst | 2 +- debian/icinga2-ido-mysql.postinst | 4 +- debian/icinga2-ido-mysql.templates | 2 +- debian/icinga2-ido-pgsql.postinst | 4 +- debian/icinga2-ido-pgsql.templates | 2 +- doc/2-getting-started.md | 61 +++++++++---------- doc/3-monitoring-basics.md | 14 ++--- doc/4-monitoring-remote-systems.md | 6 +- doc/6-configuring-icinga-2.md | 4 +- doc/7-troubleshooting.md | 6 +- doc/CMakeLists.txt | 2 +- doc/icinga2-disable-feature.8 | 32 ---------- doc/icinga2-enable-feature.8 | 32 ---------- etc/icinga2/icinga2.conf | 5 +- icinga2.spec | 25 ++++---- test/jenkins/livestatus_socket.test | 2 +- test/jenkins/statusdata.test | 2 +- tools/CMakeLists.txt | 12 ---- tools/icinga2-enable-feature.cmake | 91 ----------------------------- 21 files changed, 73 insertions(+), 241 deletions(-) delete mode 100644 doc/icinga2-disable-feature.8 delete mode 100644 doc/icinga2-enable-feature.8 delete mode 100644 tools/icinga2-enable-feature.cmake diff --git a/agent/icinga2-setup-agent.cmake b/agent/icinga2-setup-agent.cmake index 3e4c889f4..9ab06a6f3 100644 --- a/agent/icinga2-setup-agent.cmake +++ b/agent/icinga2-setup-agent.cmake @@ -176,7 +176,7 @@ ZONES sed -i "s/NodeName = \"localhost\"/NodeName = \"$name\"/" /etc/icinga2/constants.conf echo "Enabling API feature..." - @CMAKE_INSTALL_FULL_SBINDIR@/icinga2-enable-feature api + @CMAKE_INSTALL_FULL_SBINDIR@/icinga2 feature enable api if [ ! -e "@CMAKE_INSTALL_FULL_SYSCONFDIR@/monitoring" ]; then ln -s $ICINGA2CONFIG/conf.d/hosts/localhost @CMAKE_INSTALL_FULL_SYSCONFDIR@/monitoring @@ -184,7 +184,7 @@ ZONES if [ "$master" = "n" ]; then echo "Disabling notification feature..." - @CMAKE_INSTALL_FULL_SBINDIR@/icinga2-disable-feature notification + @CMAKE_INSTALL_FULL_SBINDIR@/icinga2 feature disable notification fi echo "" diff --git a/debian/icinga2-classicui.postinst b/debian/icinga2-classicui.postinst index 57efaf2bd..e01f1dc55 100644 --- a/debian/icinga2-classicui.postinst +++ b/debian/icinga2-classicui.postinst @@ -37,7 +37,7 @@ is_fresh_install() enable_features_for_classic() { if is_fresh_install $@; then echo "enabling icinga2 features for classicui" - icinga2-enable-feature compatlog statusdata command + icinga2 feature enable compatlog statusdata command echo "reloading icinga2" [ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload diff --git a/debian/icinga2-common.postinst b/debian/icinga2-common.postinst index 487f45a97..9855ed3d2 100644 --- a/debian/icinga2-common.postinst +++ b/debian/icinga2-common.postinst @@ -29,7 +29,7 @@ enable_default_features() { if is_fresh_install $@ \ || dpkg --compare-versions "$2" lt "$FIX_VERSION"; then echo "enabling default icinga2 features" - icinga2-enable-feature checker notification mainlog + icinga2 feature enable checker notification mainlog fi # handle new default features here in the future } diff --git a/debian/icinga2-ido-mysql.postinst b/debian/icinga2-ido-mysql.postinst index 753dece81..dd16a193a 100644 --- a/debian/icinga2-ido-mysql.postinst +++ b/debian/icinga2-ido-mysql.postinst @@ -21,7 +21,7 @@ if [ "$1" = configure ]; then if [ -L /etc/icinga2/features-enabled/ido-mysql.conf ] then echo "disable ido mysql feature" - icinga2-disable-feature ido-mysql + icinga2 feature disable ido-mysql echo "reloading icinga2" [ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload fi @@ -29,7 +29,7 @@ if [ "$1" = configure ]; then if [ ! -L /etc/icinga2/features-enabled/ido-mysql.conf ] then echo "enable ido mysql feature" - icinga2-enable-feature ido-mysql + icinga2 feature enable ido-mysql echo "reloading icinga2" [ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload diff --git a/debian/icinga2-ido-mysql.templates b/debian/icinga2-ido-mysql.templates index 672a51587..4abc59912 100644 --- a/debian/icinga2-ido-mysql.templates +++ b/debian/icinga2-ido-mysql.templates @@ -6,4 +6,4 @@ _Description: Enable icinga 2 mysql idoutils? feature gets enabled for icinga 2. . If you want to disable the feature call - icinga2-disable-feature ido-mysql + icinga2 feature disable ido-mysql diff --git a/debian/icinga2-ido-pgsql.postinst b/debian/icinga2-ido-pgsql.postinst index e8fbad4f2..a8fe5074e 100644 --- a/debian/icinga2-ido-pgsql.postinst +++ b/debian/icinga2-ido-pgsql.postinst @@ -21,7 +21,7 @@ if [ "$1" = configure ]; then if [ -L /etc/icinga2/features-enabled/ido-pgsql.conf ] then echo "disable ido pgsql feature" - icinga2-disable-feature ido-pgsql + icinga2 feature disable ido-pgsql echo "reloading icinga2" [ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload fi @@ -29,7 +29,7 @@ if [ "$1" = configure ]; then if [ ! -L /etc/icinga2/features-enabled/ido-pgsql.conf ] then echo "enable ido pgsql feature" - icinga2-enable-feature ido-pgsql + icinga2 feature enable ido-pgsql echo "reloading icinga2" [ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload diff --git a/debian/icinga2-ido-pgsql.templates b/debian/icinga2-ido-pgsql.templates index fb5c4b9d8..0c46c1d94 100644 --- a/debian/icinga2-ido-pgsql.templates +++ b/debian/icinga2-ido-pgsql.templates @@ -6,4 +6,4 @@ _Description: Enable icinga 2 pgsql idoutils? feature gets enabled for icinga 2. . If you want to disable the feature call - icinga2-disable-feature ido-pgsql + icinga2 feature disable ido-pgsql diff --git a/doc/2-getting-started.md b/doc/2-getting-started.md index 3af3cde93..28211acd2 100644 --- a/doc/2-getting-started.md +++ b/doc/2-getting-started.md @@ -119,12 +119,12 @@ Icinga 2 installation: * `notification` for sending notifications * `mainlog` for writing the `icinga2.log ` file -Verify that by calling `icinga2-enable-feature` without any additional parameters +Verify that by calling `icinga2 feature enable` without any additional parameters and enable the missing features, if any. - # icinga2-enable-feature - Syntax: icinga2-enable-feature - Example: icinga2-enable-feature checker notification mainlog + # icinga2 feature enable + Syntax: icinga2 feature enable + Example: icinga2 feature enable checker notification mainlog Enables the specified feature(s). Available features: api checker command compatlog debuglog graphite icingastatus ido-mysql ido-pgsql livestatus mainlog notification perfdata statusdata syslog @@ -276,13 +276,14 @@ The `include` directive can be used to include other files. /** * The features-available directory contains a number of configuration * files for features which can be enabled and disabled using the - * icinga2-enable-feature / icinga2-disable-feature tools. These two tools work by creating - * and removing symbolic links in the features-enabled directory. + * icinga2 feature enable / icinga2 feature disable CLI commands. + * These commands work by creating and removing symbolic links in + * the features-enabled directory. */ include "features-enabled/*.conf" This `include` directive takes care of including the configuration files for all -the features which have been enabled with `icinga2-enable-feature`. See +the features which have been enabled with `icinga2 feature enable`. See [Enabling/Disabling Features](#features) for more details. /** @@ -670,9 +671,9 @@ The package provides a new configuration file that is installed in `/etc/icinga2/features-available/ido-mysql.conf`. You will need to update the database credentials in this file. -You can enable the `ido-mysql` feature configuration file using `icinga2-enable-feature`: +You can enable the `ido-mysql` feature configuration file using `icinga2 feature enable`: - # icinga2-enable-feature ido-mysql + # icinga2 feature enable ido-mysql Module 'ido-mysql' was enabled. Make sure to restart Icinga 2 for these changes to take effect. @@ -781,9 +782,9 @@ The package provides a new configuration file that is installed in `/etc/icinga2/features-available/ido-pgsql.conf`. You will need to update the database credentials in this file. -You can enable the `ido-pgsql` feature configuration file using `icinga2-enable-feature`: +You can enable the `ido-pgsql` feature configuration file using `icinga2 feature enable`: - # icinga2-enable-feature ido-pgsql + # icinga2 feature enable ido-pgsql Module 'ido-pgsql' was enabled. Make sure to restart Icinga 2 for these changes to take effect. @@ -803,9 +804,9 @@ RHEL/CentOS 7 and Fedora 20: Web interfaces and other Icinga addons are able to send commands to Icinga 2 through the external command pipe. -You can enable the External Command Pipe using icinga2-enable-feature: +You can enable the External Command Pipe using icinga2 feature enable: - # icinga2-enable-feature command + # icinga2 feature enable command After that you will have to restart Icinga 2: @@ -853,9 +854,9 @@ Livestatus. Details on the available tables and attributes with Icinga 2 can be found in the [Livestatus Schema](#schema-livestatus) section. -You can enable Livestatus using icinga2-enable-feature: +You can enable Livestatus using icinga2 feature enable: - # icinga2-enable-feature livestatus + # icinga2 feature enable livestatus After that you will have to restart Icinga 2: @@ -884,7 +885,7 @@ In order to use the historical tables provided by the livestatus feature (for ex are expected to be in `/var/log/icinga2/compat`. A different path can be set using the `compat_log_path` configuration attribute. - # icinga2-enable-feature compatlog + # icinga2 feature enable compatlog ## Setting up Icinga 2 User Interfaces @@ -978,7 +979,7 @@ Icinga Classic UI requires the [StatusDataWriter](#status-data), [CompatLogger]( and [ExternalCommandListener](#external-commands) features. Enable these features and restart Icinga 2. - # icinga2-enable-feature statusdata compatlog command + # icinga2 feature enable statusdata compatlog command In order for commands to work you will need to [setup the external command pipe](#setting-up-external-command-pipe). @@ -1036,7 +1037,7 @@ Example for RHEL and MySQL: Icinga Web requires the IDO feature as database backend using MySQL or PostgreSQL. Enable that feature, e.g. for MySQL. - # icinga2-enable-feature ido-mysql + # icinga2 feature enable ido-mysql If you've changed your default credentials you may either create a read-only user or use the credentials defined in the IDO feature for Icinga Web backend configuration. @@ -1049,7 +1050,7 @@ found in the [Icinga Web documentation](http://docs.icinga.org/latest/en/icinga- Additionally you need to enable the `command` feature for sending [external commands](#external-commands): - # icinga2-enable-feature command + # icinga2 feature enable command In order for commands to work you will need to [setup the external command pipe](#setting-up-external-command-pipe). @@ -1124,12 +1125,12 @@ Icinga Web 2 will support `status.dat`, `DB IDO`, or `Livestatus` as backends. Using DB IDO as backend, you need to install and configure the [DB IDO backend](#configuring-db-ido). Once finished, you can enable the feature for DB IDO MySQL: - # icinga2-enable-feature ido-mysql + # icinga2 feature enable ido-mysql Furthermore [external commands](#external-commands) are supported through the external command pipe. - # icinga2-enable-feature command + # icinga2 feature enable command In order for commands to work you will need to [setup the external command pipe](#setting-up-external-command-pipe). @@ -1351,33 +1352,33 @@ is returned. Icinga 2 provides configuration files for some commonly used features. These are installed in the `/etc/icinga2/features-available` directory and can be -enabled and disabled using the `icinga2-enable-feature` and `icinga2-disable-feature` tools, +enabled and disabled using the `icinga2 feature enable` and `icinga2 feature disable` tools, respectively. -The `icinga2-enable-feature` tool creates symlinks in the `/etc/icinga2/features-enabled` +The `icinga2 feature enable` tool creates symlinks in the `/etc/icinga2/features-enabled` directory which is included by default in the example configuration file. You can view a list of available feature configuration files: - # icinga2-enable-feature - Syntax: icinga2-enable-feature + # icinga2 feature enable + Syntax: icinga2 feature enable Enables the specified feature. Available features: statusdata -Using the `icinga2-enable-feature` command you can enable features: +Using the `icinga2 feature enable` command you can enable features: - # icinga2-enable-feature statusdata + # icinga2 feature enable statusdata Module 'statusdata' was enabled. Make sure to restart Icinga 2 for these changes to take effect. -You can disable features using the `icinga2-disable-feature` command: +You can disable features using the `icinga2 feature disable` command: - # icinga2-disable-feature statusdata + # icinga2 feature disable statusdata Module 'statusdata' was disabled. Make sure to restart Icinga 2 for these changes to take effect. -The `icinga2-enable-feature` and `icinga2-disable-feature` commands do not +The `icinga2 feature enable` and `icinga2 feature disable` commands do not restart Icinga 2. You will need to restart Icinga 2 using the init script after enabling or disabling features. diff --git a/doc/3-monitoring-basics.md b/doc/3-monitoring-basics.md index 2fa840547..af963c6a0 100644 --- a/doc/3-monitoring-basics.md +++ b/doc/3-monitoring-basics.md @@ -1734,7 +1734,7 @@ through the web interface). In order to enable the `ExternalCommandListener` configuration use the following command and restart Icinga 2 afterwards: - # icinga2-enable-feature command + # icinga2 feature enable command Icinga 2 creates the command pipe file as `/var/run/icinga2/cmd/icinga2.cmd` using the default configuration. @@ -1766,8 +1766,8 @@ Icinga 2 supports three different types of logging: * Syslog (on *NIX-based operating systems) * Console logging (`STDOUT` on tty) -You can enable additional loggers using the `icinga2-enable-feature` -and `icinga2-disable-feature` commands to configure loggers: +You can enable additional loggers using the `icinga2 feature enable` +and `icinga2 feature disable` commands to configure loggers: Feature | Description ---------|------------ @@ -1809,7 +1809,7 @@ runtime vars. The default templates are already provided with the Icinga 2 feature configuration which can be enabled using - # icinga2-enable-feature perfdata + # icinga2 feature enable perfdata By default all performance data files are rotated in a 15 seconds interval into the `/var/spool/icinga2/perfdata/` directory as `host-perfdata.` and @@ -1826,7 +1826,7 @@ write them to the defined Graphite Carbon daemon tcp socket. You can enable the feature using - # icinga2-enable-feature graphite + # icinga2 feature enable graphite By default the `GraphiteWriter` object expects the Graphite Carbon Cache to listen at `127.0.0.1` on port `2003`. @@ -1893,7 +1893,7 @@ interval to its `objects.cache` and `status.dat` files. Icinga 2 provides the `StatusDataWriter` object which dumps all configuration objects and status updates in a regular interval. - # icinga2-enable-feature statusdata + # icinga2 feature enable statusdata Icinga 1.x Classic UI requires this data set as part of its backend. @@ -1916,7 +1916,7 @@ historical tables. The `CompatLogger` object can be enabled with - # icinga2-enable-feature compatlog + # icinga2 feature enable compatlog By default, the Icinga 1.x log file called `icinga.log` is located in `/var/log/icinga2/compat`. Rotated log files are moved into diff --git a/doc/4-monitoring-remote-systems.md b/doc/4-monitoring-remote-systems.md index f53ea9977..fd8531ea8 100644 --- a/doc/4-monitoring-remote-systems.md +++ b/doc/4-monitoring-remote-systems.md @@ -330,7 +330,7 @@ A sample config looks like: You can simply enable the `api` feature using - # icinga2-enable-feature api + # icinga2 feature enable api Edit `/etc/icinga2/features-enabled/api.conf` if you require the configuration synchronisation enabled for this node. Set the `accept_config` attribute to `true`. @@ -811,7 +811,7 @@ fails the other nodes will automatically take over the reamining checks. > If a node should not check anything, disable the `checker` feature explicitely and > reload Icinga 2. - # icinga2-disable-feature checker + # icinga2 feature disable checker # service icinga2 reload #### High Availability with Notifications @@ -829,7 +829,7 @@ have the DB IDO feature enabled. Example DB IDO MySQL: - # icinga2-enable-feature ido-mysql + # icinga2 feature enable ido-mysql The feature 'ido-mysql' is already enabled. By default the DB IDO feature only runs on the elected zone master. All other passive diff --git a/doc/6-configuring-icinga-2.md b/doc/6-configuring-icinga-2.md index 44ad75605..addde9a05 100644 --- a/doc/6-configuring-icinga-2.md +++ b/doc/6-configuring-icinga-2.md @@ -1624,7 +1624,7 @@ Example: Can be enabled/disabled using - # icinga2-enable-feature checker + # icinga2 feature enable checker ### NotificationComponent @@ -1646,7 +1646,7 @@ Attributes: Can be enabled/disabled using - # icinga2-enable-feature notification + # icinga2 feature enable notification ### FileLogger diff --git a/doc/7-troubleshooting.md b/doc/7-troubleshooting.md index 8dc9f7e45..df0a396b1 100644 --- a/doc/7-troubleshooting.md +++ b/doc/7-troubleshooting.md @@ -23,7 +23,7 @@ log severity as an additional parameter argument to `-x`. Additionally you can enable the debug log using - # icinga2-enable-feature debuglog + # icinga2 feature enable debuglog # service icinga2 restart # tail -f /var/log/icinga2/debug.log @@ -59,7 +59,7 @@ Examples: # sudo -u icinga /usr/lib/nagios/plugins/check_ping -4 -H 127.0.0.1 -c 5000,100% -w 3000,80% - # icinga2-enable-feature checker + # icinga2 feature enable checker The feature 'checker' is already enabled. @@ -80,7 +80,7 @@ Verify the following configuration Examples: - # icinga2-enable-feature notification + # icinga2 feature enable notification The feature 'notification' is already enabled. ## Feature is not working diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 402a7bde3..bc655f22f 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -19,7 +19,7 @@ file(GLOB DOCSRCS "*.md") if(UNIX OR CYGWIN) install( - FILES icinga2.8 icinga2-enable-feature.8 icinga2-disable-feature.8 icinga2-build-ca.8 icinga2-build-key.8 icinga2-sign-key.8 icinga2-prepare-dirs.8 + FILES icinga2.8 icinga2-build-ca.8 icinga2-build-key.8 icinga2-sign-key.8 icinga2-prepare-dirs.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8 ) endif() diff --git a/doc/icinga2-disable-feature.8 b/doc/icinga2-disable-feature.8 deleted file mode 100644 index 8472386bb..000000000 --- a/doc/icinga2-disable-feature.8 +++ /dev/null @@ -1,32 +0,0 @@ -.TH ICINGA2 "8" "June 2014" "icinga2 - The Icinga 2 network monitoring daemon." "System Administration Utilities" - -.SH NAME -icinga2-enable-feature \- Enable Icinga 2 features. - -.SH DESCRIPTION -icinga2-enable-feature \- Enable Icinga 2 features. - -.SH OPTIONS -.TP -\fB\fR -Whitespace separated list of Icinga 2 features to be disable - -.SH FILES -.TP -.IP /etc/icinga2/features-available -Configuration directory for available Icinga2 features - -.SH AUTHOR -Icinga2 is maintained by the Icinga Project . - -.SH "REPORTING BUGS" -Report bugs at -.br -Icinga home page: - -.SH COPYRIGHT -Copyright \(co 2012\-2014 Icinga Development Team (http://www.icinga.org) -License GPLv2+: GNU GPL version 2 or later -.br -This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law. diff --git a/doc/icinga2-enable-feature.8 b/doc/icinga2-enable-feature.8 deleted file mode 100644 index 289fe2841..000000000 --- a/doc/icinga2-enable-feature.8 +++ /dev/null @@ -1,32 +0,0 @@ -.TH ICINGA2 "8" "June 2014" "icinga2 - The Icinga 2 network monitoring daemon." "System Administration Utilities" - -.SH NAME -icinga2-enable-feature \- Enable Icinga 2 features. - -.SH DESCRIPTION -icinga2-enable-feature \- Enable Icinga 2 features. - -.SH OPTIONS -.TP -\fB\fR -Whitespace separated list of Icinga 2 features to be enabled - -.SH FILES -.TP -.IP /etc/icinga2/features-available -Configuration directory for available Icinga2 features - -.SH AUTHOR -Icinga2 is maintained by the Icinga Project . - -.SH "REPORTING BUGS" -Report bugs at -.br -Icinga home page: - -.SH COPYRIGHT -Copyright \(co 2012\-2014 Icinga Development Team (http://www.icinga.org) -License GPLv2+: GNU GPL version 2 or later -.br -This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law. diff --git a/etc/icinga2/icinga2.conf b/etc/icinga2/icinga2.conf index ff2df086f..8829f0cc5 100644 --- a/etc/icinga2/icinga2.conf +++ b/etc/icinga2/icinga2.conf @@ -29,8 +29,9 @@ include /** * The features-available directory contains a number of configuration * files for features which can be enabled and disabled using the - * icinga2-enable-feature / icinga2-disable-feature tools. These two tools work by creating - * and removing symbolic links in the features-enabled directory. + * icinga2 feature enable / icinga2 feature disable CLI commands. + * These commands work by creating and removing symbolic links in + * the features-enabled directory. */ include "features-enabled/*.conf" diff --git a/icinga2.spec b/icinga2.spec index 63d25068b..c10c0803e 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -295,7 +295,7 @@ exit 0 %endif # initial installation, enable default features -%{_sbindir}/icinga2-enable-feature checker notification mainlog +%{_sbindir}/icinga2 feature enable checker notification mainlog exit 0 @@ -311,7 +311,7 @@ exit 0 if [ ${1:-0} -eq 1 ] then # initial installation, enable default features - %{_sbindir}/icinga2-enable-feature checker notification mainlog + %{_sbindir}/icinga2 feature enable checker notification mainlog fi exit 0 @@ -383,7 +383,7 @@ exit 0 if [ ${1:-0} -eq 1 ] then # initial installation, enable ido-mysql feature - %{_sbindir}/icinga2-enable-feature ido-mysql + %{_sbindir}/icinga2 feature enable ido-mysql fi exit 0 @@ -391,7 +391,7 @@ exit 0 %postun ido-mysql if [ "$1" = "0" ]; then # deinstallation of the package - remove feature - test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature ido-mysql + test -x %{_sbindir}/icinga2 feature disable && %{_sbindir}/icinga2 feature disable ido-mysql fi exit 0 @@ -400,7 +400,7 @@ exit 0 if [ ${1:-0} -eq 1 ] then # initial installation, enable ido-pgsql feature - %{_sbindir}/icinga2-enable-feature ido-pgsql + %{_sbindir}/icinga2 feature enable ido-pgsql fi exit 0 @@ -408,7 +408,7 @@ exit 0 %postun ido-pgsql if [ "$1" = "0" ]; then # deinstallation of the package - remove feature - test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature ido-pgsql + test -x %{_sbindir}/icinga2 feature disable && %{_sbindir}/icinga2 feature disable ido-pgsql fi exit 0 @@ -417,7 +417,7 @@ exit 0 if [ ${1:-0} -eq 1 ] then # initial installation, enable features - %{_sbindir}/icinga2-enable-feature statusdata compatlog command + %{_sbindir}/icinga2 feature enable statusdata compatlog command fi exit 0 @@ -425,9 +425,9 @@ exit 0 %postun classicui-config if [ "$1" = "0" ]; then # deinstallation of the package - remove feature - test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature statusdata - test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature compatlog - test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature command + test -x %{_sbindir}/icinga2 feature disable && %{_sbindir}/icinga2 feature disable statusdata + test -x %{_sbindir}/icinga2 feature disable && %{_sbindir}/icinga2 feature disable compatlog + test -x %{_sbindir}/icinga2 feature disable && %{_sbindir}/icinga2 feature disable command fi exit 0 @@ -472,8 +472,6 @@ exit 0 %{_bindir}/%{name}-build-key %{_bindir}/%{name}-sign-key %{_sbindir}/%{name}-list-objects -%{_sbindir}/%{name}-enable-feature -%{_sbindir}/%{name}-disable-feature %{_sbindir}/%{name}-setup-agent %{_sbindir}/%{name}-discover-agent %{_sbindir}/%{name}-forget-agent @@ -485,8 +483,7 @@ exit 0 %{_datadir}/%{name} %exclude %{_datadir}/%{name}/include %{_mandir}/man8/%{name}.8.gz -%{_mandir}/man8/%{name}-enable-feature.8.gz -%{_mandir}/man8/%{name}-disable-feature.8.gz +%{_mandir}/man8/%{name}-feature enable.8.gz %{_mandir}/man8/%{name}-build-ca.8.gz %{_mandir}/man8/%{name}-build-key.8.gz %{_mandir}/man8/%{name}-sign-key.8.gz diff --git a/test/jenkins/livestatus_socket.test b/test/jenkins/livestatus_socket.test index ebb69729b..aef58f24a 100755 --- a/test/jenkins/livestatus_socket.test +++ b/test/jenkins/livestatus_socket.test @@ -4,7 +4,7 @@ livestatus_path="/var/run/icinga2/cmd/livestatus" if [ ! -e $livestatus_path ]; then - sudo icinga2-enable-feature livestatus 1> /dev/null + sudo icinga2-feature enable livestatus 1> /dev/null sudo service icinga2 restart 1> /dev/null sleep 1 diff --git a/test/jenkins/statusdata.test b/test/jenkins/statusdata.test index e1a43de26..b0d3f93bd 100755 --- a/test/jenkins/statusdata.test +++ b/test/jenkins/statusdata.test @@ -5,7 +5,7 @@ objectscache_path="/var/cache/icinga2/objects.cache" if [ ! -f $statusdata_path ]; then - sudo icinga2-enable-feature statusdata 1> /dev/null + sudo icinga2-feature enable statusdata 1> /dev/null sudo service icinga2 restart 1> /dev/null n=0 diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index cefbb7012..1755fc3da 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -18,15 +18,3 @@ add_subdirectory(mkclass) add_subdirectory(mkembedconfig) add_subdirectory(mkunity) - -if(UNIX OR CYGWIN) - configure_file(icinga2-enable-feature.cmake ${CMAKE_CURRENT_BINARY_DIR}/icinga2-enable-feature @ONLY) - - install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/icinga2-enable-feature - DESTINATION ${CMAKE_INSTALL_SBINDIR} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - ) - - install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ./icinga2-enable-feature \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SBINDIR}/icinga2-disable-feature\")") -endif() diff --git a/tools/icinga2-enable-feature.cmake b/tools/icinga2-enable-feature.cmake deleted file mode 100644 index 6236978d4..000000000 --- a/tools/icinga2-enable-feature.cmake +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -ICINGA2CONFDIR=@CMAKE_INSTALL_FULL_SYSCONFDIR@/icinga2 - -TOOL=$(basename -- $0) - -if [ "$TOOL" != "icinga2-enable-feature" -a "$TOOL" != "icinga2-disable-feature" ]; then - echo "Invalid tool name ($TOOL). Should be 'icinga2-enable-feature' or 'icinga2-disable-feature'." - exit 1 -fi - -if [ -z "$1" ]; then - echo "Syntax: $TOOL " - echo " Example: $TOOL checker notification mainlog" - - if [ "$TOOL" = "icinga2-enable-feature" ]; then - echo "Enables the specified feature(s)." - else - echo "Disables the specified feature(s)." - fi - - echo - echo -n "Available features: " - - for file in $ICINGA2CONFDIR/features-available/*.conf; do - echo -n "$(basename -- $file .conf) " - done - - echo - echo -n "Enabled features: " - - for file in $ICINGA2CONFDIR/features-enabled/*.conf; do - echo -n "$(basename -- $file .conf) " - done - - echo - - exit 1 -fi - -FEATURES=$1 - -for FEATURES -do - SKIP="" - # Define array var - # Based http://blog.isonoe.net/post/2010/09/24/Pseudo-arrays-for-POSIX-shell - eval "set -- $FEATURES" - for FEATURE - do - SKIP="NOTOK" - if [ ! -e $ICINGA2CONFDIR/features-available/$FEATURE.conf ]; then - echo "Feature '$FEATURE' does not exist." - exit 1 - fi - - if [ "$TOOL" = "icinga2-enable-feature" ]; then - if [ -e $ICINGA2CONFDIR/features-enabled/$FEATURE.conf ]; then - echo "The feature '$FEATURE' is already enabled." - SKIP="OK" - fi - if [ "$SKIP" != "OK" ]; then - if ! ln -s ../features-available/$FEATURE.conf $ICINGA2CONFDIR/features-enabled/; then - echo "Enabling '$FEATURE' failed. Check permissions for $ICINGA2CONFDIR/features-enabled/" - exit 1 - else - echo "Module '$FEATURE' has been enabled." - RELOAD="YES" - fi - fi - elif [ "$TOOL" = "icinga2-disable-feature" ]; then - if [ ! -e $ICINGA2CONFDIR/features-enabled/$FEATURE.conf ]; then - echo "The feature '$FEATURE' is already disabled." - SKIP="OK" - fi - - if [ "$SKIP" != "OK" ]; then - if ! rm -f $ICINGA2CONFDIR/features-enabled/$FEATURE.conf; then - echo "Disabling '$FEATURE' failed. Check permissions for $ICINGA2CONFDIR/features-enabled/$FEATURE.conf" - exit 1 - else - echo "Feature '$FEATURE' has been disabled." - RELOAD="YES" - fi - fi - fi - done -done -if [ "$RELOAD" = "YES" ]; then - echo "Make sure to restart Icinga 2 for these changes to take effect." -fi -exit 0 -- 2.40.0