From 9ab4b3dd16517998e171234cd3f1620580d2d508 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Mon, 7 Apr 2014 21:30:27 +0200 Subject: [PATCH] Remove the 'Icinga' prefix for global constants. Fixes #5960 --- ChangeLog | 2 +- doc/3.02-commands.md | 2 +- doc/3.03-custom-attributes-runtime-macros.md | 2 +- doc/3.04-notifications.md | 2 +- doc/4.2-global-variables.md | 34 +++++++++--------- doc/4.3-object-types.md | 28 +++++++-------- doc/6.04-cluster.md | 16 ++++----- doc/6.12-schemas.md | 4 +-- doc/8-differences-between-icinga-1x-and-2.md | 2 +- etc/icinga2/conf.d/notifications.conf | 4 +-- etc/icinga2/features-available/debuglog.conf | 2 +- etc/icinga2/features-available/mainlog.conf | 2 +- icinga-app/icinga.cpp | 2 +- itl/command-common.conf | 2 +- lib/base/application.cpp | 36 +++++++++---------- lib/base/process-unix.cpp | 2 +- lib/icinga/icingaapplication.cpp | 26 +++++++------- test/jenkins/files/configs/notifications.conf | 2 +- 18 files changed, 85 insertions(+), 85 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c6426b0f..0a568c6cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,7 +39,7 @@ Please check doc/1-about.md. ### What's New in Version 0.0.8 * Add [Dependency](#objecttype-dependency) object for advanced host/service dependency definition -* Add optional [IcingaNodeName](#global-constants) for cluster feature +* Add optional [NodeName](#global-constants) for cluster feature * Populate check_source attribute with the checker's node name * [Cluster](#objecttype-endpoint) supports recursive config includes * Add [Cluster health check](#cluster-health-check) diff --git a/doc/3.02-commands.md b/doc/3.02-commands.md index 3a5c3b932..945fc2134 100644 --- a/doc/3.02-commands.md +++ b/doc/3.02-commands.md @@ -90,7 +90,7 @@ TODO object NotificationCommand "mail-service-notification" { import "plugin-notification-command" - command = [ IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh" ] + command = [ SysconfDir + "/icinga2/scripts/mail-notification.sh" ] env = { "NOTIFICATIONTYPE" = "$notification.type$" diff --git a/doc/3.03-custom-attributes-runtime-macros.md b/doc/3.03-custom-attributes-runtime-macros.md index 2c4df4bdd..02bfc1338 100644 --- a/doc/3.03-custom-attributes-runtime-macros.md +++ b/doc/3.03-custom-attributes-runtime-macros.md @@ -54,7 +54,7 @@ up custom attributes and their respective values: 2. Service object 3. Host object 4. Command object -5. Global custom attributes in the IcingaVars constant +5. Global custom attributes in the Vars constant This execution order allows you to define default values for custom attributes in your command objects. The `my-ping` command shown above uses this to set diff --git a/doc/3.04-notifications.md b/doc/3.04-notifications.md index 8835633a8..188df926f 100644 --- a/doc/3.04-notifications.md +++ b/doc/3.04-notifications.md @@ -40,7 +40,7 @@ There are various custom attributes available at runtime execution of the object NotificationCommand "mail-service-notification" { import "plugin-notification-command" - command = [ IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh" ] + command = [ SysconfDir + "/icinga2/scripts/mail-notification.sh" ] env = { "NOTIFICATIONTYPE" = "$notification.type$" diff --git a/doc/4.2-global-variables.md b/doc/4.2-global-variables.md index 6d018b39d..6405b6e69 100644 --- a/doc/4.2-global-variables.md +++ b/doc/4.2-global-variables.md @@ -2,20 +2,20 @@ Icinga 2 provides a number of special global constants. Some of them can be overriden using the `--define` command line parameter: -Variable |Description ---------------------------|------------------- -IcingaPrefixDir |**Read-only.** Contains the installation prefix that was specified with cmake -DCMAKE_INSTALL_PREFIX. Defaults to "/usr/local". -IcingaSysconfDir |**Read-only.** Contains the path of the sysconf directory. Defaults to IcingaPrefixDir + "/etc". -IcingaLocalStateDir |**Read-only.** Contains the path of the local state directory. Defaults to IcingaPrefixDir + "/var". -IcingaPkgDataDir |**Read-only.** Contains the path of the package data directory. Defaults to IcingaPrefixDir + "/share/icinga2". -IcingaStatePath |**Read-write.** Contains the path of the Icinga 2 state file. Defaults to IcingaLocalStateDir + "/lib/icinga2/icinga2.state". -IcingaPidPath |**Read-write.** Contains the path of the Icinga 2 PID file. Defaults to IcingaLocalStateDir + "/run/icinga2/icinga2.pid". -IcingaVars |**Read-write.** Contains a dictionary with global custom attributes. Not set by default. -IcingaNodeName |**Read-write.** Contains the cluster node name. Set to the local hostname by default. -ApplicationType |**Read-write.** Contains the name of the Application type. Defaults to "icinga/IcingaApplication". -IcingaEnableNotifications |**Read-write.** Whether notifications are globally enabled. Defaults to true. -IcingaEnableEventHandlers |**Read-write.** Whether event handlers are globally enabled. Defaults to true. -IcingaEnableFlapping |**Read-write.** Whether flap detection is globally enabled. Defaults to true. -IcingaEnableChecks |**Read-write.** Whether active checks are globally enabled. Defaults to true. -IcingaEnablePerfdata |**Read-write.** Whether performance data processing is globally enabled. Defaults to true. -IcingaUseVfork |**Read-write.** Whether to use vfork(). Only available on *NIX. Defaults to true. +Variable |Description +--------------------|------------------- +PrefixDir |**Read-only.** Contains the installation prefix that was specified with cmake -DCMAKE_INSTALL_PREFIX. Defaults to "/usr/local". +SysconfDir |**Read-only.** Contains the path of the sysconf directory. Defaults to PrefixDir + "/etc". +LocalStateDir |**Read-only.** Contains the path of the local state directory. Defaults to PrefixDir + "/var". +PkgDataDir |**Read-only.** Contains the path of the package data directory. Defaults to PrefixDir + "/share/icinga2". +StatePath |**Read-write.** Contains the path of the Icinga 2 state file. Defaults to LocalStateDir + "/lib/icinga2/icinga2.state". +PidPath |**Read-write.** Contains the path of the Icinga 2 PID file. Defaults to LocalStateDir + "/run/icinga2/icinga2.pid". +Vars |**Read-write.** Contains a dictionary with global custom attributes. Not set by default. +NodeName |**Read-write.** Contains the cluster node name. Set to the local hostname by default. +ApplicationType |**Read-write.** Contains the name of the Application type. Defaults to "icinga/IcingaApplication". +EnableNotifications |**Read-write.** Whether notifications are globally enabled. Defaults to true. +EnableEventHandlers |**Read-write.** Whether event handlers are globally enabled. Defaults to true. +EnableFlapping |**Read-write.** Whether flap detection is globally enabled. Defaults to true. +EnableChecks |**Read-write.** Whether active checks are globally enabled. Defaults to true. +EnablePerfdata |**Read-write.** Whether performance data processing is globally enabled. Defaults to true. +UseVfork |**Read-write.** Whether to use vfork(). Only available on *NIX. Defaults to true. diff --git a/doc/4.3-object-types.md b/doc/4.3-object-types.md index dff7eecad..5bd4c41c9 100644 --- a/doc/4.3-object-types.md +++ b/doc/4.3-object-types.md @@ -457,7 +457,7 @@ Example: import "plugin-notification-command" command = [ - IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh" + SysconfDir + "/icinga2/scripts/mail-notification.sh" ] env = { @@ -533,10 +533,10 @@ Attributes: Name |Description ------------------------|---------------- - host_perfdata\_path |**Optional.** Path to the host performance data file. Defaults to IcingaLocalStateDir + "/spool/icinga2/perfdata/host-perfdata". - service_perfdata\_path |**Optional.** Path to the service performance data file. Defaults to IcingaLocalStateDir + "/spool/icinga2/perfdata/service-perfdata". - host_temp\_path |**Optional.** Path to the temporary host file. Defaults to IcingaLocalStateDir + "/spool/icinga2/tmp/host-perfdata". - service_temp\_path |**Optional.** Path to the temporary service file. Defaults to IcingaLocalStateDir + "/spool/icinga2/tmp/service-perfdata". + host_perfdata\_path |**Optional.** Path to the host performance data file. Defaults to LocalStateDir + "/spool/icinga2/perfdata/host-perfdata". + service_perfdata\_path |**Optional.** Path to the service performance data file. Defaults to LocalStateDir + "/spool/icinga2/perfdata/service-perfdata". + host_temp\_path |**Optional.** Path to the temporary host file. Defaults to LocalStateDir + "/spool/icinga2/tmp/host-perfdata". + service_temp\_path |**Optional.** Path to the temporary service file. Defaults to LocalStateDir + "/spool/icinga2/tmp/service-perfdata". host_format\_template |**Optional.** Host Format template for the performance data file. Defaults to a template that's suitable for use with PNP4Nagios. service_format\_template|**Optional.** Service Format template for the performance data file. Defaults to a template that's suitable for use with PNP4Nagios. rotation\_interval |**Optional.** Rotation interval for the files specified in `{host,service}\_perfdata\_path`. Defaults to 30 seconds. @@ -761,8 +761,8 @@ Attributes: socket\_type |**Optional.** Specifies the socket type. Can be either "tcp" or "unix". Defaults to "unix". bind\_host |**Optional.** Only valid when socket\_type is "tcp". Host address to listen on for connections. Defaults to "127.0.0.1". bind\_port |**Optional.** Only valid when `socket\_type` is "tcp". Port to listen on for connections. Defaults to 6558. - socket\_path |**Optional.** Only valid when `socket\_type` is "unix". Specifies the path to the UNIX socket file. Defaults to IcingaLocalStateDir + "/run/icinga2/cmd/livestatus". - compat\_log\_path |**Optional.** Required for historical table queries. Requires `CompatLogger` feature enabled. Defaults to IcingaLocalStateDir + "/log/icinga2/compat" + socket\_path |**Optional.** Only valid when `socket\_type` is "unix". Specifies the path to the UNIX socket file. Defaults to LocalStateDir + "/run/icinga2/cmd/livestatus". + compat\_log\_path |**Optional.** Required for historical table queries. Requires `CompatLogger` feature enabled. Defaults to LocalStateDir + "/log/icinga2/compat" > **Note** > @@ -786,8 +786,8 @@ Attributes: Name |Description ----------------|---------------- - status\_path |**Optional.** Path to the status.dat file. Defaults to IcingaLocalStateDir + "/cache/icinga2/status.dat". - objects\_path |**Optional.** Path to the objects.cache file. Defaults to IcingaLocalStateDir + "/cache/icinga2/objects.cache". + status\_path |**Optional.** Path to the status.dat file. Defaults to LocalStateDir + "/cache/icinga2/status.dat". + objects\_path |**Optional.** Path to the objects.cache file. Defaults to LocalStateDir + "/cache/icinga2/objects.cache". update\_interval|**Optional.** The interval in which the status files are updated. Defaults to 15 seconds. ### ExternalCommandListener @@ -806,7 +806,7 @@ Attributes: Name |Description ----------------|---------------- - command\_path |**Optional.** Path to the command pipe. Defaults to IcingaLocalStateDir + "/run/icinga2/cmd/icinga2.cmd". + command\_path |**Optional.** Path to the command pipe. Defaults to LocalStateDir + "/run/icinga2/cmd/icinga2.cmd". ### CompatLogger @@ -825,7 +825,7 @@ Attributes: Name |Description ----------------|---------------- - log\_dir |**Optional.** Path to the compat log directory. Defaults to IcingaLocalStateDir + "/log/icinga2/compat". + log\_dir |**Optional.** Path to the compat log directory. Defaults to LocalStateDir + "/log/icinga2/compat". rotation\_method|**Optional.** Specifies when to rotate log files. Can be one of "HOURLY", "DAILY", "WEEKLY" or "MONTHLY". Defaults to "HOURLY". ### CheckResultReader @@ -846,7 +846,7 @@ Attributes: Name |Description ----------------|---------------- - spool\_dir |**Optional.** The directory which contains the check result files. Defaults to IcingaLocalStateDir + "/lib/icinga2/spool/checkresults/". + spool\_dir |**Optional.** The directory which contains the check result files. Defaults to LocalStateDir + "/lib/icinga2/spool/checkresults/". ### CheckerComponent @@ -877,7 +877,7 @@ a defined JSON file. Example: object IcingaStatusWriter "status" { - status_path = IcingaLocalStateDir + "/cache/icinga2/status.json" + status_path = LocalStateDir + "/cache/icinga2/status.json" update_interval = 15s } @@ -885,7 +885,7 @@ Attributes: Name |Description --------------------------|-------------------------- - status\_path |**Optional.** Path to cluster status file. Defaults to IcingaLocalStateDir + "/cache/icinga2/status.json" + status\_path |**Optional.** Path to cluster status file. Defaults to LocalStateDir + "/cache/icinga2/status.json" update\_interval |**Optional.** The interval in which the status files are updated. Defaults to 15 seconds. ### ClusterListener diff --git a/doc/6.04-cluster.md b/doc/6.04-cluster.md index 4141680fe..c8f7344c3 100644 --- a/doc/6.04-cluster.md +++ b/doc/6.04-cluster.md @@ -39,12 +39,12 @@ enable the required libraries in the icinga2.conf configuration file: ### Configure the Icinga Node Name Instead of using the default FQDN as node name you can optionally set -that value using the [IcingaNodeName](#global-constants) constant. +that value using the [NodeName](#global-constants) constant. This setting must be unique on each cluster node, and must also match the name of the local [Endpoint](#objecttype-endpoint) object and the SSL certificate common name. - const IcingaNodeName = "icinga-node-1" + const NodeName = "icinga-node-1" Read further about additional [naming conventions](#cluster-naming-convention). @@ -142,7 +142,7 @@ In order to load configuration files which were received from a remote Icinga 2 instance you will have to add the following include directive to your `icinga2.conf` configuration file: - include_recursive IcingaLocalStateDir + "/lib/icinga2/cluster/config" + include_recursive LocalStateDir + "/lib/icinga2/cluster/config" ### Cluster Naming Convention @@ -181,10 +181,10 @@ The [Endpoint](#objecttype-endpoint) name is further referenced as `peers` attri peers = [ "icinga-node-2" ] } -Specifying the local node name using the [IcingaNodeName](#global-constants) variable requires +Specifying the local node name using the [NodeName](#global-constants) variable requires the same name as used for the endpoint name and common name above. If not set, the FQDN is used. - const IcingaNodeName = "icinga-node-1" + const NodeName = "icinga-node-1" ### Initial Cluster Sync @@ -246,12 +246,12 @@ check to the configured node. Special scenarios might require multiple cluster nodes running on a single host. By default Icinga 2 and its features will drop their runtime data below the prefix -`IcingaLocalStateDir`. By default packages will set that path to `/var`. +`LocalStateDir`. By default packages will set that path to `/var`. You can either set that variable as constant configuration definition in [icinga2.conf](#icinga2-conf) or pass it as runtime variable to the Icinga 2 daemon. - # icinga2 -c /etc/icinga2/node1/icinga2.conf -DIcingaLocalStateDir=/opt/node1/var + # icinga2 -c /etc/icinga2/node1/icinga2.conf -DLocalStateDir=/opt/node1/var ### Cluster Scenarios @@ -337,7 +337,7 @@ Example for the configuration on the `berlin` node: accept_config = [ "nuremberg" ] } - include_recursive IcingaLocalStateDir + "/lib/icinga2/cluster/config" + include_recursive LocalStateDir + "/lib/icinga2/cluster/config" Depenending on the network connectivity the connections can be either established by the remote node or the central node. diff --git a/doc/6.12-schemas.md b/doc/6.12-schemas.md index fc3b517bb..21b5ffceb 100644 --- a/doc/6.12-schemas.md +++ b/doc/6.12-schemas.md @@ -36,7 +36,7 @@ New columns: hosts | check_service_object_id | bigint | NULL | FK: objects table (service associated with column) Additional command custom variables populated from 'vars' dictionary. -Additional global custom variables populated from 'IcingaVars' constant (object_id is NULL). +Additional global custom variables populated from 'Vars' constant (object_id is NULL). ### Livestatus @@ -186,4 +186,4 @@ New columns: status | custom_variables Command custom variables reflect the local 'vars' dictionary. -Status custom variables reflect the global 'IcingaVars' constant. +Status custom variables reflect the global 'Vars' constant. diff --git a/doc/8-differences-between-icinga-1x-and-2.md b/doc/8-differences-between-icinga-1x-and-2.md index c1ffba3cf..52af7d882 100644 --- a/doc/8-differences-between-icinga-1x-and-2.md +++ b/doc/8-differences-between-icinga-1x-and-2.md @@ -16,7 +16,7 @@ the Icinga daemon at startup. Icinga 2 supports objects and (global) variables, but does not make a difference if it's the main configuration file, or any included file. - const IcingaEnableNotifications = true + const EnableNotifications = true object Service "test" { enable_notifications = 0 diff --git a/etc/icinga2/conf.d/notifications.conf b/etc/icinga2/conf.d/notifications.conf index 31ea3062d..14c35c54c 100644 --- a/etc/icinga2/conf.d/notifications.conf +++ b/etc/icinga2/conf.d/notifications.conf @@ -16,7 +16,7 @@ template Notification "mail-host-notification" { object NotificationCommand "mail-host-notification" { import "plugin-notification-command" - command = [ IcingaSysconfDir + "/icinga2/scripts/mail-host-notification.sh" ] + command = [ SysconfDir + "/icinga2/scripts/mail-host-notification.sh" ] env = { "NOTIFICATIONTYPE" = "$notification.type$" @@ -47,7 +47,7 @@ template Notification "mail-service-notification" { object NotificationCommand "mail-service-notification" { import "plugin-notification-command" - command = [ IcingaSysconfDir + "/icinga2/scripts/mail-service-notification.sh" ] + command = [ SysconfDir + "/icinga2/scripts/mail-service-notification.sh" ] env = { "NOTIFICATIONTYPE" = "$notification.type$" diff --git a/etc/icinga2/features-available/debuglog.conf b/etc/icinga2/features-available/debuglog.conf index 86947cbec..678969076 100644 --- a/etc/icinga2/features-available/debuglog.conf +++ b/etc/icinga2/features-available/debuglog.conf @@ -6,6 +6,6 @@ object FileLogger "debug-file" { severity = "debug", - path = IcingaLocalStateDir + "/log/icinga2/debug.log" + path = LocalStateDir + "/log/icinga2/debug.log" } diff --git a/etc/icinga2/features-available/mainlog.conf b/etc/icinga2/features-available/mainlog.conf index 2d237a451..773a0b436 100644 --- a/etc/icinga2/features-available/mainlog.conf +++ b/etc/icinga2/features-available/mainlog.conf @@ -4,6 +4,6 @@ object FileLogger "main-log" { severity = "information", - path = IcingaLocalStateDir + "/log/icinga2/icinga2.log" + path = LocalStateDir + "/log/icinga2/icinga2.log" } diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index 4c10e3a8c..cd784bdc5 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -344,7 +344,7 @@ int main(int argc, char **argv) Application::DeclareStatePath(Application::GetLocalStateDir() + "/lib/icinga2/icinga2.state"); Application::DeclarePidPath(Application::GetLocalStateDir() + "/run/icinga2/icinga2.pid"); - ScriptVariable::Set("IcingaUseVfork", true, false, true); + ScriptVariable::Set("UseVfork", true, false, true); Application::MakeVariablesConstant(); diff --git a/itl/command-common.conf b/itl/command-common.conf index 0d2db93ea..9ad92d200 100644 --- a/itl/command-common.conf +++ b/itl/command-common.conf @@ -276,7 +276,7 @@ object CheckCommand "snmp-extend"{ import "plugin-check-command", command = [ - IcingaSysconfDir + "/icinga2/scripts/snmp-extend.sh", + SysconfDir + "/icinga2/scripts/snmp-extend.sh", "$address$", "$community$", "$plugin$" diff --git a/lib/base/application.cpp b/lib/base/application.cpp index d42d7ee90..06accac69 100644 --- a/lib/base/application.cpp +++ b/lib/base/application.cpp @@ -626,7 +626,7 @@ void Application::ClosePidFile(void) */ String Application::GetPrefixDir(void) { - return ScriptVariable::Get("IcingaPrefixDir"); + return ScriptVariable::Get("PrefixDir"); } /** @@ -636,7 +636,7 @@ String Application::GetPrefixDir(void) */ void Application::DeclarePrefixDir(const String& path) { - ScriptVariable::Set("IcingaPrefixDir", path, false); + ScriptVariable::Set("PrefixDir", path, false); } /** @@ -646,7 +646,7 @@ void Application::DeclarePrefixDir(const String& path) */ String Application::GetSysconfDir(void) { - return ScriptVariable::Get("IcingaSysconfDir"); + return ScriptVariable::Get("SysconfDir"); } /** @@ -656,7 +656,7 @@ String Application::GetSysconfDir(void) */ void Application::DeclareSysconfDir(const String& path) { - ScriptVariable::Set("IcingaSysconfDir", path, false); + ScriptVariable::Set("SysconfDir", path, false); } /** @@ -666,7 +666,7 @@ void Application::DeclareSysconfDir(const String& path) */ String Application::GetLocalStateDir(void) { - return ScriptVariable::Get("IcingaLocalStateDir"); + return ScriptVariable::Get("LocalStateDir"); } /** @@ -676,7 +676,7 @@ String Application::GetLocalStateDir(void) */ void Application::DeclareLocalStateDir(const String& path) { - ScriptVariable::Set("IcingaLocalStateDir", path, false); + ScriptVariable::Set("LocalStateDir", path, false); } /** @@ -686,7 +686,7 @@ void Application::DeclareLocalStateDir(const String& path) */ String Application::GetPkgDataDir(void) { - return ScriptVariable::Get("IcingaPkgDataDir"); + return ScriptVariable::Get("PkgDataDir"); } /** @@ -696,7 +696,7 @@ String Application::GetPkgDataDir(void) */ void Application::DeclarePkgDataDir(const String& path) { - ScriptVariable::Set("IcingaPkgDataDir", path, false); + ScriptVariable::Set("PkgDataDir", path, false); } /** @@ -706,7 +706,7 @@ void Application::DeclarePkgDataDir(const String& path) */ String Application::GetStatePath(void) { - return ScriptVariable::Get("IcingaStatePath"); + return ScriptVariable::Get("StatePath"); } /** @@ -716,7 +716,7 @@ String Application::GetStatePath(void) */ void Application::DeclareStatePath(const String& path) { - ScriptVariable::Set("IcingaStatePath", path, false); + ScriptVariable::Set("StatePath", path, false); } /** @@ -726,7 +726,7 @@ void Application::DeclareStatePath(const String& path) */ String Application::GetPidPath(void) { - return ScriptVariable::Get("IcingaPidPath"); + return ScriptVariable::Get("PidPath"); } /** @@ -736,7 +736,7 @@ String Application::GetPidPath(void) */ void Application::DeclarePidPath(const String& path) { - ScriptVariable::Set("IcingaPidPath", path, false); + ScriptVariable::Set("PidPath", path, false); } /** @@ -761,12 +761,12 @@ void Application::DeclareApplicationType(const String& type) void Application::MakeVariablesConstant(void) { - ScriptVariable::GetByName("IcingaPrefixDir")->SetConstant(true); - ScriptVariable::GetByName("IcingaSysconfDir")->SetConstant(true); - ScriptVariable::GetByName("IcingaLocalStateDir")->SetConstant(true); - ScriptVariable::GetByName("IcingaPkgDataDir")->SetConstant(true); - ScriptVariable::GetByName("IcingaStatePath")->SetConstant(false); - ScriptVariable::GetByName("IcingaPidPath")->SetConstant(false); + ScriptVariable::GetByName("PrefixDir")->SetConstant(true); + ScriptVariable::GetByName("SysconfDir")->SetConstant(true); + ScriptVariable::GetByName("LocalStateDir")->SetConstant(true); + ScriptVariable::GetByName("PkgDataDir")->SetConstant(true); + ScriptVariable::GetByName("StatePath")->SetConstant(false); + ScriptVariable::GetByName("PidPath")->SetConstant(false); ScriptVariable::GetByName("ApplicationType")->SetConstant(true); } diff --git a/lib/base/process-unix.cpp b/lib/base/process-unix.cpp index 815e96a12..3f47c0135 100644 --- a/lib/base/process-unix.cpp +++ b/lib/base/process-unix.cpp @@ -219,7 +219,7 @@ void Process::Run(const boost::function& callback) m_ExtraEnvironment.reset(); #ifdef HAVE_VFORK - Value use_vfork = ScriptVariable::Get("IcingaUseVfork"); + Value use_vfork = ScriptVariable::Get("UseVfork"); if (use_vfork.IsEmpty() || static_cast(use_vfork)) m_Pid = vfork(); diff --git a/lib/icinga/icingaapplication.cpp b/lib/icinga/icingaapplication.cpp index 621a70c1a..b65cf2e80 100644 --- a/lib/icinga/icingaapplication.cpp +++ b/lib/icinga/icingaapplication.cpp @@ -38,12 +38,12 @@ INITIALIZE_ONCE(&IcingaApplication::StaticInitialize); void IcingaApplication::StaticInitialize(void) { - ScriptVariable::Set("IcingaEnableNotifications", true); - ScriptVariable::Set("IcingaEnableEventHandlers", true); - ScriptVariable::Set("IcingaEnableFlapping", true); - ScriptVariable::Set("IcingaEnableChecks", true); - ScriptVariable::Set("IcingaEnablePerfdata", true); - ScriptVariable::Set("IcingaNodeName", Utility::GetHostName()); + ScriptVariable::Set("EnableNotifications", true); + ScriptVariable::Set("EnableEventHandlers", true); + ScriptVariable::Set("EnableFlapping", true); + ScriptVariable::Set("EnableChecks", true); + ScriptVariable::Set("EnablePerfdata", true); + ScriptVariable::Set("NodeName", Utility::GetHostName()); } REGISTER_STATSFUNCTION(IcingaApplicationStats, &IcingaApplication::StatsFunc); @@ -118,7 +118,7 @@ IcingaApplication::Ptr IcingaApplication::GetInstance(void) Dictionary::Ptr IcingaApplication::GetVars(void) const { - ScriptVariable::Ptr sv = ScriptVariable::GetByName("IcingaVars"); + ScriptVariable::Ptr sv = ScriptVariable::GetByName("Vars"); if (!sv) return Dictionary::Ptr(); @@ -128,7 +128,7 @@ Dictionary::Ptr IcingaApplication::GetVars(void) const String IcingaApplication::GetNodeName(void) const { - return ScriptVariable::Get("IcingaNodeName"); + return ScriptVariable::Get("NodeName"); } bool IcingaApplication::ResolveMacro(const String& macro, const CheckResult::Ptr&, String *result) const @@ -173,7 +173,7 @@ bool IcingaApplication::GetEnableNotifications(void) const if (!GetOverrideEnableNotifications().IsEmpty()) return GetOverrideEnableNotifications(); else - return ScriptVariable::Get("IcingaEnableNotifications"); + return ScriptVariable::Get("EnableNotifications"); } void IcingaApplication::SetEnableNotifications(bool enabled) @@ -191,7 +191,7 @@ bool IcingaApplication::GetEnableEventHandlers(void) const if (!GetOverrideEnableEventHandlers().IsEmpty()) return GetOverrideEnableEventHandlers(); else - return ScriptVariable::Get("IcingaEnableEventHandlers"); + return ScriptVariable::Get("EnableEventHandlers"); } void IcingaApplication::SetEnableEventHandlers(bool enabled) @@ -209,7 +209,7 @@ bool IcingaApplication::GetEnableFlapping(void) const if (!GetOverrideEnableFlapping().IsEmpty()) return GetOverrideEnableFlapping(); else - return ScriptVariable::Get("IcingaEnableFlapping"); + return ScriptVariable::Get("EnableFlapping"); } void IcingaApplication::SetEnableFlapping(bool enabled) @@ -227,7 +227,7 @@ bool IcingaApplication::GetEnableChecks(void) const if (!GetOverrideEnableChecks().IsEmpty()) return GetOverrideEnableChecks(); else - return ScriptVariable::Get("IcingaEnableChecks"); + return ScriptVariable::Get("EnableChecks"); } void IcingaApplication::SetEnableChecks(bool enabled) @@ -245,7 +245,7 @@ bool IcingaApplication::GetEnablePerfdata(void) const if (!GetOverrideEnablePerfdata().IsEmpty()) return GetOverrideEnablePerfdata(); else - return ScriptVariable::Get("IcingaEnablePerfdata"); + return ScriptVariable::Get("EnablePerfdata"); } void IcingaApplication::SetEnablePerfdata(bool enabled) diff --git a/test/jenkins/files/configs/notifications.conf b/test/jenkins/files/configs/notifications.conf index b30d57f4d..a413db07c 100644 --- a/test/jenkins/files/configs/notifications.conf +++ b/test/jenkins/files/configs/notifications.conf @@ -27,7 +27,7 @@ template Notification "mail-notification" { object NotificationCommand "mail-service-notification" { import "plugin-notification-command", - command = [ (IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh") ], + command = [ (SysconfDir + "/icinga2/scripts/mail-notification.sh") ], export_macros = [ "NOTIFICATIONTYPE",