Remove icinga2-enable-feature and icinga2-disable-feature
authorGunnar Beutner <gunnar@beutner.name>
Tue, 14 Oct 2014 16:32:15 +0000 (18:32 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Tue, 14 Oct 2014 16:35:52 +0000 (18:35 +0200)
refs #7250

21 files changed:
agent/icinga2-setup-agent.cmake
debian/icinga2-classicui.postinst
debian/icinga2-common.postinst
debian/icinga2-ido-mysql.postinst
debian/icinga2-ido-mysql.templates
debian/icinga2-ido-pgsql.postinst
debian/icinga2-ido-pgsql.templates
doc/2-getting-started.md
doc/3-monitoring-basics.md
doc/4-monitoring-remote-systems.md
doc/6-configuring-icinga-2.md
doc/7-troubleshooting.md
doc/CMakeLists.txt
doc/icinga2-disable-feature.8 [deleted file]
doc/icinga2-enable-feature.8 [deleted file]
etc/icinga2/icinga2.conf
icinga2.spec
test/jenkins/livestatus_socket.test
test/jenkins/statusdata.test
tools/CMakeLists.txt
tools/icinga2-enable-feature.cmake [deleted file]

index 3e4c889f4177bc24927463dff8318175eaba5bd7..9ab06a6f3ef8ae659468b97b91dee687c054aeb4 100644 (file)
@@ -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 ""
index 57efaf2bdda06003dffda77284e8ac9fcfc561da..e01f1dc55be6e380c965281f3a70a27d5afd1ff7 100644 (file)
@@ -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
index 487f45a97afb37cf031e711c730c67022da215bc..9855ed3d24b7ffa7ea3320ccc3e574e30939c9b9 100644 (file)
@@ -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
 }
index 753dece814fd86a8c32f685c7fdccab37cf0e88e..dd16a193a61574aaefc377a4f076cc5072d3205a 100644 (file)
@@ -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
 
index 672a51587a2ec706f49ca4fb647dcfe560f58f33..4abc59912d643cc6ba2670a09fb260040bd1273e 100644 (file)
@@ -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
index e8fbad4f25e9b69ad233ccbc71987cc35c2bd535..a8fe5074e288d8c6299f4dfd1488252934908040 100644 (file)
@@ -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
 
index fb5c4b9d885ed6bc2baadc87d981bc5388b5cde3..0c46c1d94dbe299454fb807abf8e9dae3e84bf03 100644 (file)
@@ -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
index 3af3cde9368a8b3f3b71451d0be24fb1d176520d..28211acd26663c3644bb38850101e6b9917d9d05 100644 (file)
@@ -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 <features separated with whitespaces>
-      Example: icinga2-enable-feature checker notification mainlog
+    # icinga2 feature enable
+    Syntax: icinga2 feature enable <features separated with whitespaces>
+      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
 
 ## <a id="setting-up-icinga2-user-interfaces"></a> 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 <feature>
+    # icinga2 feature enable
+    Syntax: icinga2 feature enable <feature>
     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.
 
index 2fa84054721dbff29019a88ac3c820970533ed0a..af963c6a01281f75cda9462e764a0ecb22a424ba 100644 (file)
@@ -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.<timestamp>` 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
index f53ea9977a1764ee61ededcccca482ec2e05c748..fd8531ea8bc57ee50d850b3faea451dfdee4dac6 100644 (file)
@@ -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
 
 #### <a id="high-availability-notifications"></a> 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
index 44ad75605773b40699cb75c04166f25b4d6a8fa0..addde9a05c3ecb1295d16c64627779c4c6b092fc 100644 (file)
@@ -1624,7 +1624,7 @@ Example:
 
 Can be enabled/disabled using
 
-    # icinga2-enable-feature checker
+    # icinga2 feature enable checker
 
 
 ### <a id="objecttype-notificationcomponent"></a> NotificationComponent
@@ -1646,7 +1646,7 @@ Attributes:
 
 Can be enabled/disabled using
 
-    # icinga2-enable-feature notification
+    # icinga2 feature enable notification
 
 
 ### <a id="objecttype-filelogger"></a> FileLogger
index 8dc9f7e4525919b79f48fed5b1815dc3f84780c8..df0a396b18657a755174de549a1acc810a96bce7 100644 (file)
@@ -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.
 
 ## <a id="feature-not-working"></a> Feature is not working
index 402a7bde38c9992dad171f764122739c0c1d40c2..bc655f22fbf70774660666bfaa8dcf26a8fc2126 100644 (file)
@@ -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 (file)
index 8472386..0000000
+++ /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<features>\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 <info@icinga.org>.
-
-.SH "REPORTING BUGS"
-Report bugs at <https://dev.icinga.org/>
-.br
-Icinga home page: <http://www.icinga.org/>
-
-.SH COPYRIGHT
-Copyright \(co 2012\-2014 Icinga Development Team (http://www.icinga.org)
-License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>
-.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 (file)
index 289fe28..0000000
+++ /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<features>\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 <info@icinga.org>.
-
-.SH "REPORTING BUGS"
-Report bugs at <https://dev.icinga.org/>
-.br
-Icinga home page: <http://www.icinga.org/>
-
-.SH COPYRIGHT
-Copyright \(co 2012\-2014 Icinga Development Team (http://www.icinga.org)
-License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>
-.br
-This is free software: you are free to change and redistribute it.
-There is NO WARRANTY, to the extent permitted by law.
index ff2df086f211eb7d3eb6060a543e20a7aa0f0ee8..8829f0cc534fc266ebefb01a71779a057f073730 100644 (file)
@@ -29,8 +29,9 @@ include <plugins>
 /**
  * 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"
 
index 63d25068ba9ec0f929794df0f2456e4c962c17b5..c10c0803e785d410c7aa0dd07bd6ae03e6a0fb85 100644 (file)
@@ -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
index ebb69729bf028a3c21db87434184837ba0fac7b6..aef58f24a982af4a5310df3f838b325a03ad2787 100755 (executable)
@@ -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
 
index e1a43de26e7b9652810903ec81db62f04780d9f4..b0d3f93bd333c1d9b993f4501709a759d126f534 100755 (executable)
@@ -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
index cefbb7012eea583337536c85dfae69b875bd34bc..1755fc3da052e57ef7f607af32204840fa4088fa 100644 (file)
 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 (file)
index 6236978..0000000
+++ /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 <features separated with whitespaces>"
-       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