Nagios

Nagios3 說 localhost 在 ping 上關閉,但沒有寫入 ping 檢查

  • June 20, 2016

Nagios3 和 Ubuntu 14 禁用了 ping 請求。

localhosts 在 GUI nagios 界面中不斷報告它已關閉。

這是安裝後在 conf.d 目錄中找到的預設“localhost_nagios2.cfg”:

# A simple configuration file for monitoring the local host
# This can serve as an example for configuring other servers;
# Custom services specific to this host are added here, but services
# defined in nagios2-common_services.cfg may also apply.
#

define host{
       use                     generic-host            ; Name of host template to use
       host_name               localhost
       alias                   localhost
       address                 127.0.0.1
       }

# Define a service to check the disk space of the root partition
# on the local machine.  Warning if < 20% free, critical if
# < 10% free space on partition.

define service{
       use                             generic-service         ; Name of service template to use
       host_name                       localhost
       service_description             Disk Space
       check_command                   check_all_disks!20%!10%
       }



# Define a service to check the number of currently logged in
# users on the local machine.  Warning if > 20 users, critical
# if > 50 users.

define service{
       use                             generic-service         ; Name of service template to use
       host_name                       localhost
       service_description             Current Users
       check_command                   check_users!20!50
       }


# Define a service to check the number of currently running procs
# on the local machine.  Warning if > 250 processes, critical if
# > 400 processes.

define service{
       use                             generic-service         ; Name of service template to use
       host_name                       localhost
       service_description             Total Processes
               check_command                   check_procs!250!400
       }



# Define a service to check the load on the local machine.

define service{
   use                             generic-service         ; Name of service template to use
   host_name                       localhost
   service_description             Current Load
           check_command                   check_load!5.0!4.0!3.0!10.0!6.0!4.0
   }

這幾乎是開箱即用的配置。我更改了 generic-host 以免 ping 任何東西:

# Generic host definition template - This is NOT a real host, just a template!

define host{
       name                            generic-host    ; The name of this host template
       notifications_enabled           1       ; Host notifications are enabled
       event_handler_enabled           1       ; Host event handler is enabled
       flap_detection_enabled          1       ; Flap detection is enabled
       failure_prediction_enabled      1       ; Failure prediction is enabled
       process_perf_data               1       ; Process performance data
       retain_status_information       1       ; Retain status information across program restarts
       retain_nonstatus_information    1       ; Retain non-status information across program restarts
               max_check_attempts              10
               notification_interval           0
               notification_period             24x7
               notification_options            d,u,r
               contact_groups                  admins
       register                        0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
       }

我正在監視的其他伺服器都很好,nagios 不會對它們執行任何 ping 檢查。但是,nagios 不會停止抱怨本地主機處於嚴重狀態…在 PING 上: 在此處輸入圖像描述

我已經仔細檢查了 Google 的產品一個多小時,但無法弄清楚如何關閉此檢查。

我的問題:這實際上是關閉並處於鎖定的“關閉”狀態,還是我錯過了另一個設置來阻止本地主機執行 ping 檢查?

謝謝。約翰

您必須使用某些東西進行主機檢查,否則狀態將永遠不會改變。

請注意它說“最後一次檢查”是在 17 日,即使您在 19 日拍攝了這張截圖?

如果您不想使用check_ping,請選擇另一個外掛用於主機檢查。或者只是讓它ping localhost;這並沒有什麼壞處,即使它看起來沒有必要。

還有check_dummy,您可以使用它來始終返回UP以進行主機檢查。

引用自:https://serverfault.com/questions/784869