免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2453 | 回复: 4
打印 上一主题 下一主题

[其他] [nagios]求助~测试文件报错,启动不了 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-05-30 11:40 |只看该作者 |倒序浏览
运行/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg之后
就会报错:
Warninguplicate definition found for host 'win_01_web' (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 25)
Error:Could not add object property in file '/usr/local/nagios/etc/objects/windows.cfg' on line 27.
   Error processing object config files!

附windows.cfg配置
# Define a host for the Windows machine we'll be monitoring
# Change the host_name, alias, and address to fit your situation

define host{
        use             windows-server  ; Inherit default values from a template
        host_name       win_01_web       ; The name we're giving to this host
        alias           My Windows Server       ; A longer name associated with the host
        address         192.168.0.202   ; IP address of the host
        }
# Define a hostgroup for Windows machines
# All hosts that use the windows-server template will automatically be a member of this group

define hostgroup{
        hostgroup_name  win_servers  ; The name of the hostgroup
        alias           win_servers  ; Long name of the group
        }
# Create a service for monitoring the version of NSCLient++ that is installed
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               win_01_web
        service_description     NSClient++ Version
        check_command           check_nt!CLIENTVERSION
        }
# Create a service for monitoring the uptime of the server
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               win_01_web
        service_description     Uptime
        check_command           check_nt!UPTIME
        }



# Create a service for monitoring CPU load
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               win_01_web
        service_description     CPU Load
        check_command           check_nt!CPULOAD!-l 5,80,90
        }
# Create a service for monitoring memory usage
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               win_01_web
        service_description     Memory Usage
        check_command           check_nt!MEMUSE!-w 80 -c 90
        }



# Create a service for monitoring C:\ disk usage
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               win_01_web
        service_description     C:\ Drive Space
        check_command           check_nt!USEDDISKSPACE!-l c -w 80 -c 90
        }
# Create a service for monitoring the W3SVC service
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               win_01_web
        service_description     W3SVC
        check_command           check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
        }



# Create a service for monitoring the Explorer.exe process
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               win_01_web
        service_description     Explorer
        check_command           check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
        }

论坛徽章:
0
2 [报告]
发表于 2012-05-30 11:46 |只看该作者
Could not add object property in file '/usr/local/nagios/etc/objects/windows.cfg' on line 27.

很明显告诉你这个文件错误,27行,

论坛徽章:
0
3 [报告]
发表于 2012-05-30 12:34 |只看该作者
回复 2# 小丶力丫


    host_name       win_01_web       ; The name we're giving to this host    这就是第27行,应该是可以自定义的呀

论坛徽章:
0
4 [报告]
发表于 2012-05-30 13:02 |只看该作者
本帖最后由 小丶力丫 于 2012-05-30 13:10 编辑

回复 3# ding_0112


    看看跟你上面对应不,另外你直接把配置文件贴出来。

论坛徽章:
1
水瓶座
日期:2014-11-05 09:30:30
5 [报告]
发表于 2012-06-01 17:55 |只看该作者
配置错了,nagios没有找到名为 win_01_web的主机,检查一下配置文件有没有定义这台主机。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP