亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 7592 | 回復(fù): 8
打印 上一主題 下一主題

[其他] 談?wù)撘粋(gè)關(guān)于nagios的問題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2012-11-01 11:29 |只看該作者 |倒序?yàn)g覽
本帖最后由 305838894 于 2012-11-01 11:45 編輯

我話了幾天的時(shí)間把整體框架配置好了,但是在配具體的檢測的時(shí)間出問題,一直提示我說我的command有問題,可是我就沒有修改這個(gè)東西啊,我把我的思路說一下
我是用了了這個(gè)自帶的templates里面的模板,用了里面generic-contact,generic-host,linux-server,generic-service,local-service。
我的contacts.cfg里面是這樣寫的
  1.     define contact{
  2.             contact_name                    nagios  ; Short name of user
  3.             use                             generic-contact         ; 引用了模板里面的generic-contact
  4.             alias                           Nagios          ; Full name of user

  5.             email                           305838894@qq.com      ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
  6.             }
復(fù)制代碼
hosts.cfg是這樣寫的
  1.     define host{
  2.        use           linux-server
  3.        host_name     test
  4.        alias         gaofeng-test
  5.        address       192.168.39.73
  6.     }
復(fù)制代碼
service是這樣寫的
  1.     define service{
  2.        use                   local-service
  3.        host_name             test
  4.        service_description   ping
  5.        check_command         check_ping!100.0,20%!500.0,60%
  6.     }
復(fù)制代碼
其他的都沒修改,然后我驗(yàn)證就一直提示

Nagios Core 3.4.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-11-2012
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Warning: Duplicate definition found for command 'check-host-alive' (config file '/usr/local/nagios/etc/objects/commands.cfg', starting on line 56)
Error: Could not add object property in file '/usr/local/nagios/etc/objects/commands.cfg' on line 57.
   Error processing object config files!


***> One or more problems was encountered while processing the config files...

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.

我在補(bǔ)充下引用到幾個(gè)模塊的代碼
  1. define contact{
  2.         name                            generic-contact         ; The name of this contact template
  3.         service_notification_period     24x7                    ; service notifications can be sent anytime
  4.         host_notification_period        24x7                    ; host notifications can be sent anytime
  5.         service_notification_options    w,u,c,r,f,s             ; send notifications for all service states, flapping events, and scheduled downtime events
  6.         host_notification_options       d,u,r,f,s               ; send notifications for all host states, flapping events, and scheduled downtime events
  7.         service_notification_commands   notify-service-by-email ; send service notifications via email
  8.         host_notification_commands      notify-host-by-email    ; send host notifications via email
  9.         register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
  10.         }
復(fù)制代碼

  1. define host{
  2.         name                            generic-host    ; The name of this host template
  3.         notifications_enabled           1               ; Host notifications are enabled
  4.         event_handler_enabled           1               ; Host event handler is enabled
  5.         flap_detection_enabled          1               ; Flap detection is enabled
  6.         failure_prediction_enabled      1               ; Failure prediction is enabled
  7.         process_perf_data               1               ; Process performance data
  8.         retain_status_information       1               ; Retain status information across program restarts
  9.         retain_nonstatus_information    1               ; Retain non-status information across program restarts
  10.         notification_period             24x7            ; Send host notifications at any time
  11.         register                        0               ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
  12.         }


  13. # Linux host definition template - This is NOT a real host, just a template!

  14. define host{
  15.         name                            linux-server    ; The name of this host template
  16.         use                             generic-host    ; This template inherits other values from the generic-host template
  17.         check_period                    24x7            ; By default, Linux hosts are checked round the clock
  18.         check_interval                  5               ; Actively check the host every 5 minutes
  19.         retry_interval                  1               ; Schedule host check retries at 1 minute intervals
  20.         max_check_attempts              10              ; Check each Linux host 10 times (max)
  21.         check_command                   check-host-alive ; Default command to check Linux hosts
  22.         notification_period             workhours       ; Linux admins hate to be woken up, so we only notify during the day
  23.                                                         ; Note that the notification_period variable is being overridden from
  24.                                                         ; the value that is inherited from the generic-host template!
  25.         notification_interval           120             ; Resend notifications every 2 hours
  26.         notification_options            d,u,r           ; Only send notifications for specific host states
  27.         contact_groups                  admins          ; Notifications get sent to the admins by default
  28.         register                        0               ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
  29.         }
