object Host "localhost" {
display_name = "The best host there is"
+ address = "127.0.0.1"
+ address6 = "::1"
groups = [ "all-hosts" ]
Name |Description
----------------|----------------
display_name |**Optional.** A short description of the host.
+ address |**Optional.** The host's address. Available as command runtime macro `$address$` if set.
+ address6 |**Optional.** The host's address. Available as command runtime macro `$address6$` if set.
groups |**Optional.** A list of host groups this host belongs to.
vars |**Optional.** A dictionary containing custom attributes that are specific to this host.
check\_command |**Required.** The name of the check command.
volatile |**Optional.** The volatile setting enables always `HARD` state types if `NOT-OK` state changes occur.
authorities |**Optional.** A list of Endpoints on which this host check will be executed in a cluster scenario.
domains |**Optional.** A list of Domains for this host object in a cluster scenario.
+ notes |**Optional.** Notes for the host.
+ notes_url |**Optional.** Url for notes for the host (for example, in notification commands).
+ action_url |**Optional.** Url for actions for the host (for example, an external graphing tool).
+ icon_image |**Optional.** Icon image for the host. Required for external interfaces only.
+ icon_image_alt |**Optional.** Icon image description for the host. Required for external interface only.
+
+> **Best Practice**
+>
+> The `address` and `address6` attributes are required for running commands using
+> the `$address$` and `$address6` runtime macros.
+
+Unlike Icinga 1.x the `statusmap_image` and `2d_coords` attributes are
+custom attributes only in Icinga 2.
+
### <a id="objecttype-hostgroup"></a> HostGroup
check_command = "check_snmp"
- vars = {
- community = "public"
- oid = "DISMAN-EVENT-MIB::sysUpTimeInstance"
- }
+ vars.community = "public"
+ vars.oid = "DISMAN-EVENT-MIB::sysUpTimeInstance"
check_interval = 60s
retry_interval = 15s
name |**Required.** The service name. Must be unique on a per-host basis (Similar to the service_description attribute in Icinga 1.x).
groups |**Optional.** The service groups this service belongs to.
-In addition to these attributes you can also use any of the attributes which are also valid for `Host` objects.
+In addition to these attributes you can also use any of the attributes except the `address` and `address6` which are also valid
+for `Host` objects.
Service objects have composite names, i.e. their names are based on the host_name attribute and the name you specified. This means
you can define more than one object with the same (short) name as long as the `host_name` attribute has a different value.
object User "icingaadmin" {
display_name = "Icinga 2 Admin"
groups = [ "icingaadmins" ]
+ email = "icinga@localhost"
+ pager = "icingaadmin@localhost.localdomain"
- notificcation_period = "24x7"
+ notification_period = "24x7"
states = [ OK, Warning, Critical, Unknown ]
types = [ Problem, Recovery ]
- vars = {
- name = "Icinga 2 Admin"
- email = "icinga@localhost"
- pager = "icingaadmin@localhost.localdomain"
- }
-
- custom = {
- notes = "This is the Icinga 2 Admin account."
- }
+ vars.additional_notes = "This is the Icinga 2 Admin account."
}
Available notification state filters:
Name |Description
----------------|----------------
display_name |**Optional.** A short description of the user.
+ email |**Optional.** An email string for this user. Useful for notification commands.
+ pager |**Optional.** A pager string for this user. Useful for notification commands.
vars |**Optional.** A dictionary containing custom attributes that are specific to this user.
groups |**Optional.** An array of group names.
enable_notifications|**Optional.** Whether notifications are enabled for this user.
"-o", "$oid$"
]
- vars = {
- address = "127.0.0.1"
- community = "public"
- }
+ vars.address = "127.0.0.1"
+ vars.community = "public"
}
Attributes: