mirror of https://github.com/Icinga/icinga2.git
parent
5de03cac18
commit
9ab4b3dd16
|
@ -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)
|
||||
|
|
|
@ -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$"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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$"
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
### <a id="objecttype-externalcommandlistener"></a> 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".
|
||||
|
||||
### <a id="objecttype-compatlogger"></a> 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".
|
||||
|
||||
### <a id="objecttype-checkresultreader"></a> 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/".
|
||||
|
||||
### <a id="objecttype-checkcomponent"></a> 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.
|
||||
|
||||
### <a id="objecttype-clusterlistener"></a> ClusterListener
|
||||
|
|
|
@ -39,12 +39,12 @@ enable the required libraries in the icinga2.conf configuration file:
|
|||
### <a id="configure-nodename"></a> 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"
|
||||
|
||||
### <a id="cluster-naming-convention"></a> 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"
|
||||
|
||||
|
||||
### <a id="initial-cluster-sync"></a> 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
|
||||
|
||||
|
||||
### <a id="cluster-scenarios"></a> 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.
|
||||
|
|
|
@ -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).
|
||||
|
||||
|
||||
### <a id="schema-livestatus"></a> 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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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$"
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
|
||||
object FileLogger "debug-file" {
|
||||
severity = "debug",
|
||||
path = IcingaLocalStateDir + "/log/icinga2/debug.log"
|
||||
path = LocalStateDir + "/log/icinga2/debug.log"
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
|
||||
object FileLogger "main-log" {
|
||||
severity = "information",
|
||||
path = IcingaLocalStateDir + "/log/icinga2/icinga2.log"
|
||||
path = LocalStateDir + "/log/icinga2/icinga2.log"
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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$"
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ void Process::Run(const boost::function<void (const ProcessResult&)>& 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<bool>(use_vfork))
|
||||
m_Pid = vfork();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue