mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Rename i2enfeature/i2disfeature to icinga2-{enable,disable}-feature.
fixes #4904
This commit is contained in:
parent
3c6226a223
commit
0c37d63af5
@ -94,7 +94,7 @@ define icinga2::feature ($feature = $title) {
|
|||||||
exec { "icinga2-feature-${feature}":
|
exec { "icinga2-feature-${feature}":
|
||||||
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
||||||
unless => "readlink /etc/icinga2/features-enabled/${feature}.conf",
|
unless => "readlink /etc/icinga2/features-enabled/${feature}.conf",
|
||||||
command => "i2enfeature ${feature}",
|
command => "icinga2-enable-feature ${feature}",
|
||||||
require => [ Package['icinga2'] ],
|
require => [ Package['icinga2'] ],
|
||||||
notify => Service['icinga2']
|
notify => Service['icinga2']
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,7 @@ third-party/execvpe/Makefile
|
|||||||
third-party/mmatch/Makefile
|
third-party/mmatch/Makefile
|
||||||
tools/Makefile
|
tools/Makefile
|
||||||
tools/migration/Makefile
|
tools/migration/Makefile
|
||||||
tools/i2enfeature
|
tools/icinga2-enable-feature
|
||||||
tools/mkembedconfig/Makefile
|
tools/mkembedconfig/Makefile
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -85,13 +85,13 @@ and constants you can use to configure your services.
|
|||||||
/**
|
/**
|
||||||
* The features-available directory contains a number of configuration
|
* The features-available directory contains a number of configuration
|
||||||
* files for features which can be enabled and disabled using the
|
* files for features which can be enabled and disabled using the
|
||||||
* i2enfeature / i2disfeature tools. These two tools work by creating
|
* icinga2-enable-feature / icinga2-disable-feature tools. These two tools work by creating
|
||||||
* and removing symbolic links in the features-enabled directory.
|
* and removing symbolic links in the features-enabled directory.
|
||||||
*/
|
*/
|
||||||
include "features-enabled/*.conf"
|
include "features-enabled/*.conf"
|
||||||
|
|
||||||
This include directive takes care of including the configuration files for all
|
This include directive takes care of including the configuration files for all
|
||||||
the features which have been enabled with `i2enfeature`. See
|
the features which have been enabled with `icinga2-enable-feature`. See
|
||||||
[Enabling/Disabling Features](#features) for more details.
|
[Enabling/Disabling Features](#features) for more details.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,11 +31,11 @@ Once you've built Classic UI you can install it:
|
|||||||
By default Icinga 2 does not write `status.dat` and `objects.cache` files which are used
|
By default Icinga 2 does not write `status.dat` and `objects.cache` files which are used
|
||||||
by the Classic UI. The command pipe is also not enabled by default.
|
by the Classic UI. The command pipe is also not enabled by default.
|
||||||
|
|
||||||
You can use i2enfeature to enable these features:
|
You can use icinga2-enable-feature to enable these features:
|
||||||
|
|
||||||
# i2enfeature statusdata
|
# icinga2-enable-feature statusdata
|
||||||
# i2enfeature compatlog
|
# icinga2-enable-feature compatlog
|
||||||
# i2enfeature command
|
# icinga2-enable-feature command
|
||||||
|
|
||||||
After enabling these features you will need to restart Icinga 2:
|
After enabling these features you will need to restart Icinga 2:
|
||||||
|
|
||||||
|
@ -78,9 +78,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
|
`/etc/icinga2/features-available/ido-mysql.conf`. You will need to update the
|
||||||
database credentials in this file.
|
database credentials in this file.
|
||||||
|
|
||||||
You can enable the `ido-mysql` feature configuration file using `i2enfeature`:
|
You can enable the `ido-mysql` feature configuration file using `icinga2-enable-feature`:
|
||||||
|
|
||||||
# i2enfeature ido-mysql
|
# icinga2-enable-feature ido-mysql
|
||||||
Module 'ido-mysql' was enabled.
|
Module 'ido-mysql' was enabled.
|
||||||
Make sure to restart Icinga 2 for these changes to take effect.
|
Make sure to restart Icinga 2 for these changes to take effect.
|
||||||
|
|
||||||
|
@ -8,9 +8,9 @@ The Livestatus component that is distributed as part of Icinga 2 is a
|
|||||||
re-implementation of the Livestatus protocol which is compatible with MK
|
re-implementation of the Livestatus protocol which is compatible with MK
|
||||||
Livestatus.
|
Livestatus.
|
||||||
|
|
||||||
You can enable Livestatus using i2enfeature:
|
You can enable Livestatus using icinga2-enable-feature:
|
||||||
|
|
||||||
# i2enfeature livestatus
|
# icinga2-enable-feature livestatus
|
||||||
|
|
||||||
After that you will have to restart Icinga 2:
|
After that you will have to restart Icinga 2:
|
||||||
|
|
||||||
|
@ -73,32 +73,32 @@ is returned.
|
|||||||
|
|
||||||
Icinga 2 provides configuration files for some commonly used features. These
|
Icinga 2 provides configuration files for some commonly used features. These
|
||||||
are installed in the `/etc/icinga2/features-available` directory and can be
|
are installed in the `/etc/icinga2/features-available` directory and can be
|
||||||
enabled and disabled using the `i2enfeature` and `i2disfeature` tools,
|
enabled and disabled using the `icinga2-enable-feature` and `icinga2-disable-feature` tools,
|
||||||
respectively.
|
respectively.
|
||||||
|
|
||||||
The `i2enfeature` tool creates symlinks in the `/etc/icinga2/features-enabled`
|
The `icinga2-enable-feature` tool creates symlinks in the `/etc/icinga2/features-enabled`
|
||||||
directory which is included by default in the example configuration file.
|
directory which is included by default in the example configuration file.
|
||||||
|
|
||||||
You can view a list of available feature configuration files:
|
You can view a list of available feature configuration files:
|
||||||
|
|
||||||
# i2enfeature
|
# icinga2-enable-feature
|
||||||
Syntax: i2enfeature <feature>
|
Syntax: icinga2-enable-feature <feature>
|
||||||
Enables the specified feature.
|
Enables the specified feature.
|
||||||
|
|
||||||
Available features: statusdata
|
Available features: statusdata
|
||||||
|
|
||||||
Using the `i2enfeature` command you can enable features:
|
Using the `icinga2-enable-feature` command you can enable features:
|
||||||
|
|
||||||
# i2enfeature statusdata
|
# icinga2-enable-feature statusdata
|
||||||
Module 'statusdata' was enabled.
|
Module 'statusdata' was enabled.
|
||||||
Make sure to restart Icinga 2 for these changes to take effect.
|
Make sure to restart Icinga 2 for these changes to take effect.
|
||||||
|
|
||||||
You can disable features using the `i2disfeature` command:
|
You can disable features using the `icinga2-disable-feature` command:
|
||||||
|
|
||||||
# i2disfeature statusdata
|
# icinga2-disable-feature statusdata
|
||||||
Module 'statusdata' was disabled.
|
Module 'statusdata' was disabled.
|
||||||
Make sure to restart Icinga 2 for these changes to take effect.
|
Make sure to restart Icinga 2 for these changes to take effect.
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
>
|
>
|
||||||
> The `i2enfeature` and `i2disfeature` commands do not restart Icinga 2.
|
> The `icinga2-enable-feature` and `icinga2-disable-feature` commands do not restart Icinga 2.
|
||||||
|
@ -7,7 +7,7 @@ through the web interface).
|
|||||||
In order to enable the `ExternalCommandListener` configuration use the
|
In order to enable the `ExternalCommandListener` configuration use the
|
||||||
following command and restart Icinga 2 afterwards:
|
following command and restart Icinga 2 afterwards:
|
||||||
|
|
||||||
# i2enfeature command
|
# icinga2-enable-feature command
|
||||||
|
|
||||||
Icinga 2 creates the command pipe file as `/var/run/icinga2/cmd/icinga2.cmd`
|
Icinga 2 creates the command pipe file as `/var/run/icinga2/cmd/icinga2.cmd`
|
||||||
using the default configuration.
|
using the default configuration.
|
||||||
|
@ -29,7 +29,7 @@ the output template format backed with Icinga 2 runtime macros.
|
|||||||
The default template is already provided with the Icinga 2 feature configuration
|
The default template is already provided with the Icinga 2 feature configuration
|
||||||
which can be enabled using
|
which can be enabled using
|
||||||
|
|
||||||
# i2enfeature perfdata
|
# icinga2-enable-feature perfdata
|
||||||
|
|
||||||
By default all performance data files are rotated in a 15 seconds interval into
|
By default all performance data files are rotated in a 15 seconds interval into
|
||||||
the `/var/spool/icinga2/perfdata/` directory as `service-perfdata.<timestamp>`.
|
the `/var/spool/icinga2/perfdata/` directory as `service-perfdata.<timestamp>`.
|
||||||
@ -53,7 +53,7 @@ write these to the defined Graphite Carbon daemon tcp socket.
|
|||||||
|
|
||||||
You can enable the feature using
|
You can enable the feature using
|
||||||
|
|
||||||
# i2enfeature graphite
|
# icinga2-enable-feature graphite
|
||||||
|
|
||||||
The `GraphiteWriter` object expects the Graphite Carbon Cache socket listening
|
The `GraphiteWriter` object expects the Graphite Carbon Cache socket listening
|
||||||
at `127.0.0.1` on port `2003` by default.
|
at `127.0.0.1` on port `2003` by default.
|
||||||
|
@ -5,7 +5,7 @@ interval to its `objects.cache` and `status.dat` files. Icinga 2 provides
|
|||||||
the `StatusDataWriter` object which dumps all configuration objects and
|
the `StatusDataWriter` object which dumps all configuration objects and
|
||||||
status updates in a regular interval.
|
status updates in a regular interval.
|
||||||
|
|
||||||
# i2enfeature statusdata
|
# icinga2-enable-feature statusdata
|
||||||
|
|
||||||
Icinga 1.x Classic UI requires this data set as part of its backend.
|
Icinga 1.x Classic UI requires this data set as part of its backend.
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ sla reports and trends in Icinga 1.x Classic UI.
|
|||||||
|
|
||||||
The `CompatLogger` object can be enabled with
|
The `CompatLogger` object can be enabled with
|
||||||
|
|
||||||
# i2enfeature compatlog
|
# icinga2-enable-feature compatlog
|
||||||
|
|
||||||
By default, the Icinga 1.x log file called `icinga.log` is located
|
By default, the Icinga 1.x log file called `icinga.log` is located
|
||||||
in `/var/log/icinga2/compat`. Rotated log files are moved into
|
in `/var/log/icinga2/compat`. Rotated log files are moved into
|
||||||
|
@ -12,7 +12,7 @@ include <itl/itl.conf>
|
|||||||
/**
|
/**
|
||||||
* The features-available directory contains a number of configuration
|
* The features-available directory contains a number of configuration
|
||||||
* files for features which can be enabled and disabled using the
|
* files for features which can be enabled and disabled using the
|
||||||
* i2enfeature / i2disfeature tools. These two tools work by creating
|
* icinga2-enable-feature / icinga2-disable-feature tools. These two tools work by creating
|
||||||
* and removing symbolic links in the features-enabled directory.
|
* and removing symbolic links in the features-enabled directory.
|
||||||
*/
|
*/
|
||||||
include "features-enabled/*.conf"
|
include "features-enabled/*.conf"
|
||||||
|
@ -192,30 +192,30 @@ exit 0
|
|||||||
if [ ${1:-0} -eq 1 ]
|
if [ ${1:-0} -eq 1 ]
|
||||||
then
|
then
|
||||||
# initial installation, enable ido-mysql feature
|
# initial installation, enable ido-mysql feature
|
||||||
%{_sbindir}/i2enfeature ido-mysql
|
%{_sbindir}/icinga2-enable-feature ido-mysql
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%postun ido-mysql
|
%postun ido-mysql
|
||||||
if [ "$1" = "0" ]; then
|
if [ "$1" = "0" ]; then
|
||||||
# deinstallation of the package - remove feature
|
# deinstallation of the package - remove feature
|
||||||
test -x %{_sbindir}/i2disfeature && %{_sbindir}/i2disfeature ido-mysql
|
test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature ido-mysql
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%post classicui-config
|
%post classicui-config
|
||||||
if [ ${1:-0} -eq 1 ]
|
if [ ${1:-0} -eq 1 ]
|
||||||
then
|
then
|
||||||
# initial installation, enable features
|
# initial installation, enable features
|
||||||
%{_sbindir}/i2enfeature statusdata
|
%{_sbindir}/icinga2-enable-feature statusdata
|
||||||
%{_sbindir}/i2enfeature compatlog
|
%{_sbindir}/icinga2-enable-feature compatlog
|
||||||
%{_sbindir}/i2enfeature command
|
%{_sbindir}/icinga2-enable-feature command
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%postun classicui-config
|
%postun classicui-config
|
||||||
if [ "$1" = "0" ]; then
|
if [ "$1" = "0" ]; then
|
||||||
# deinstallation of the package - remove feature
|
# deinstallation of the package - remove feature
|
||||||
test -x %{_sbindir}/i2disfeature && %{_sbindir}/i2disfeature statusdata
|
test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature statusdata
|
||||||
test -x %{_sbindir}/i2disfeature && %{_sbindir}/i2disfeature compatlog
|
test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature compatlog
|
||||||
test -x %{_sbindir}/i2disfeature && %{_sbindir}/i2disfeature command
|
test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature command
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%files
|
%files
|
||||||
@ -232,8 +232,8 @@ fi
|
|||||||
%{_bindir}/icinga2-migrate-config
|
%{_bindir}/icinga2-migrate-config
|
||||||
%{_bindir}/icinga2-build-ca
|
%{_bindir}/icinga2-build-ca
|
||||||
%{_bindir}/icinga2-build-key
|
%{_bindir}/icinga2-build-key
|
||||||
%{_sbindir}/i2enfeature
|
%{_sbindir}/icinga2-enable-feature
|
||||||
%{_sbindir}/i2disfeature
|
%{_sbindir}/icinga2-disable-feature
|
||||||
%exclude %{_libdir}/%{name}/libdb_ido_mysql*
|
%exclude %{_libdir}/%{name}/libdb_ido_mysql*
|
||||||
%{_libdir}/%{name}
|
%{_libdir}/%{name}
|
||||||
%{_datadir}/%{name}
|
%{_datadir}/%{name}
|
||||||
|
2
tools/.gitignore
vendored
2
tools/.gitignore
vendored
@ -1 +1 @@
|
|||||||
i2enfeature
|
icinga2-enable-feature
|
||||||
|
@ -2,10 +2,10 @@ SUBDIRS = \
|
|||||||
migration \
|
migration \
|
||||||
mkembedconfig
|
mkembedconfig
|
||||||
|
|
||||||
sbin_SCRIPTS = i2enfeature
|
sbin_SCRIPTS = icinga2-enable-feature
|
||||||
CLEANFILES = $(sbin_SCRIPTS)
|
CLEANFILES = $(sbin_SCRIPTS)
|
||||||
|
|
||||||
EXTRA_DIST = i2enfeature.in
|
EXTRA_DIST = icinga2-enable-feature.in
|
||||||
|
|
||||||
install-exec-hook:
|
install-exec-hook:
|
||||||
$(LN_S) -f i2enfeature $(DESTDIR)$(sbindir)/i2disfeature
|
$(LN_S) -f icinga2-enable-feature $(DESTDIR)$(sbindir)/icinga2-disable-feature
|
||||||
|
@ -10,15 +10,15 @@ ICINGA2CONFDIR=@sysconfdir@/icinga2
|
|||||||
|
|
||||||
TOOL=$(basename -- $0)
|
TOOL=$(basename -- $0)
|
||||||
|
|
||||||
if [ "$TOOL" != "i2enfeature" -a "$TOOL" != "i2disfeature" ]; then
|
if [ "$TOOL" != "icinga2-enable-feature" -a "$TOOL" != "icinga2-disable-feature" ]; then
|
||||||
echo "Invalid tool name ($TOOL). Should be 'i2enfeature' or 'i2disfeature'."
|
echo "Invalid tool name ($TOOL). Should be 'icinga2-enable-feature' or 'icinga2-disable-feature'."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "Syntax: $0 <feature>"
|
echo "Syntax: $0 <feature>"
|
||||||
|
|
||||||
if [ "$TOOL" = "i2enfeature" ]; then
|
if [ "$TOOL" = "icinga2-enable-feature" ]; then
|
||||||
echo "Enables the specified feature."
|
echo "Enables the specified feature."
|
||||||
else
|
else
|
||||||
echo "Disables the specified feature."
|
echo "Disables the specified feature."
|
||||||
@ -43,7 +43,7 @@ if [ ! -e $ICINGA2CONFDIR/features-available/$FEATURE.conf ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$TOOL" = "i2enfeature" ]; then
|
if [ "$TOOL" = "icinga2-enable-feature" ]; then
|
||||||
if [ -e $ICINGA2CONFDIR/features-enabled/$FEATURE.conf ]; then
|
if [ -e $ICINGA2CONFDIR/features-enabled/$FEATURE.conf ]; then
|
||||||
echo "The feature '$FEATURE' is already enabled."
|
echo "The feature '$FEATURE' is already enabled."
|
||||||
exit 0
|
exit 0
|
||||||
@ -52,7 +52,7 @@ if [ "$TOOL" = "i2enfeature" ]; then
|
|||||||
ln -s ../features-available/$FEATURE.conf $ICINGA2CONFDIR/features-enabled/
|
ln -s ../features-available/$FEATURE.conf $ICINGA2CONFDIR/features-enabled/
|
||||||
|
|
||||||
echo "Module '$FEATURE' was enabled."
|
echo "Module '$FEATURE' was enabled."
|
||||||
elif [ "$TOOL" = "i2disfeature" ]; then
|
elif [ "$TOOL" = "icinga2-disable-feature" ]; then
|
||||||
if [ ! -e $ICINGA2CONFDIR/features-enabled/$FEATURE.conf ]; then
|
if [ ! -e $ICINGA2CONFDIR/features-enabled/$FEATURE.conf ]; then
|
||||||
echo "The feature '$FEATURE' is already disabled."
|
echo "The feature '$FEATURE' is already disabled."
|
||||||
exit 0
|
exit 0
|
Loading…
x
Reference in New Issue
Block a user