我希望能够检查我的网站是否已启动并在本地通过nagios进行监控。
所以我去了这个网站http://www.linickx.com/nagios做了以下内容,现在虽然我看不到hosts.cfg,所以我创建了它,还有services.cfg我也必须创建:
hosts.cfg
# host definition for bonus
define host{
use generic-host ; Name of host template to use
host_name bonus
alias bonus
address 92.12.35.162
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r}
services config
The following should appended to the end of hosts.cfg (located in /etc/nagios or /usr/local/nagios/etc)
# Service definition for bonus
define service{
use generic-service ; Name of service template to use
host_name bonus
service_description HTTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 3
retry_check_interval 1
contact_groups technical,support
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_http
}
我怎样才能让它工作?
答案 0 :(得分:0)
Nagios不会添加新的配置文件,除非在主nagios.cfg中指定了文件或目录。此外,在重新启动Nagios进程之前,不会添加新的对象配置。您能否详细介绍一下您如何安装Nagios(源代码或软件包)以及您所使用的Linux发行版?
以下是一些其他资源:
Nagios核心文档 http://nagios.sourceforge.net/docs/3_0/
Nagios核心支持论坛 http://support.nagios.com/forum/viewforum.php?f=7