define host {
use 监控使用的模板
host_name 被监控主机的主机名
alias被监控主机别名
address被监控主机IP地址
}
define host{
use linux-server
host_name localhost
alias localhost
address 127.0.0.1
}
use linux-server:加载linux-server的配置(linux-server已在templates.cfg中定义)
use local-service:加载local-service的配置(已在templates.cfg中定义)
查看templates.cfg:
define host{
name linux-server ; The name of this host template
use generic-host ; This template inherits other values from the generic-host template
check_period 24x7 ; By default, Linux hosts are checked round the clock
check_interval 5 ; Actively check the host every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute intervals
max_check_attempts 10 ; Check each Linux host 10 times (max)
check_command check-host-alive ; Default command to check Linux hosts
notification_period workhours ; Linux admins hate to be woken up, so we only notify during the day
; Note that the notification_period variable is being overridden from
; the value that is inherited from the generic-host template!
notification_interval 120 ; Resend notifications every 2 hours
notification_options d,u,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}