From: Gunnar Beutner Date: Wed, 19 Mar 2014 11:44:53 +0000 (+0100) Subject: Update documentation. X-Git-Tag: v0.0.9~74^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=700cc437703939532389152d9766dc9b84ded606;p=icinga2 Update documentation. Refs #5789 --- diff --git a/doc/3.02-commands.md b/doc/3.02-commands.md index 584a8405e..4f3cddc40 100644 --- a/doc/3.02-commands.md +++ b/doc/3.02-commands.md @@ -113,7 +113,7 @@ If you require default macro definitions, you can add a macro dictionary as show `CheckCommand` object. 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 = [ "NOTIFICATIONTYPE", diff --git a/doc/3.03-macros.md b/doc/3.03-macros.md index 4c55fa915..6c1b67cdb 100644 --- a/doc/3.03-macros.md +++ b/doc/3.03-macros.md @@ -273,7 +273,7 @@ Example: ... { - check_interval = (MyCheckInterval / 2.5) + check_interval = MyCheckInterval / 2.5 } More details in the chapter [Constant Expressions](#constant-expressions). diff --git a/doc/3.04-notifications.md b/doc/3.04-notifications.md index 6f1b09a1d..86b8d820f 100644 --- a/doc/3.04-notifications.md +++ b/doc/3.04-notifications.md @@ -25,11 +25,11 @@ The user `icingaadmin` in the example below will get notified only on `WARNING` object User "icingaadmin" { display_name = "Icinga 2 Admin", enable_notifications = 1, - notification_state_filter = (StateFilterOK | - StateFilterWarning | - StateFilterCritical), - notification_type_filter = (NotificationFilterProblem | - NotificationFilterRecovery), + notification_state_filter = StateFilterOK | + StateFilterWarning | + StateFilterCritical, + notification_type_filter = NotificationFilterProblem | + NotificationFilterRecovery, macros = { "email" = "icinga@localhost", "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. 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 = [ "NOTIFICATIONTYPE", @@ -91,18 +91,18 @@ to the defined notifications. That way you'll save duplicated attributes in each notification_command = "mail-service-notification", - notification_state_filter = (StateFilterWarning | - StateFilterCritical | - StateFilterUnknown), - notification_type_filter = (NotificationFilterProblem | - NotificationFilterAcknowledgement | - NotificationFilterRecovery | - NotificationFilterCustom | - NotificationFilterFlappingStart | - NotificationFilterFlappingEnd | - NotificationFilterDowntimeStart | - NotificationFilterDowntimeEnd | - NotificationFilterDowntimeRemoved), + notification_state_filter = StateFilterWarning | + StateFilterCritical | + StateFilterUnknown, + notification_type_filter = NotificationFilterProblem | + NotificationFilterAcknowledgement | + NotificationFilterRecovery | + NotificationFilterCustom | + NotificationFilterFlappingStart | + NotificationFilterFlappingEnd | + NotificationFilterDowntimeStart | + NotificationFilterDowntimeEnd | + NotificationFilterDowntimeRemoved, notification_period = "24x7" } @@ -274,18 +274,18 @@ Available state and type filters for notifications are: template Notification "generic-notification" { - notification_state_filter = (StateFilterWarning | - StateFilterCritical | - StateFilterUnknown), - notification_type_filter = (NotificationFilterProblem | - NotificationFilterAcknowledgement | - NotificationFilterRecovery | - NotificationFilterCustom | - NotificationFilterFlappingStart | - NotificationFilterFlappingEnd | - NotificationFilterDowntimeStart | - NotificationFilterDowntimeEnd | - NotificationFilterDowntimeRemoved), + notification_state_filter = StateFilterWarning | + StateFilterCritical | + StateFilterUnknown, + notification_type_filter = NotificationFilterProblem | + NotificationFilterAcknowledgement | + NotificationFilterRecovery | + NotificationFilterCustom | + NotificationFilterFlappingStart | + NotificationFilterFlappingEnd | + NotificationFilterDowntimeStart | + NotificationFilterDowntimeEnd | + NotificationFilterDowntimeRemoved, } > **Note** diff --git a/doc/4.1-configuration-syntax.md b/doc/4.1-configuration-syntax.md index 433736843..d3bdf2311 100644 --- a/doc/4.1-configuration-syntax.md +++ b/doc/4.1-configuration-syntax.md @@ -324,7 +324,7 @@ Valid operators include ~, !, +, -, *, /, ==, !=, in and !in. The default prece overridden by grouping expressions using parentheses: { - check_interval (30 + 60) / 2 + check_interval = (30 + 60) / 2 } Global constants may be used in constant expressions. diff --git a/doc/4.3-object-types.md b/doc/4.3-object-types.md index 68847254e..0af7c07de 100644 --- a/doc/4.3-object-types.md +++ b/doc/4.3-object-types.md @@ -214,7 +214,7 @@ Example: parent_host = "internet", parent_service = "ping4", - state_filter = (StateFilterOK), + state_filter = StateFilterOK, disable_checks = true } @@ -230,7 +230,7 @@ Attributes: 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. 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: @@ -252,12 +252,12 @@ Example: enable_notifications = 1, notification_period = "24x7", - notification_state_filter = (StateFilterOK | - StateFilterWarning | - StateFilterCritical | - StateFilterUnknown), - notification_type_filter = (NotificationFilterProblem | - NotificationFilterRecovery), + notification_state_filter = StateFilterOK | + StateFilterWarning | + StateFilterCritical | + StateFilterUnknown, + notification_type_filter = NotificationFilterProblem | + NotificationFilterRecovery, macros = { "name" = "Icinga 2 Admin", "email" = "icinga@localhost", @@ -458,7 +458,7 @@ A notification command definition. Example: 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 = [ "NOTIFICATIONTYPE", @@ -588,7 +588,7 @@ Example: logentries_age = 31d, }, - categories = (DbCatConfig | DbCatState) + categories = DbCatConfig | DbCatState } Attributes: @@ -672,7 +672,7 @@ Example: logentries_age = 31d, }, - categories = (DbCatConfig | DbCatState) + categories = DbCatConfig | DbCatState } Attributes: @@ -877,7 +877,7 @@ a defined JSON file. Example: object IcingaStatusWriter "status" { - status_path = (IcingaLocalStateDir + "/cache/icinga2/status.json"), + status_path = IcingaLocalStateDir + "/cache/icinga2/status.json", update_interval = 15s } @@ -962,8 +962,8 @@ Example: object Domain "dmz-1" { acl = { - node1 = (DomainPrivCheckResult), - node2 = (DomainPrivReadWrite) + node1 = DomainPrivCheckResult, + node2 = DomainPrivReadWrite } } @@ -980,5 +980,5 @@ Domain ACLs: DomainPrivRead | Endpoint reads local messages and relays them to remote nodes. DomainPrivCheckResult | Endpoint accepts check result messages from remote nodes. DomainPrivCommand | Endpoint accepts command messages from remote nodes. - DomainPrevReadOnly | Endpoint reads local messages and relays them to remote nodes. - DomainPrivReadWrite | Combination of (DomainPrivRead | DomainPrivCheckResult | DomainPrivCommand) + DomainPrevReadOnly | Equivalent to DomainPrivRead. + DomainPrivReadWrite | Equivalent to DomainPrivRead | DomainPrivCheckResult | DomainPrivCommand. diff --git a/doc/6.04-cluster.md b/doc/6.04-cluster.md index 9284d79ec..d720c75b8 100644 --- a/doc/6.04-cluster.md +++ b/doc/6.04-cluster.md @@ -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 `icinga2.conf` configuration file: - include (IcingaLocalStateDir + "/lib/icinga2/cluster/config/*/*") + include IcingaLocalStateDir + "/lib/icinga2/cluster/config/*/*" ### Initial Cluster Sync diff --git a/doc/6.05-domains.md b/doc/6.05-domains.md index 3e79ae35b..157816c75 100644 --- a/doc/6.05-domains.md +++ b/doc/6.05-domains.md @@ -25,7 +25,7 @@ from the `icinga-node-dmz-1` endpoint. object Domain "dmz-db" { acl = { - icinga-node-dmz-1 = (DomainPrivReadOnly), - icinga-node-dmz-2 = (DomainPrivReadWrite) + icinga-node-dmz-1 = DomainPrivReadOnly, + icinga-node-dmz-2 = DomainPrivReadWrite } } \ No newline at end of file diff --git a/doc/8-differences-between-icinga-1x-and-2.md b/doc/8-differences-between-icinga-1x-and-2.md index e8f4187d4..82e7f60f4 100644 --- a/doc/8-differences-between-icinga-1x-and-2.md +++ b/doc/8-differences-between-icinga-1x-and-2.md @@ -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_state_filter = (StateFilterWarning | StateFilterUnknown | StateFilterCritical), - notification_type_filter = (NotificationProblem | NotificationRecovery | NotificationFlappingStart | NotificationFlappingEnd | NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved) + notification_state_filter = StateFilterWarning | StateFilterUnknown | StateFilterCritical, + notification_type_filter = NotificationProblem | NotificationRecovery | NotificationFlappingStart | NotificationFlappingEnd | NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved > **Note** > diff --git a/etc/icinga2/conf.d/generic-user.conf b/etc/icinga2/conf.d/generic-user.conf index a2dae8d8b..66f78cd88 100644 --- a/etc/icinga2/conf.d/generic-user.conf +++ b/etc/icinga2/conf.d/generic-user.conf @@ -7,10 +7,10 @@ template User "generic-user" { enable_notifications = true, notification_period = "24x7", - notification_state_filter = (StateFilterWarning | + notification_state_filter = StateFilterWarning | StateFilterCritical | - StateFilterUnknown), - notification_type_filter = (NotificationFilterProblem | + StateFilterUnknown, + notification_type_filter = NotificationFilterProblem | NotificationFilterAcknowledgement | NotificationFilterRecovery | NotificationFilterCustom | @@ -18,5 +18,5 @@ template User "generic-user" { NotificationFilterFlappingEnd | NotificationFilterDowntimeStart | NotificationFilterDowntimeEnd | - NotificationFilterDowntimeRemoved) + NotificationFilterDowntimeRemoved } diff --git a/etc/icinga2/conf.d/notifications.conf b/etc/icinga2/conf.d/notifications.conf index e74ae8f1b..5bd59810c 100644 --- a/etc/icinga2/conf.d/notifications.conf +++ b/etc/icinga2/conf.d/notifications.conf @@ -5,11 +5,11 @@ template Notification "mail-notification" { notification_command = "mail-service-notification", - notification_state_filter = (StateFilterOK | + notification_state_filter = StateFilterOK | StateFilterWarning | StateFilterCritical | - StateFilterUnknown), - notification_type_filter = (NotificationFilterProblem | + StateFilterUnknown, + notification_type_filter = NotificationFilterProblem | NotificationFilterAcknowledgement | NotificationFilterRecovery | NotificationFilterCustom | @@ -17,13 +17,13 @@ template Notification "mail-notification" { NotificationFilterFlappingEnd | NotificationFilterDowntimeStart | NotificationFilterDowntimeEnd | - NotificationFilterDowntimeRemoved), + NotificationFilterDowntimeRemoved, notification_period = "24x7" } 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 = [ "NOTIFICATIONTYPE", diff --git a/etc/icinga2/features-available/debuglog.conf b/etc/icinga2/features-available/debuglog.conf index 656b8f7be..86947cbec 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 = IcingaLocalStateDir + "/log/icinga2/debug.log" } diff --git a/etc/icinga2/features-available/mainlog.conf b/etc/icinga2/features-available/mainlog.conf index 848f7398a..2d237a451 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 = IcingaLocalStateDir + "/log/icinga2/icinga2.log" } diff --git a/lib/icinga/host-apply.cpp b/lib/icinga/host-apply.cpp index 0d381f21d..46b1beb48 100644 --- a/lib/icinga/host-apply.cpp +++ b/lib/icinga/host-apply.cpp @@ -66,8 +66,9 @@ void Host::EvaluateApplyRules(const std::vector& rules) continue; } - if (result.IsEmpty()) - continue; + std::ostringstream msgbuf2; + msgbuf2 << "Applying service template '" << rule.GetTemplate() << "' to host '" << host->GetName() << "' for rule " << rule.GetDebugInfo(); + Log(LogDebug, "icinga", msgbuf2.str()); std::ostringstream namebuf; namebuf << host->GetName() << "!apply!" << rule.GetTemplate();