mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
parent
91afc36b3a
commit
0650832018
@ -5,9 +5,12 @@ icinga2confdir = $(DESTDIR)${sysconfdir}/icinga2/conf.d
|
||||
CONFIG_FILES = \
|
||||
generic-host.conf \
|
||||
generic-service.conf \
|
||||
groups.conf \
|
||||
localhost.conf \
|
||||
macros.conf \
|
||||
timeperiods.conf
|
||||
notifications.conf \
|
||||
timeperiods.conf \
|
||||
users.conf
|
||||
|
||||
install-data-local:
|
||||
@if [ ! -e $(icinga2confdir) ]; then \
|
||||
|
@ -5,3 +5,49 @@
|
||||
template Host "generic-host" {
|
||||
|
||||
}
|
||||
|
||||
template Host "linux-server" inherits "generic-host" {
|
||||
|
||||
groups = [ "linux-servers" ],
|
||||
|
||||
services["ping4"] = {
|
||||
templates = [ "generic-service" ],
|
||||
|
||||
check_command = "ping4"
|
||||
},
|
||||
|
||||
check = "ping4"
|
||||
}
|
||||
|
||||
template Host "windows-server" inherits "generic-host" {
|
||||
|
||||
groups = [ "windows-servers" ],
|
||||
|
||||
services["ping4"] = {
|
||||
templates = [ "generic-service" ],
|
||||
|
||||
check_command = "ping4"
|
||||
},
|
||||
|
||||
check = "ping4"
|
||||
}
|
||||
|
||||
template Host "generic-printer" inherits "generic-host" {
|
||||
services["ping4"] = {
|
||||
templates = [ "generic-service" ],
|
||||
|
||||
check_command = "ping4"
|
||||
},
|
||||
|
||||
check = "ping4"
|
||||
}
|
||||
|
||||
template Host "generic-switch" inherits "generic-host" {
|
||||
services["ping4"] = {
|
||||
templates = [ "generic-service" ],
|
||||
|
||||
check_command = "ping4"
|
||||
},
|
||||
|
||||
check = "ping4"
|
||||
}
|
||||
|
@ -4,4 +4,12 @@
|
||||
*/
|
||||
template Service "generic-service" {
|
||||
|
||||
max_check_attempts = 3,
|
||||
check_interval = 5m,
|
||||
retry_interval = 1m,
|
||||
|
||||
notifications["mail-icingaadmin"] = {
|
||||
templates = [ "mail-notification" ],
|
||||
user_groups = [ "icingaadmins" ]
|
||||
}
|
||||
}
|
||||
|
11
etc/icinga2/conf.d/groups.conf
Normal file
11
etc/icinga2/conf.d/groups.conf
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Host and service group examples.
|
||||
*/
|
||||
|
||||
object HostGroup "linux-servers" {
|
||||
display_name = "Linux Servers"
|
||||
}
|
||||
|
||||
object HostGroup "windows-servers" {
|
||||
display_name = "Windows Servers"
|
||||
}
|
@ -4,6 +4,11 @@
|
||||
* files in this directory are included.
|
||||
*/
|
||||
object Host "localhost" inherits "generic-host" {
|
||||
|
||||
display_name = "localhost",
|
||||
|
||||
groups = [ "linux-servers", "windows-servers" ],
|
||||
|
||||
services["ping4"] = {
|
||||
templates = [ "generic-service" ],
|
||||
|
||||
|
49
etc/icinga2/conf.d/notifications.conf
Normal file
49
etc/icinga2/conf.d/notifications.conf
Normal file
@ -0,0 +1,49 @@
|
||||
/**
|
||||
* The example notification templates.
|
||||
*/
|
||||
|
||||
template Notification "mail-notification" {
|
||||
notification_command = "mail-service-notification",
|
||||
|
||||
notification_state_filter = (StateFilterWarning |
|
||||
StateFilterCritical |
|
||||
StateFilterUnknown),
|
||||
notification_type_filter = (NotificationFilterProblem |
|
||||
NotificationFilterAcknowledgement |
|
||||
NotificationFilterRecovery |
|
||||
NotificationFilterCustom |
|
||||
NotificationFilterFlappingStart |
|
||||
NotificationFilterFlappingEnd |
|
||||
NotificationFilterDowntimeStart |
|
||||
NotificationFilterDowntimeEnd |
|
||||
NotificationFilterDowntimeRemoved),
|
||||
|
||||
notification_period = "24x7",
|
||||
users = [ "icingaadmin" ],
|
||||
usergroups = [ "icingaadmins" ]
|
||||
}
|
||||
|
||||
object NotificationCommand "mail-service-notification" inherits "plugin-notification-command" {
|
||||
command = [
|
||||
"/usr/bin/printf",
|
||||
"\"%b\"",
|
||||
{{{\"***** Icinga *****
|
||||
|
||||
Notification Type: $NOTIFICATIONTYPE$
|
||||
|
||||
Service: $SERVICEDESC$
|
||||
Host: $HOSTALIAS$
|
||||
Address: $HOSTADDRESS$
|
||||
State: $SERVICESTATE$
|
||||
|
||||
Date/Time: $LONGDATETIME$
|
||||
|
||||
Additional Info: $SERVICEOUTPUT$
|
||||
|
||||
Comment: [$NOTIFICATIONAUTHORNAME$] $NOTIFICATIONCOMMENT$\"}}},
|
||||
"-s",
|
||||
"\"$NOTIFICATIONTYPE$ - $HOSTDISPLAYNAME$ - $SERVICEDISPLAYNAME$ is $SERVICESTATE$\"",
|
||||
"$USEREMAIL$"
|
||||
]
|
||||
}
|
||||
|
40
etc/icinga2/conf.d/users.conf
Normal file
40
etc/icinga2/conf.d/users.conf
Normal file
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* The example user 'icingaadmin' and the example
|
||||
* group 'icingaadmins'.
|
||||
*/
|
||||
|
||||
object User "icingaadmin" {
|
||||
display_name = "Icinga 2 Admin",
|
||||
groups = [ "icingaadmins" ],
|
||||
|
||||
enable_notifications = 1,
|
||||
notification_period = "24x7",
|
||||
|
||||
notification_state_filter = (StateFilterWarning |
|
||||
StateFilterCritical |
|
||||
StateFilterUnknown),
|
||||
notification_type_filter = (NotificationFilterProblem |
|
||||
NotificationFilterAcknowledgement |
|
||||
NotificationFilterRecovery |
|
||||
NotificationFilterCustom |
|
||||
NotificationFilterFlappingStart |
|
||||
NotificationFilterFlappingEnd |
|
||||
NotificationFilterDowntimeStart |
|
||||
NotificationFilterDowntimeEnd |
|
||||
NotificationFilterDowntimeRemoved),
|
||||
|
||||
macros = {
|
||||
"name" = "Icinga 2 Admin",
|
||||
"email" = "icinga@localhost",
|
||||
"pager" = "icingaadmin@localhost.localdomain"
|
||||
},
|
||||
|
||||
custom = {
|
||||
notes = "This is the Icinga 2 Admin account.",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
object UserGroup "icingaadmins" {
|
||||
display_name = "Icinga 2 Admin Group"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user