mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
parent
3383951791
commit
700cc43770
@ -113,7 +113,7 @@ If you require default macro definitions, you can add a macro dictionary as show
|
|||||||
`CheckCommand` object.
|
`CheckCommand` object.
|
||||||
|
|
||||||
object NotificationCommand "mail-service-notification" inherits "plugin-notification-command" {
|
object NotificationCommand "mail-service-notification" inherits "plugin-notification-command" {
|
||||||
command = [ (IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh") ],
|
command = [ IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh" ],
|
||||||
|
|
||||||
export_macros = [
|
export_macros = [
|
||||||
"NOTIFICATIONTYPE",
|
"NOTIFICATIONTYPE",
|
||||||
|
@ -273,7 +273,7 @@ Example:
|
|||||||
...
|
...
|
||||||
|
|
||||||
{
|
{
|
||||||
check_interval = (MyCheckInterval / 2.5)
|
check_interval = MyCheckInterval / 2.5
|
||||||
}
|
}
|
||||||
|
|
||||||
More details in the chapter [Constant Expressions](#constant-expressions).
|
More details in the chapter [Constant Expressions](#constant-expressions).
|
||||||
|
@ -25,11 +25,11 @@ The user `icingaadmin` in the example below will get notified only on `WARNING`
|
|||||||
object User "icingaadmin" {
|
object User "icingaadmin" {
|
||||||
display_name = "Icinga 2 Admin",
|
display_name = "Icinga 2 Admin",
|
||||||
enable_notifications = 1,
|
enable_notifications = 1,
|
||||||
notification_state_filter = (StateFilterOK |
|
notification_state_filter = StateFilterOK |
|
||||||
StateFilterWarning |
|
StateFilterWarning |
|
||||||
StateFilterCritical),
|
StateFilterCritical,
|
||||||
notification_type_filter = (NotificationFilterProblem |
|
notification_type_filter = NotificationFilterProblem |
|
||||||
NotificationFilterRecovery),
|
NotificationFilterRecovery,
|
||||||
macros = {
|
macros = {
|
||||||
"email" = "icinga@localhost",
|
"email" = "icinga@localhost",
|
||||||
"pager" = "+49123456789"
|
"pager" = "+49123456789"
|
||||||
@ -59,7 +59,7 @@ There are various macros available at runtime execution of the `NotificationComm
|
|||||||
The example below may or may not fit your needs.
|
The example below may or may not fit your needs.
|
||||||
|
|
||||||
object NotificationCommand "mail-service-notification" inherits "plugin-notification-command" {
|
object NotificationCommand "mail-service-notification" inherits "plugin-notification-command" {
|
||||||
command = [ (IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh") ],
|
command = [ IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh" ],
|
||||||
|
|
||||||
export_macros = [
|
export_macros = [
|
||||||
"NOTIFICATIONTYPE",
|
"NOTIFICATIONTYPE",
|
||||||
@ -91,18 +91,18 @@ to the defined notifications. That way you'll save duplicated attributes in each
|
|||||||
|
|
||||||
notification_command = "mail-service-notification",
|
notification_command = "mail-service-notification",
|
||||||
|
|
||||||
notification_state_filter = (StateFilterWarning |
|
notification_state_filter = StateFilterWarning |
|
||||||
StateFilterCritical |
|
StateFilterCritical |
|
||||||
StateFilterUnknown),
|
StateFilterUnknown,
|
||||||
notification_type_filter = (NotificationFilterProblem |
|
notification_type_filter = NotificationFilterProblem |
|
||||||
NotificationFilterAcknowledgement |
|
NotificationFilterAcknowledgement |
|
||||||
NotificationFilterRecovery |
|
NotificationFilterRecovery |
|
||||||
NotificationFilterCustom |
|
NotificationFilterCustom |
|
||||||
NotificationFilterFlappingStart |
|
NotificationFilterFlappingStart |
|
||||||
NotificationFilterFlappingEnd |
|
NotificationFilterFlappingEnd |
|
||||||
NotificationFilterDowntimeStart |
|
NotificationFilterDowntimeStart |
|
||||||
NotificationFilterDowntimeEnd |
|
NotificationFilterDowntimeEnd |
|
||||||
NotificationFilterDowntimeRemoved),
|
NotificationFilterDowntimeRemoved,
|
||||||
|
|
||||||
notification_period = "24x7"
|
notification_period = "24x7"
|
||||||
}
|
}
|
||||||
@ -274,18 +274,18 @@ Available state and type filters for notifications are:
|
|||||||
|
|
||||||
template Notification "generic-notification" {
|
template Notification "generic-notification" {
|
||||||
|
|
||||||
notification_state_filter = (StateFilterWarning |
|
notification_state_filter = StateFilterWarning |
|
||||||
StateFilterCritical |
|
StateFilterCritical |
|
||||||
StateFilterUnknown),
|
StateFilterUnknown,
|
||||||
notification_type_filter = (NotificationFilterProblem |
|
notification_type_filter = NotificationFilterProblem |
|
||||||
NotificationFilterAcknowledgement |
|
NotificationFilterAcknowledgement |
|
||||||
NotificationFilterRecovery |
|
NotificationFilterRecovery |
|
||||||
NotificationFilterCustom |
|
NotificationFilterCustom |
|
||||||
NotificationFilterFlappingStart |
|
NotificationFilterFlappingStart |
|
||||||
NotificationFilterFlappingEnd |
|
NotificationFilterFlappingEnd |
|
||||||
NotificationFilterDowntimeStart |
|
NotificationFilterDowntimeStart |
|
||||||
NotificationFilterDowntimeEnd |
|
NotificationFilterDowntimeEnd |
|
||||||
NotificationFilterDowntimeRemoved),
|
NotificationFilterDowntimeRemoved,
|
||||||
}
|
}
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
|
@ -324,7 +324,7 @@ Valid operators include ~, !, +, -, *, /, ==, !=, in and !in. The default prece
|
|||||||
overridden by grouping expressions using parentheses:
|
overridden by grouping expressions using parentheses:
|
||||||
|
|
||||||
{
|
{
|
||||||
check_interval (30 + 60) / 2
|
check_interval = (30 + 60) / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
Global constants may be used in constant expressions.
|
Global constants may be used in constant expressions.
|
||||||
|
@ -214,7 +214,7 @@ Example:
|
|||||||
parent_host = "internet",
|
parent_host = "internet",
|
||||||
parent_service = "ping4",
|
parent_service = "ping4",
|
||||||
|
|
||||||
state_filter = (StateFilterOK),
|
state_filter = StateFilterOK,
|
||||||
|
|
||||||
disable_checks = true
|
disable_checks = true
|
||||||
}
|
}
|
||||||
@ -230,7 +230,7 @@ Attributes:
|
|||||||
disable_checks |**Optional.** Whether to disable checks when this dependency fails. Defaults to false.
|
disable_checks |**Optional.** Whether to disable checks when this dependency fails. Defaults to false.
|
||||||
disable_notifications|**Optional.** Whether to disable notifications when this dependency fails. Defaults to true.
|
disable_notifications|**Optional.** Whether to disable notifications when this dependency fails. Defaults to true.
|
||||||
period |**Optional.** Time period during which this dependency is enabled.
|
period |**Optional.** Time period during which this dependency is enabled.
|
||||||
state_filter |**Optional.** A set of type filters when this dependency should be OK. Defaults to (StateFilterOK | StateFilterWarning).
|
state_filter |**Optional.** A set of type filters when this dependency should be OK. Defaults to StateFilterOK | StateFilterWarning.
|
||||||
|
|
||||||
Available state filters:
|
Available state filters:
|
||||||
|
|
||||||
@ -252,12 +252,12 @@ Example:
|
|||||||
enable_notifications = 1,
|
enable_notifications = 1,
|
||||||
notification_period = "24x7",
|
notification_period = "24x7",
|
||||||
|
|
||||||
notification_state_filter = (StateFilterOK |
|
notification_state_filter = StateFilterOK |
|
||||||
StateFilterWarning |
|
StateFilterWarning |
|
||||||
StateFilterCritical |
|
StateFilterCritical |
|
||||||
StateFilterUnknown),
|
StateFilterUnknown,
|
||||||
notification_type_filter = (NotificationFilterProblem |
|
notification_type_filter = NotificationFilterProblem |
|
||||||
NotificationFilterRecovery),
|
NotificationFilterRecovery,
|
||||||
macros = {
|
macros = {
|
||||||
"name" = "Icinga 2 Admin",
|
"name" = "Icinga 2 Admin",
|
||||||
"email" = "icinga@localhost",
|
"email" = "icinga@localhost",
|
||||||
@ -458,7 +458,7 @@ A notification command definition.
|
|||||||
Example:
|
Example:
|
||||||
|
|
||||||
object NotificationCommand "mail-service-notification" inherits "plugin-notification-command" {
|
object NotificationCommand "mail-service-notification" inherits "plugin-notification-command" {
|
||||||
command = [ (IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh") ],
|
command = [ IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh" ],
|
||||||
|
|
||||||
export_macros = [
|
export_macros = [
|
||||||
"NOTIFICATIONTYPE",
|
"NOTIFICATIONTYPE",
|
||||||
@ -588,7 +588,7 @@ Example:
|
|||||||
logentries_age = 31d,
|
logentries_age = 31d,
|
||||||
},
|
},
|
||||||
|
|
||||||
categories = (DbCatConfig | DbCatState)
|
categories = DbCatConfig | DbCatState
|
||||||
}
|
}
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
@ -672,7 +672,7 @@ Example:
|
|||||||
logentries_age = 31d,
|
logentries_age = 31d,
|
||||||
},
|
},
|
||||||
|
|
||||||
categories = (DbCatConfig | DbCatState)
|
categories = DbCatConfig | DbCatState
|
||||||
}
|
}
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
@ -877,7 +877,7 @@ a defined JSON file.
|
|||||||
Example:
|
Example:
|
||||||
|
|
||||||
object IcingaStatusWriter "status" {
|
object IcingaStatusWriter "status" {
|
||||||
status_path = (IcingaLocalStateDir + "/cache/icinga2/status.json"),
|
status_path = IcingaLocalStateDir + "/cache/icinga2/status.json",
|
||||||
update_interval = 15s
|
update_interval = 15s
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -962,8 +962,8 @@ Example:
|
|||||||
|
|
||||||
object Domain "dmz-1" {
|
object Domain "dmz-1" {
|
||||||
acl = {
|
acl = {
|
||||||
node1 = (DomainPrivCheckResult),
|
node1 = DomainPrivCheckResult,
|
||||||
node2 = (DomainPrivReadWrite)
|
node2 = DomainPrivReadWrite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -980,5 +980,5 @@ Domain ACLs:
|
|||||||
DomainPrivRead | Endpoint reads local messages and relays them to remote nodes.
|
DomainPrivRead | Endpoint reads local messages and relays them to remote nodes.
|
||||||
DomainPrivCheckResult | Endpoint accepts check result messages from remote nodes.
|
DomainPrivCheckResult | Endpoint accepts check result messages from remote nodes.
|
||||||
DomainPrivCommand | Endpoint accepts command messages from remote nodes.
|
DomainPrivCommand | Endpoint accepts command messages from remote nodes.
|
||||||
DomainPrevReadOnly | Endpoint reads local messages and relays them to remote nodes.
|
DomainPrevReadOnly | Equivalent to DomainPrivRead.
|
||||||
DomainPrivReadWrite | Combination of (DomainPrivRead | DomainPrivCheckResult | DomainPrivCommand)
|
DomainPrivReadWrite | Equivalent to DomainPrivRead | DomainPrivCheckResult | DomainPrivCommand.
|
||||||
|
@ -129,7 +129,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
|
instance you will have to add the following include directive to your
|
||||||
`icinga2.conf` configuration file:
|
`icinga2.conf` configuration file:
|
||||||
|
|
||||||
include (IcingaLocalStateDir + "/lib/icinga2/cluster/config/*/*")
|
include IcingaLocalStateDir + "/lib/icinga2/cluster/config/*/*"
|
||||||
|
|
||||||
### <a id="initial-cluster-sync"></a> Initial Cluster Sync
|
### <a id="initial-cluster-sync"></a> Initial Cluster Sync
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ from the `icinga-node-dmz-1` endpoint.
|
|||||||
|
|
||||||
object Domain "dmz-db" {
|
object Domain "dmz-db" {
|
||||||
acl = {
|
acl = {
|
||||||
icinga-node-dmz-1 = (DomainPrivReadOnly),
|
icinga-node-dmz-1 = DomainPrivReadOnly,
|
||||||
icinga-node-dmz-2 = (DomainPrivReadWrite)
|
icinga-node-dmz-2 = DomainPrivReadWrite
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -463,8 +463,8 @@ All state and type filter use long names or'd with a pipe together
|
|||||||
|
|
||||||
notification_options w,u,c,r,f,s
|
notification_options w,u,c,r,f,s
|
||||||
|
|
||||||
notification_state_filter = (StateFilterWarning | StateFilterUnknown | StateFilterCritical),
|
notification_state_filter = StateFilterWarning | StateFilterUnknown | StateFilterCritical,
|
||||||
notification_type_filter = (NotificationProblem | NotificationRecovery | NotificationFlappingStart | NotificationFlappingEnd | NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved)
|
notification_type_filter = NotificationProblem | NotificationRecovery | NotificationFlappingStart | NotificationFlappingEnd | NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
>
|
>
|
||||||
|
@ -7,10 +7,10 @@ template User "generic-user" {
|
|||||||
enable_notifications = true,
|
enable_notifications = true,
|
||||||
notification_period = "24x7",
|
notification_period = "24x7",
|
||||||
|
|
||||||
notification_state_filter = (StateFilterWarning |
|
notification_state_filter = StateFilterWarning |
|
||||||
StateFilterCritical |
|
StateFilterCritical |
|
||||||
StateFilterUnknown),
|
StateFilterUnknown,
|
||||||
notification_type_filter = (NotificationFilterProblem |
|
notification_type_filter = NotificationFilterProblem |
|
||||||
NotificationFilterAcknowledgement |
|
NotificationFilterAcknowledgement |
|
||||||
NotificationFilterRecovery |
|
NotificationFilterRecovery |
|
||||||
NotificationFilterCustom |
|
NotificationFilterCustom |
|
||||||
@ -18,5 +18,5 @@ template User "generic-user" {
|
|||||||
NotificationFilterFlappingEnd |
|
NotificationFilterFlappingEnd |
|
||||||
NotificationFilterDowntimeStart |
|
NotificationFilterDowntimeStart |
|
||||||
NotificationFilterDowntimeEnd |
|
NotificationFilterDowntimeEnd |
|
||||||
NotificationFilterDowntimeRemoved)
|
NotificationFilterDowntimeRemoved
|
||||||
}
|
}
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
template Notification "mail-notification" {
|
template Notification "mail-notification" {
|
||||||
notification_command = "mail-service-notification",
|
notification_command = "mail-service-notification",
|
||||||
|
|
||||||
notification_state_filter = (StateFilterOK |
|
notification_state_filter = StateFilterOK |
|
||||||
StateFilterWarning |
|
StateFilterWarning |
|
||||||
StateFilterCritical |
|
StateFilterCritical |
|
||||||
StateFilterUnknown),
|
StateFilterUnknown,
|
||||||
notification_type_filter = (NotificationFilterProblem |
|
notification_type_filter = NotificationFilterProblem |
|
||||||
NotificationFilterAcknowledgement |
|
NotificationFilterAcknowledgement |
|
||||||
NotificationFilterRecovery |
|
NotificationFilterRecovery |
|
||||||
NotificationFilterCustom |
|
NotificationFilterCustom |
|
||||||
@ -17,13 +17,13 @@ template Notification "mail-notification" {
|
|||||||
NotificationFilterFlappingEnd |
|
NotificationFilterFlappingEnd |
|
||||||
NotificationFilterDowntimeStart |
|
NotificationFilterDowntimeStart |
|
||||||
NotificationFilterDowntimeEnd |
|
NotificationFilterDowntimeEnd |
|
||||||
NotificationFilterDowntimeRemoved),
|
NotificationFilterDowntimeRemoved,
|
||||||
|
|
||||||
notification_period = "24x7"
|
notification_period = "24x7"
|
||||||
}
|
}
|
||||||
|
|
||||||
object NotificationCommand "mail-service-notification" inherits "plugin-notification-command" {
|
object NotificationCommand "mail-service-notification" inherits "plugin-notification-command" {
|
||||||
command = [ (IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh") ],
|
command = [ IcingaSysconfDir + "/icinga2/scripts/mail-notification.sh" ],
|
||||||
|
|
||||||
export_macros = [
|
export_macros = [
|
||||||
"NOTIFICATIONTYPE",
|
"NOTIFICATIONTYPE",
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
|
|
||||||
object FileLogger "debug-file" {
|
object FileLogger "debug-file" {
|
||||||
severity = "debug",
|
severity = "debug",
|
||||||
path = (IcingaLocalStateDir + "/log/icinga2/debug.log")
|
path = IcingaLocalStateDir + "/log/icinga2/debug.log"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
|
|
||||||
object FileLogger "main-log" {
|
object FileLogger "main-log" {
|
||||||
severity = "information",
|
severity = "information",
|
||||||
path = (IcingaLocalStateDir + "/log/icinga2/icinga2.log")
|
path = IcingaLocalStateDir + "/log/icinga2/icinga2.log"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,8 +66,9 @@ void Host::EvaluateApplyRules(const std::vector<ApplyRule>& rules)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.IsEmpty())
|
std::ostringstream msgbuf2;
|
||||||
continue;
|
msgbuf2 << "Applying service template '" << rule.GetTemplate() << "' to host '" << host->GetName() << "' for rule " << rule.GetDebugInfo();
|
||||||
|
Log(LogDebug, "icinga", msgbuf2.str());
|
||||||
|
|
||||||
std::ostringstream namebuf;
|
std::ostringstream namebuf;
|
||||||
namebuf << host->GetName() << "!apply!" << rule.GetTemplate();
|
namebuf << host->GetName() << "!apply!" << rule.GetTemplate();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user