復(fù)制代碼
  1. define service{
  2.         name                            generic-service         ; The 'name' of this service template
  3.         active_checks_enabled           1                       ; Active service checks are enabled
  4.         passive_checks_enabled          1                       ; Passive service checks are enabled/accepted
  5.         parallelize_check               1                       ; Active service checks should be parallelized (disabling this can lead to major performance problems)
  6.         obsess_over_service             1                       ; We should obsess over this service (if necessary)
  7.         check_freshness                 0                       ; Default is to NOT check service 'freshness'
  8.         notifications_enabled           1                       ; Service notifications are enabled
  9.         event_handler_enabled           1                       ; Service event handler is enabled
  10.         flap_detection_enabled          1                       ; Flap detection is enabled
  11.         failure_prediction_enabled      1                       ; Failure prediction is enabled
  12.         process_perf_data               1                       ; Process performance data
  13.         retain_status_information       1                       ; Retain status information across program restarts
  14.         retain_nonstatus_information    1                       ; Retain non-status information across program restarts
  15.         is_volatile                     0                       ; The service is not volatile
  16.         check_period                    24x7                    ; The service can be checked at any time of the day
  17.         max_check_attempts              3                       ; Re-check the service up to 3 times in order to determine its final (hard) state
  18.         normal_check_interval           10                      ; Check the service every 10 minutes under normal conditions
  19.         retry_check_interval            2                       ; Re-check the service every two minutes until a hard state can be determined
  20.         contact_groups                  admins                  ; Notifications get sent out to everyone in the 'admins' group
  21.         notification_options            w,u,c,r                 ; Send notifications about warning, unknown, critical, and recovery events
  22.         notification_interval           60                      ; Re-notify about service problems every hour
  23.         notification_period             24x7                    ; Notifications can be sent out at any time
  24.          register                        0                      ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
  25.         }


  26. # Local service definition template - This is NOT a real service, just a template!

  27. define service{
  28.         name                            local-service           ; The name of this service template
  29.         use                             generic-service         ; Inherit default values from the generic-service definition
  30.         max_check_attempts              4                       ; Re-check the service up to 4 times in order to determine its final (hard) state
  31.         normal_check_interval           5                       ; Check the service every 5 minutes under normal conditions
  32.         retry_check_interval            1                       ; Re-check the service every minute until a hard state can be determined
  33.         register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
  34.         }
復(fù)制代碼

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2012-11-01 11:35 |只看該作者
Error: Could not add object property in file '/usr/local/nagios/etc/objects/commands.cfg' on line 57.

把commands.cfg的第56行后面的一段貼出來看下

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2012-11-01 11:42 |只看該作者
  1. ################################################################################


  2. # This command checks to see if a host is "alive" by pinging it
  3. # The check must result in a 100% packet loss or 5 second (5000ms) round trip
  4. # average time to produce a critical error.
  5. # Note: Five ICMP echo packets are sent (determined by the '-p 5' argument)

  6. # 'check-host-alive' command definition
  7. define command{
  8.         command_name    check-host-alive
  9.         command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
  10.         }




  11. ################################################################################
復(fù)制代碼
這行是56開始define command{

回復(fù) 2# deweiku


   

論壇徽章:
0
4 [報(bào)告]
發(fā)表于 2012-11-01 11:56 |只看該作者
define host{
       use           linux-server
       host_name     test
       alias         gaofeng-test
       address       192.168.39.73
       check_command           check-host-alive
    }

host.cfg下面加一行 check_command           check-host-alive 試試

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2012-11-01 14:48 |只看該作者
我的host文件use了linux-server,而linux-server是我引用模板的,模板里面是有對host定義的代碼如下
  1. define host{
  2.         name                            linux-server    ; The name of this host template
  3.         use                             generic-host    ; This template inherits other values from the generic-host template
  4.         check_period                    24x7            ; By default, Linux hosts are checked round the clock
  5.         check_interval                  5               ; Actively check the host every 5 minutes
  6.         retry_interval                  1               ; Schedule host check retries at 1 minute intervals
  7.         max_check_attempts              10              ; Check each Linux host 10 times (max)
  8.         check_command                   check-host-alive ; Default command to check Linux hosts
  9.         notification_period             workhours       ; Linux admins hate to be woken up, so we only notify during the day
  10.                                                         ; Note that the notification_period variable is being overridden from
  11.                                                         ; the value that is inherited from the generic-host template!
  12.         notification_interval           120             ; Resend notifications every 2 hours
  13.         notification_options            d,u,r           ; Only send notifications for specific host states
  14.         contact_groups                  admins          ; Notifications get sent to the admins by default
  15.         register                        0               ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
  16.         }
復(fù)制代碼
回復(fù) 4# deweiku


   

論壇徽章:
0
6 [報(bào)告]
發(fā)表于 2012-11-01 16:56 |只看該作者
你仔細(xì)檢查一下,就是那幾個(gè)配置文件的問題,nagios很嚴(yán)格 一個(gè)空格都不行

論壇徽章:
0
7 [報(bào)告]
發(fā)表于 2012-11-02 10:41 |只看該作者
你看看你的commands.cfg里是不是定義了兩個(gè)check-host-alive。

論壇徽章:
0
8 [報(bào)告]
發(fā)表于 2012-11-03 11:10 |只看該作者
找到原因了 謝謝你的回答啊回復(fù) 6# deweiku


   

論壇徽章:
0
9 [報(bào)告]
發(fā)表于 2017-03-21 16:54 |只看該作者
樓主不把原因說出來,來厚道。!
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP