二。icinga配置文件
1.配置文件 template.cfg 添加模板
#ADD FOR PASSIVE CHECK
define service{
name passive-service
use generic-service
max_check_attempts 1
active_checks_enabled 0
passive_checks_enabled 1
normal_check_interval 5
retry_check_interval 1
notification_interval 10
notification_options w,u,c,r,f,s
contact_groups admins
register 0
}
2.配置文件 linux.cfg/hpux.cfg 添加主机, 主机组,服务,服务组(分组管理)
#ADD FOR PASSIVE CHECK
define hostgroup{
hostgroup_name nsca_cluster ; The name of the hostgroup
alias nsca_Servers ; Long name of the group
members 192.168.100.100
}
define servicegroup {
servicegroup_name NSCA-MON
alias NSCA-MON
}
define host{
use linux-server ;using linux-server template!!!
host_name 192.168.100.100
alias local-host
icon_image redhat.gif
statusmap_image redhat.gd2
address 192.168.100.100
}
结果如下,说明已经成功,如果没有输出[被动服务检查],则说明icinga的命令/服务配置等不正确,没有找到描述为[CheckDummy]的命令
nsca[21562]: SERVICE CHECK -> Host Name: '192.168.100.100', Service Description: 'CheckDummy', Return Code: '0', Output: 'this is a test of nsca'
nsca[21562]: End of connection...
icinga: 额外命令: PROCESS_SERVICE_CHECK_RESULT;192.168.100.100;CheckDummy;0;this is a test of nsca
icinga: 被动服务检查: 192.168.100.100;CheckDummy;0;this is a test of nsca