歡迎您光臨本站 註冊首頁

[nagios]求助~測試文件報錯,啟動不了

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

[nagios]求助~測試文件報錯,啟動不了

運行/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg之後
就會報錯:
Warning:Duplicate 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
        }
《解決方案》

Could not add object property in file '/usr/local/nagios/etc/objects/windows.cfg' on line 27.

很明顯告訴你這個文件錯誤,27行,
《解決方案》

回復 2# 小丶力丫


    host_name       win_01_web       ; The name we're giving to this host    這就是第27行,應該是可以自定義的呀
《解決方案》

本帖最後由 小丶力丫 於 2012-05-30 13:10 編輯

回復 3# ding_0112


    看看跟你上面對應不,另外你直接把配置文件貼出來。
《解決方案》

配置錯了,nagios沒有找到名為 win_01_web的主機,檢查一下配置文件有沒有定義這台主機。

[火星人 ] [nagios]求助~測試文件報錯,啟動不了已經有474次圍觀

http://coctec.com/docs/service/show-post-12795.html