Nagios配置檔案詳解
Nagios配置檔案詳解
這裡開始要講一些Nagios的配置。
首先要看看目前Nagios的主配置路徑下有哪些檔案。
[root@nagios etc]# ll
總用量 152
-rwxrwxr-x. 1 nagios nagios 1825 9月 24 14:40 cgi.cfg
-rwxrwxr-x. 1 nagios nagios 9747 9月 24 14:40 checkcommands.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 connectors.cfg
-rwxrwxr-x. 1 nagios nagios 1352 9月 24 14:40 contactgroups.cfg
-rwxrwxr-x. 1 nagios nagios 1539 9月 24 14:40 contacts.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 contactTemplates.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 dependencies.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 escalations.cfg
-rwxrwxr-x. 1 nagios nagios 1211 9月 24 14:40 hostgroups.cfg
-rwxrwxr-x. 1 nagios nagios 1956 9月 24 14:40 hosts.cfg
-rwxrwxr-x. 1 nagios nagios 2949 9月 24 14:40 hostTemplates.cfg
-rwxrwxr-x. 1 apache nagios 26 6月 3 2013 htpasswd.users
-rwxrwxr-x. 1 nagios nagios 1573 9月 24 14:40 meta_commands.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_contact.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_contactgroup.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_dependencies.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_escalations.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_host.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_hostgroup.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_services.cfg
-rwxrwxr-x. 1 nagios nagios 1341 9月 24 14:40 meta_timeperiod.cfg
-rwxrwxr-x. 1 nagios nagios 5683 9月 24 14:40 misccommands.cfg
-rwxrwxr-x. 1 nagios nagios 4170 9月 24 14:40 nagios.cfg
-rwxrwxr-x. 1 nagios nagios 1448 9月 24 14:40 ndo2db.cfg
-rwxrwxr-x. 1 nagios nagios 1351 9月 24 14:40 ndomod.cfg
-rwxrwxr-x. 1 nagios nagios 7988 6月 3 2013 nrpe.cfg
drwxrwxr-x. 2 nagios nagios 4096 6月 3 2013 objects
-rwxrwxr-x. 1 nagios nagios 1158 9月 24 14:40 resource.cfg
-rwxrwxr-x. 1 nagios nagios 1236 9月 24 14:40 servicegroups.cfg
-rwxrwxr-x. 1 nagios nagios 2244 9月 24 14:40 services.cfg
-rwxrwxr-x. 1 nagios nagios 5533 9月 24 14:40 serviceTemplates.cfg
-rwxrwxr-x. 1 nagios nagios 2138 9月 24 14:40 timeperiods.cfg
Nagios主配置檔案:
Nagios的主配置檔案為/etc/nagios/nagios.cfg,在進行操作前首先要對主配置檔案進行備份。
# cp /etc/nagios/nagios.cfg /etc/nagios/nagios.cfg.backup
配置Nagios的主配置檔案:
# vi /etc/nagios/nagios.cfg
--------------------------------------------------------------------------------
第一部分:日誌檔案
# LOG FILE
# This is the main log file where service and host events are logged
# for historical purposes. This should be the first option specified
# in the config file!!!
日誌檔案,用來記錄主機活動事件的主要日誌檔案檔案,這應該是配置檔案中位於最首的。
log_file=/var/log/nagios/nagios.log
設定Nagios的主日誌檔案路徑。
第二部分:物件配置檔案模組
# OBJECT CONFIGURATION FILE(S)
# This is the configuration file in which you define hosts, host
# groups, contacts, contact groups, services, etc. I guess it would
# be better called an object definition file, but for historical
# reasons it isn't. You can split object definitions into several
# different config files by using multiple cfg_file statements here.
# Nagios will read and process all the config files you define.
# This can be very useful if you want to keep command definitions
# separate from host and contact definitions...
物件配置檔案。這些配置檔案將會分別用來定義主機、主機組、聯絡人、聯絡人組、服務、等等。這些更應當被理解為“物件定義”檔案較為貼切。
可以透過將一些物件透過多個不同獨立的cfg_file語句指明的配置檔案分開定義。
Nagios將會讀取並且處理所有這些配置檔案中記載的定義。
對於需要將命令定義和其他類似於主機、聯絡人等定義分開處理記錄的話,將會非常有用。
# Command definitions
cfg_file=/etc/nagios/commands.cfg
設定命令定義配置檔案路徑。
# Host and service definitions for monitoring this machine
cfg_file=/etc/nagios/localhost.cfg
設定主機和服務監視定義配置檔案路徑。
# You can split other types of object definitions across several
# config files if you wish (as done here), or keep them all in a
# single config file.
以下則是其它型別細分定義的配置檔案,也可以將它們全部寫在一張配置檔案當中。這些預設是加註的,如果要啟用的話需要手動解注。而且這些檔案預設也是沒有的,如果要啟用還必須手動建立它們。
#cfg_file=/etc/nagios/contactgroups.cfg
#cfg_file=/etc/nagios/contacts.cfg
#cfg_file=/etc/nagios/dependencies.cfg
#cfg_file=/etc/nagios/escalations.cfg
#cfg_file=/etc/nagios/hostgroups.cfg
#cfg_file=/etc/nagios/hosts.cfg
#cfg_file=/etc/nagios/services.cfg
#cfg_file=/etc/nagios/timeperiods.cfg
#cfg_dir=/etc/nagios/servers
#cfg_dir=/etc/nagios/printers
#cfg_dir=/etc/nagios/switches
#cfg_dir=/etc/nagios/routers
# Extended host/service info definitions are now stored along with
# other object definitions:
以下是一些擴充套件的主機/服務資訊定義配置檔案。
#cfg_file=/etc/nagios/hostextinfo.cfg
#cfg_file=/etc/nagios/serviceextinfo.cfg
第三部分:物件快取檔案
# OBJECT CACHE FILE
# This option determines where object definitions are cached when
# Nagios starts/restarts. The CGIs read object definitions from
# this cache file (rather than looking at the object config files
# directly) in order to prevent inconsistencies that can occur
# when the config files are modified after Nagios starts.
物件快取檔案。這些選項將決定當Nagios啟動時或重新啟動時,物件定義將被快取在什麼地方。CGI將從這個物件檔案中讀取物件的定義,而不是在之前的物件配置檔案路徑中去找。這樣做是為了避免修改Nagios配置檔案後引起的不一致問題。換句簡單的話說就是更改配置檔案後要重新運新Nagios新的配置引數才會生效,而當前執行的Nagios只參考快取中的配置引數而已。
object_cache_file=/var/log/nagios/objects.cache
設定物件快取檔案的路徑。
第四部分:狀態檔案
# STATUS FILE
# This is where the current status of all monitored services and
# hosts is stored. Its contents are read and processed by the CGIs.
# The contents of the status file are deleted every time Nagios
# restarts.
狀態檔案。這個檔案將儲存著目前檢測到的服務和主機資料資訊。這個檔案當中的內容是被CGI讀取並處理的,而它也是在每次Nagios重新啟動的時候被刪除清空的。
status_file=/var/log/nagios/status.dat
設定狀態檔案的路徑。
第五部分:Nagios服務宿主使用者
# NAGIOS USER
# This determines the effective user that Nagios should run as.
# You can either supply a username or a UID.
支撐Nagios服務執行的使用者。貌似預設安裝後沒有這個使用者,如果沒有的話,手動建立一個。
nagios_user=nagios
預設情況下宿主使用者就是nagios。
第六部分:Nagios服務宿主使用者組
# NAGIOS GROUP
# This determines the effective group that Nagios should run as.
# You can either supply a group name or a GID.
支撐Nagios服務執行的使用者組。貌似安裝後也沒,如果沒有的話,和使用者一起手動建立。
nagios_group=nagios
預設情況下宿主使用者組就是nagios。
第七部分:外部命令選項
# EXTERNAL COMMAND OPTION
# This option allows you to specify whether or not Nagios should check
# for external commands (in the command file defined below). By default
# Nagios will *not* check for external commands, just to be on the
# cautious side. If you want to be able to use the CGI command interface
# you will have to enable this. Setting this value to 0 disables command
# checking (the default), other values enable it.
外部命令選項。這個選項允許使用者指定是否Nagios應該對外部的命令進行檢查。預設下,Nagios將不會檢查外部命令,如果需要能夠使用CGI命令介面的話,那麼就必須要啟用這個選項。設定0值表示關閉命令檢查(預設),其它值表示啟用。
#check_external_commands=0
check_external_commands=1
設定是否檢測外部命令。預設是不啟用的,但是由於需要配合Apache工作,在Web介面下進行Nagiso的控制和管理的話,必須要將此項開啟。
第八部分:外部命令檢測時間間隔
# EXTERNAL COMMAND CHECK INTERVAL
# This is the interval at which Nagios should check for external commands.
# This value works of the interval_length you specify later. If you leave
# that at its default value of 60 (seconds), a value of 1 here will cause
# Nagios to check for external commands every minute. If you specify a
# number followed by an "s" (i.e. 15s), this will be interpreted to mean
# actual seconds rather than a multiple of the interval_length variable.
# Note: In addition to reading the external command file at regularly
# scheduled intervals, Nagios will also check for external commands after
# event handlers are executed.
# NOTE: Setting this value to -1 causes Nagios to check the external
# command file as often as possible.
這個配置選項是用來指定外部命令檢測的頻率。預設值-1表示Nagios將會盡可能頻繁地進行檢測。這裡的配置的數值如果不加上單位的話,預設單位表示分鐘,如1就是表示1分鐘,Nagios每分鐘檢測一次。如果要指定單位是秒的話,那麼需要在數值後面跟上s,如15s就表示15秒。
command_check_interval=15s
#command_check_interval=-1
設定外部命令檢測時間間隔。預設值是-1,Nagios會盡可能頻繁地進行檢測,這樣會造成系統資源換的巨大消耗。這裡還是建議將此條註釋,而將另外一條備選的15s的項解注,讓Nagios每15秒進行一次檢測好了。具體值請根據具體情況決定。
第九部分:外部命令檔案
# EXTERNAL COMMAND FILE
# This is the file that Nagios checks for external command requests.
# It is also where the command CGI will write commands that are submitted
# by users, so it must be writeable by the user that the web server
# is running as (usually 'nobody'). Permissions should be set at the
# directory level instead of on the file, as the file is deleted every
# time its contents are processed.
這是Nagios用來檢查外部命令請求的檔案。這個檔案同樣也是使用者操作提交與CGI命令寫入的地方,所以這個檔案必須對於相關服務可寫,一般是針對Apache的宿主使用者可寫。並且注意,這個檔案所在的目錄的許可權必須被Apache可寫,而不單指這檔案,因為這個檔案在工作當中是頻繁被刪除的。(之前我們將Apahe歸入Nagios組的時候就已經完成了)
command_file=/var/log/nagios/rw/nagios.cmd
設定外部命令檔案的路徑。
第十部分:外部命令緩衝插槽
# EXTERNAL COMMAND BUFFER SLOTS
# This settings is used to tweak the number of items or "slots" that
# the Nagios daemon should allocate to the buffer that holds incoming
# external commands before they are processed. As external commands
# are processed by the daemon, they are removed from the buffer.
這裡將設定Nagios守護程式對接收進來的外部命令進行處理前的緩衝區大小。一旦一個外部命令被Nagios守護程式處理完了之後就會被從緩衝區刪除掉。
external_command_buffer_slots=4096
設定外部命令快取區大小。
第十一部分:註解檔案
# COMMENT FILE
# This is the file that Nagios will use for storing host and service
# comments.
這是Nagios用來儲存主機和服務的註解資訊的檔案。
comment_file=/var/log/nagios/comments.dat
設定註解檔案的路徑。
第十二部分:故障時間檔案
# DOWNTIME FILE
# This is the file that Nagios will use for storing host and service
# downtime data.
這是Nagios用來記錄主機和服務故障停機時間資料的檔案。
downtime_file=/var/log/nagios/downtime.dat
設定故障時間檔案。
第十三部分:鎖定檔案
# LOCK FILE
# This is the lockfile that Nagios will use to store its PID number
# in when it is running in daemon mode.
這是Nagios在守護程式模式執行時用來儲存它的PID號的檔案。
lock_file=/var/run/nagios.pid
設定Nagios的PID檔案。
第十四部分:臨時檔案
# TEMP FILE
# This is a temporary file that is used as scratch space when Nagios
# updates the status log, cleans the comment file, etc. This file
# is created, used, and deleted throughout the time that Nagios is
# running.
這是當Nagios更新狀態日至、清除註解檔案等等工作時暫時保留檔案內容的臨時檔案。它將在Nagios執行時不停地被建立、使用和刪除。
temp_file=/var/log/nagios/nagios.tmp
設定臨時檔案的路徑。
第十五部分:事件代理選項
# EVENT BROKER OPTIONS
# Controls what (if any) data gets sent to the event broker.
# Values: 0 = Broker nothing
# -1 = Broker everything
# = See documentation
控制事件代理將受理什麼樣的資料。設定0值時表示不代理任何東西,設定-1值時表示代理任何資訊,設定其它值的話要參考專門的手冊。
event_broker_options=-1
設定事件代理。預設值就是-1。
第十六部分:事件代理模組
# EVENT BROKER MODULE(S)
# This directive is used to specify an event broker module that should
# by loaded by Nagios at startup. Use multiple directives if you want
# to load more than one module. Arguments that should be passed to
# the module at startup are seperated from the module path by a space.
#
# Example:
#
# broker_module= [moduleargs]
指定Nagios事件採集代理的模組庫的路徑,可以指定多個,後面可以跟上引數。
#broker_module=/somewhere/module1.o
#broker_module=/somewhere/module2.o arg1 arg2=3 debug=0
預設這裡是空的。如果有強人找到定製模組或者自己開發的話就寫在這邊吧= =||
第十七部分:日誌迴圈方式
# LOG ROTATION METHOD
# This is the log rotation method that Nagios should use to rotate
# the main log file. Values are as follows..
# n = None - don't rotate the log
# h = Hourly rotation (top of the hour)
# d = Daily rotation (midnight every day)
# w = Weekly rotation (midnight on Saturday evening)
# m = Monthly rotation (midnight last day of month)
指定Nagios用在寫主日誌記錄時的迴圈記錄方式。
值n表示none,不做迴圈。
值h表示hourly,每小時迴圈一次。(每小時的開始)
值d表示daily,每天迴圈一次。(每天的午夜)
值w表示weekly,每週迴圈一次。(每週六的晚上)
值m表示monthly,每月迴圈一次。(每上個月的最後一天的午夜)
log_rotation_method=d
設定主日誌迴圈方式,預設是每天迴圈。
第十八部分:日誌歸檔路徑
# LOG ARCHIVE PATH
# This is the directory where archived (rotated) log files should be
# placed (assuming you've chosen to do log rotation).
這個路徑將作為日誌歸檔存放的地方(需要之前日誌迴圈設定啟用)
log_archive_path=/var/log/nagios/archives
設定日誌歸檔路徑。
第十九部分:加入系統日誌選項
# LOGGING OPTIONS
# If you want messages logged to the syslog facility, as well as the
# NetAlarm log file set this option to 1. If not, set it to 0.
選擇是否將Nagios的執行資訊加入系統的Syslog當中。值1表示加入,值0表示不加入。
use_syslog=1
預設設定Nagio資訊加入系統日誌。
第二十部分:通知訊息記錄選項
# NOTIFICATION LOGGING OPTION
# If you don't want notifications to be logged, set this value to 0.
# If notifications should be logged, set the value to 1.
如果不想記錄通知訊息的話,就設定該項為0值,相對的值1表示記錄。
log_notifications=1
預設設定Nagios的通知資訊是記錄的。
第二十一部分:服務重啟資訊記錄選項
# SERVICE RETRY LOGGING OPTION
# If you don't want service check retries to be logged, set this value
# to 0. If retries should be logged, set the value to 1.
如果要記錄服務重啟資訊,設定值1。不記錄設定值0。
log_service_retries=1
預設設定記錄服務重啟資訊。
第二十二部分:主機重啟資訊記錄選項
# HOST RETRY LOGGING OPTION
# If you don't want host check retries to be logged, set this value to
# 0. If retries should be logged, set the value to 1.
如果要記錄主機重啟資訊,設定值1。不記錄設定值0。
log_host_retries=1
預設設定記錄主機重啟資訊。
第二十三部分:事件處理程式資訊記錄選項
# EVENT HANDLER LOGGING OPTION
# If you don't want host and service event handlers to be logged, set
# this value to 0. If event handlers should be logged, set the value
# to 1.
如果要記錄事件處理資訊,設定值1。不記錄設定值0。
log_event_handlers=1
預設啟用記錄事件處理程式資訊。
第二十四部分:初始狀態資訊記錄選項
# INITIAL STATES LOGGING OPTION
# If you want Nagios to log all initial host and service states to
# the main log file (the first time the service or host is checked)
# you can enable this option by setting this value to 1. If you
# are not using an external application that does long term state
# statistics reporting, you do not need to enable this option. In
# this case, set the value to 0.
如果想要Nagios記錄所有初始化的主機和服務狀態到主日誌檔案的話,那麼請將這個配置項的值設定為1。不記錄設定值0
log_initial_states=0
預設不記錄初始化狀態資訊。
第二十五部分:外部命令資訊記錄選項。
# EXTERNAL COMMANDS LOGGING OPTION
# If you don't want Nagios to log external commands, set this value
# to 0. If external commands should be logged, set this value to 1.
# Note: This option does not include logging of passive service
# checks - see the option below for controlling whether or not
# passive checks are logged.
如果想要Nagios記錄外部命令資訊的話,那麼請將這個配置項的值設定為1,不記錄設定值0。注意,這個選項將不包括被動服務的檢查。
log_external_commands=1
預設設定記錄外部命令資訊。
第二十六部分:被動檢查資訊記錄
# PASSIVE CHECKS LOGGING OPTION
# If you don't want Nagios to log passive host and service checks, set
# this value to 0. If passive checks should be logged, set
# this value to 1.
如果想要Nagios記錄被動主機和服務的檢查資訊的話,請設定為1,不記錄設定為0。
log_passive_checks=1
預設設定記錄被動檢查資訊。
第二十七部分:全域性主機和服務的事件處理程式
# GLOBAL HOST AND SERVICE EVENT HANDLERS
# These options allow you to specify a host and service event handler
# command that is to be run for every host or service state change.
# The global event handler is executed immediately prior to the event
# handler that you have optionally specified in each host or
# service definition. The command argument is the short name of a
# command definition that you define in your host configuration file.
# Read the HTML docs for more information.
這些選項允許指定針對所有主機或服務狀態變化執行的一個主機和服務事件處理程式命令。這個全域性事件處理程式將比每一個主機上和服務上的定義要來的優先。命令的引數是在主機配置檔案中,命令定義的簡短名。
#global_host_event_handler=somecommand
#global_service_event_handler=somecommand
預設這裡為空。
第二十八部分:服務間內部檢查之間延時的方式
# SERVICE INTER-CHECK DELAY METHOD
# This is the method that Nagios should use when initially
# "spreading out" service checks when it starts monitoring. The
# default is to use smart delay calculation, which will try to
# space all service checks out evenly to minimize CPU load.
# Using the dumb setting will cause all checks to be scheduled
# at the same time (with no delay between them)! This is not a
# good thing for production, but is useful when testing the
# parallelization functionality.
# n = None - don't use any delay between checks
# d = Use a "dumb" delay of 1 second between checks
# s = Use "smart" inter-check delay calculation
# x.xx = Use an inter-check delay of x.xx seconds
這是Nagios啟動初始化、對服務展開監控的時候使用的方式。預設情況下使用smart延時計算方式,它將盡力分隔開所有服務的檢查,平衡地減少CPU屆時的負載。如使用dump方式會造成所有檢查作業在初始化時併發(這種方式下它們之間將沒有時間延遲間隙)。
值n表示none,不做任何任何延遲。
值d表示dump,表示在兩個相鄰的檢查之間做1秒鐘的延遲。
值s表示smart,表示預設精簡方式安排延遲。
值x.xx表示手動定製每相鄰的檢查之間固定的x.xx秒延遲。
service_inter_check_delay_method=s
預設設定服務間檢查間隔採用smart演算法。
第二十九部分:最大服務檢查擴張
# MAXIMUM SERVICE CHECK SPREAD
# This variable determines the timeframe (in minutes) from the
# program start time that an initial check of all services should
# be completed. Default is 30 minutes.
這個變數值決定了從程式開始時間起,對所有服務進行一次初始化檢查完成的時間框架。預設是30分鐘。
max_service_check_spread=30
預設最大服務檢查擴張是30分鐘。
第三十部分:服務交錯檢查因數
# SERVICE CHECK INTERLEAVE FACTOR
# This variable determines how service checks are interleaved.
# Interleaving the service checks allows for a more even
# distribution of service checks and reduced load on remote
# hosts. Setting this value to 1 is equivalent to how versions
# of Nagios previous to 0.0.5 did service checks. Set this
# value to s (smart) for automatic calculation of the interleave
# factor unless you have a specific reason to change it.
# s = Use "smart" interleave factor calculation
# x = Use an interleave factor of x, where x is a
# number greater than or equal to 1.
這個變數決定了服務檢查之間是如何被交錯檢查的。交錯的服務檢查將更加離散化,並且減少遠端主機的負載。設定值分為s,或者任何比1大的數字。
service_interleave_factor=s
預設下交錯因數為s,即smart精簡演算法。
第三十一部分:主機間內部檢查之間延時的方式
# HOST INTER-CHECK DELAY METHOD
# This is the method that Nagios should use when initially
# "spreading out" host checks when it starts monitoring. The
# default is to use smart delay calculation, which will try to
# space all host checks out evenly to minimize CPU load.
# Using the dumb setting will cause all checks to be scheduled
# at the same time (with no delay between them)!
# n = None - don't use any delay between checks
# d = Use a "dumb" delay of 1 second between checks
# s = Use "smart" inter-check delay calculation
# x.xx = Use an inter-check delay of x.xx second
這是Nagios啟動初始化、對主機展開監控的時候使用的方式。預設情況下使用smart延時計算方式,它將盡力分隔開所有主機的檢查,平衡地減少CPU屆時的負載。如使用dump方式會造成所有檢查作業在初始化時併發(這種方式下它們之間將沒有時間延遲間隙)。
值n表示none,不做任何任何延遲。
值d表示dump,表示在兩個相鄰的檢查之間做1秒鐘的延遲。
值s表示smart,表示預設精簡方式安排延遲。
值x.xx表示手動定製每相鄰的檢查之間固定的x.xx秒延遲
host_inter_check_delay_method=s
預設設定主機間檢查間隔是採用smart演算法。
第三十二部分:最大主機檢查擴張
# MAXIMUM HOST CHECK SPREAD
# This variable determines the timeframe (in minutes) from the
# program start time that an initial check of all hosts should
# be completed. Default is 30 minutes.
這個變數值決定了從程式開始時間起,對所有主機進行一次初始化檢查完成的時間框架。預設是30分鐘。
max_host_check_spread=30
預設最大主機檢查擴張是30分鐘。
第三十三部分:最大併發服務檢查
# MAXIMUM CONCURRENT SERVICE CHECKS
# This option allows you to specify the maximum number of
# service checks that can be run in parallel at any given time.
# Specifying a value of 1 for this variable essentially prevents
# any service checks from being parallelized. A value of 0
# will not restrict the number of concurrent checks that are
# being executed.
這個選項將影響Nagios任一時刻間對服務檢查的併發數量。設定值1的話會防止任何併發的服務檢查。如果設定值0的話,每一時刻的服務檢查併發數量將不嚴格按照當時實際執行的服務併發數量。
max_concurrent_checks=0
預設下這個引數設定是0。
第三十四部分:服務檢查結果處理頻率
# SERVICE CHECK REAPER FREQUENCY
# This is the frequency (in seconds!) that Nagios will process
# the results of services that have been checked.
這個值是Nagios將服務檢查結果進行處理的頻率。
service_reaper_frequency=10
預設這個頻率值設定為10。
第三十五部分:檢查結果緩衝區
# CHECK RESULT BUFFER SLOTS
# This settings is used to tweak the number of items or "slots" that
# the Nagios daemon should allocate to the buffer that holds
# service check results before they are processed. As check results
# are processed by the daemon, they are removed from the buffer.
這個緩衝區是Nagios守護程式對服務檢查結果未處理前進行保留緩衝的大小。一旦這些結果被處理完畢之後就被立即清除出緩衝區。
check_result_buffer_slots=4096
預設這個檢查結果的緩衝區是4MB。
第三十六部分:自動重排程選項
# AUTO-RESCHEDULING OPTION
# This option determines whether or not Nagios will attempt to
# automatically reschedule active host and service checks to
# "smooth" them out over time. This can help balance the load on
# the monitoring server.
# WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
# PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
這個選項決定了Nagios是否將嘗試自動去排程對活動主機和服務的檢查,並使這些工作更平穩進行。這將對監視伺服器的負載起到均衡幫助。警告:這個值的設定請慎重透過實驗效能的測試,否則效果適得其反。
auto_reschedule_checks=0
預設下自動排程引數為0,關閉。
第三十七部分:自動重排程間隔
# AUTO-RESCHEDULING INTERVAL
# This option determines how often (in seconds) Nagios will
# attempt to automatically reschedule checks. This option only
# has an effect if the auto_reschedule_checks option is enabled.
# Default is 30 seconds.
# WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
# PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
這個選項決定了Nagios將多頻繁地嘗試自動重新排程檢查工作,單位為秒。這個選項只有在AUTO-RESCHEULING OPTION選項啟用時才有效。預設情況下是30秒。警告:這個值的設定請慎重透過實驗效能的測試,否則效果適得其反。
auto_rescheduling_interval=30
預設下自動重排程間隔時間為30秒。
第三十八部分:自動重排程視窗大小
# AUTO-RESCHEDULING WINDOW
# This option determines the "window" of time (in seconds) that
# Nagios will look at when automatically rescheduling checks.
# Only host and service checks that occur in the next X seconds
# (determined by this variable) will be rescheduled. This option
# only has an effect if the auto_reschedule_checks option is
# enabled. Default is 180 seconds (3 minutes).
# WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
# PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
這個選項決定了Nagios一次嘗試自動重新排程檢查工作視窗的大小,單位為秒。只有在下一個X秒中內的主機和服務的檢查會被重新排程(大小就是由這個值來決定)。同樣,這個選項只有在AUTO-RESCHEULING OPTION選項啟用時才有效。預設情況下是180秒。警告:這個值的設定請慎重透過實驗效能的測試,否則效果適得其反。
auto_rescheduling_window=180
預設下自動重新排程視窗大小為180秒。
第三十九部分:休眠時間
# SLEEP TIME
# This is the number of seconds to sleep between checking for system
# events and service checks that need to be run.
這個以秒為單位的數值是在檢查系統事件和服務檢測之間的時間差值。
sleep_time=0.25
預設休眠時間是0.25秒。
第四十部分:超時數值
# TIMEOUT VALUES
# These options control how much time Nagios will allow various
# types of commands to execute before killing them off. Options
# are available for controlling maximum time allotted for
# service checks, host checks, event handlers, notifications, the
# ocsp command, and performance data commands. All values are in
# seconds.
這些選項控制著Nagios將能夠多長時間允許那些不同型別命令在它們被終止以前保持執行。
service_check_timeout=60
host_check_timeout=30
event_handler_timeout=30
notification_timeout=30
ocsp_timeout=5
perfdata_timeout=5
第四十一部分:保持狀態資訊
# RETAIN STATE INFORMATION
# This setting determines whether or not Nagios will save state
# information for services and hosts before it shuts down. Upon
# startup Nagios will reload all saved service and host state
# information before starting to monitor. This is useful for
# maintaining long-term data on state statistics, etc, but will
# slow Nagios down a bit when it (re)starts. Since its only
# a one-time penalty, I think its well worth the additional
# startup delay.
這個設定決定了Nagios是否在Nagios自己關閉前為服務和主機儲存狀態資訊。緊接在Nagios啟動之後,Nagios將在開始進行檢測工作前重新載入之前儲存的服務和主機的狀態資訊。這將對維護長期狀態監測資料統計等工作有利。但是這個設定也會略微造成Nagios啟動緩慢的效果。由於這種影響是一時性的,因此有開啟的必要。
retain_state_information=1
預設保持狀態資訊功能是開啟的。
第四十二部分:狀態保留檔案
# STATE RETENTION FILE
# This is the file that Nagios should use to store host and
# service state information before it shuts down. The state
# information in this file is also read immediately prior to
# starting to monitor the network when Nagios is restarted.
# This file is used only if the preserve_state_information
# variable is set to 1.
這個檔案將保留Nagios關閉前記錄的主機和服務的狀態資訊。而這個檔案也將是當Nagios再次啟動後立即讀取的檔案。這個選項僅僅在保持狀態資訊功能開啟時才有效。
state_retention_file=/var/log/nagios/retention.dat
設定狀態保留檔案路徑。
第四十三部分:保留狀態資料更新間隔
# RETENTION DATA UPDATE INTERVAL
# This setting determines how often (in minutes) that Nagios
# will automatically save retention data during normal operation.
# If you set this value to 0, Nagios will not save retention
# data at regular interval, but it will still save retention
# data before shutting down or restarting. If you have disabled
# state retention, this option has no effect.
這個設定決定Nagios將多頻繁地在正常工作過程中自動儲存狀態資料。如果設定值0的話,那麼Nagios將在正常間隔中不儲存資料,但是它仍然會在關閉或重啟前對主機和服務狀態做一次儲存。如果關閉了保持狀態資訊功能的話,那麼這個選項將無效。
retention_update_interval=60
預設儲存狀態資料間隔是60秒。
第四十四部分:使用保留程式狀態
# USE RETAINED PROGRAM STATE
# This setting determines whether or not Nagios will set
# program status variables based on the values saved in the
# retention file. If you want to use retained program status
# information, set this value to 1. If not, set this value
# to 0.
這個設定決定了Nagios是否將程式的狀態設定為基於上次保留的狀態。如果使用保留的程式狀態的話,那麼設定值1,不啟用則設定值0。
use_retained_program_state=1
預設是啟用保留程式狀態。
第四十五部分:使用保留排程資訊
# USE RETAINED SCHEDULING INFO
# This setting determines whether or not Nagios will retain
# the scheduling info (next check time) for hosts and services
# based on the values saved in the retention file. If you
# If you want to use retained scheduling info, set this
# value to 1. If not, set this value to 0.
這個設定決定了Nagios是否保留將在下一個主機和服務的檢測時間裡使用上次保留的排程。如果啟用保留排程資訊的話設定值1,不啟用為0。
use_retained_scheduling_info=0
預設不啟用保留排程資訊。
第四十六部分:間隔長度
# INTERVAL LENGTH
# This is the seconds per unit interval as used in the
# host/contact/service configuration files. Setting this to 60 means
# that each interval is one minute long (60 seconds). Other settings
# have not been tested much, so your mileage is likely to vary...
這是個以秒為單位,被用在主機/服務配置檔案中。設定這個值為60意味著每個間隔將會是一分鐘的長度。
interval_length=60
預設時間間隔長度是60秒。
第四十七部分:強行主機檢測選項
# AGGRESSIVE HOST CHECKING OPTION
# If you don't want to turn on aggressive host checking features, set
# this value to 0 (the default). Otherwise set this value to 1 to
# enable the aggressive check option. Read the docs for more info
# on what aggressive host check is or check out the source code in
# base/checks.c
如果不想啟用強行主機檢測特性的話,設定該配置項值為0。否則設定該項值為1來啟用強行主機檢測選項。如果想更多瞭解關於強行主機檢測功能的話請閱讀base/checks.c的原始碼或相關手冊。
use_aggressive_host_checking=0
預設是不啟用強制主機檢測特性的。
第四十八部分:服務檢測執行選項
# SERVICE CHECK EXECUTION OPTION
# This determines whether or not Nagios will actively execute
# service checks when it initially starts. If this option is
# disabled, checks are not actively made, but Nagios can still
# receive and process passive check results that come in. Unless
# you're implementing redundant hosts or have a special need for
# disabling the execution of service checks, leave this enabled!
# Values: 1 = enable checks, 0 = disable checks
這個設定決定了Nagios在啟動初始的時候是否將主動地執行服務檢測。如果這個選項被關閉了,監測將不會主動進行,但是Nagios會仍然接收和處理被動檢測的結果。除非正在執行冗餘主機或者有一個特殊的理由需要關閉服務檢測的執行,否則應該讓這個配置項保持啟用。值1表示啟用檢測,值0表示關閉監測。
execute_service_checks=1
預設下服務檢測是啟用的。
第四十九部分:被動服務檢測接受選項
# PASSIVE SERVICE CHECK ACCEPTANCE OPTION
# This determines whether or not Nagios will accept passive
# service checks results when it initially (re)starts.
# Values: 1 = accept passive checks, 0 = reject passive checks
這個設定決定了Nagios在啟動或者重啟時,是否將接受被動服務檢測的結果。值1表示接受被動檢測,值0表示拒絕被動檢測。
accept_passive_service_checks=1
預設是啟用被動服務檢測功能的。
第五十部分:主機檢測執行選項。
# HOST CHECK EXECUTION OPTION
# This determines whether or not Nagios will actively execute
# host checks when it initially starts. If this option is
# disabled, checks are not actively made, but Nagios can still
# receive and process passive check results that come in. Unless
# you're implementing redundant hosts or have a special need for
# disabling the execution of host checks, leave this enabled!
# Values: 1 = enable checks, 0 = disable checks
這個設定決定了Nagios在啟動初始的時候是否將主動地執行主機檢測。如果這個選項被關閉了,監測將不會主動進行,但是Nagios會仍然接收和處理被動檢測的結果。除非正在執行冗餘主機或者有一個特殊的理由需要關閉服務檢測的執行,否則應該讓這個配置項保持啟用。值1表示啟用檢測,值0表示關閉監測。
execute_host_checks=1
預設下啟用主機檢測功能的。
第五十一部分:被動主機檢測接受選項
# PASSIVE HOST CHECK ACCEPTANCE OPTION
# This determines whether or not Nagios will accept passive
# host checks results when it initially (re)starts.
# Values: 1 = accept passive checks, 0 = reject passive checks
這個設定決定了Nagios在啟動或者重啟時,是否將接受被動主機檢測的結果。值1表示接受被動檢測,值0表示拒絕被動檢測。
accept_passive_host_checks=1
預設下是啟用被動主機檢測功能的。
第五十二部分:通知選項
# NOTIFICATIONS OPTION
# This determines whether or not Nagios will sent out any host or
# service notifications when it is initially (re)started.
# Values: 1 = enable notifications, 0 = disable notifications
這個設定將決定當Nagios啟動或者重啟時是否傳送出任何主機或服務的通知。值1表示啟用通知,值0表示關閉通知。
enable_notifications=1
預設是啟用通知。
第五十三部分:事件處理程式使用選項
# EVENT HANDLER USE OPTION
# This determines whether or not Nagios will run any host or
# service event handlers when it is initially (re)started. Unless
# you're implementing redundant hosts, leave this option enabled.
# Values: 1 = enable event handlers, 0 = disable event handlers
這個設定將決定當Nagios啟動或者重啟時是否執行任何主機或者服務的事件處理程式。除非在執行冗餘主機或者有特殊的理由,否則請務必開啟此功能。值1表示開啟事件處理程式,值0表示關閉事件處理程式。
enable_event_handlers=1
預設啟用事件處理程式。
第五十四部分:處理效能資料選項
# PROCESS PERFORMANCE DATA OPTION
# This determines whether or not Nagios will process performance
# data returned from service and host checks. If this option is
# enabled, host performance data will be processed using the
# host_perfdata_command (defined below) and service performance
# data will be processed using the service_perfdata_command (also
# defined below). Read the HTML docs for more information on
# performance data.
# Values: 1 = process performance data, 0 = do not process performance data
這個選項將決定Nagios是否處理從服務和主機檢測當中返回的效能資料。如果這個選項被啟用了,那麼主機效能資料將透過host_perfdata_command中定義的方式進行處理,並且服務效能資料也將透過service_perfdata_command中定義的方式進行處理。設定值1表示處理效能資料,值0表示不處理效能資料。
process_performance_data=0
預設不對效能資料進行處理。
第五十五部分:主機和服務效能資料處理命令
# HOST AND SERVICE PERFORMANCE DATA PROCESSING COMMANDS
# These commands are run after every host and service check is
# performed. These commands are executed only if the
# enable_performance_data option (above) is set to 1. The command
# argument is the short name of a command definition that you
# define in your host configuration file. Read the HTML docs for
# more information on performance data.
這些命令在每個主機和服務檢測被執行的時候執行。這些命令僅僅當enable_performance_data選項置1的時候才會被執行。這個命令的引數則是在主機配置檔案中定義的簡寫名。
#host_perfdata_command=process-host-perfdata
#service_perfdata_command=process-service-perfdata
預設這裡是空的。
第五十六部分:主機和服務效能資料檔案
# HOST AND SERVICE PERFORMANCE DATA FILES
# These files are used to store host and service performance data.
# Performance data is only written to these files if the
# enable_performance_data option (above) is set to 1.
這些檔案被用來儲存主機和服務效能的資料。如果enable_performance_data項設定值1的話,效能資料將能寫入到這些檔案當中。
#host_perfdata_file=/tmp/host-perfdata
#service_perfdata_file=/tmp/service-perfdata
預設註釋掉效能資料檔案的路徑。
第五十七部分:主機和服務效能資料檔案模版
# HOST AND SERVICE PERFORMANCE DATA FILE TEMPLATES
# These options determine what data is written (and how) to the
# performance data files. The templates may contain macros, special
# characters (\t for tab, \r for carriage return, \n for newline)
# and plain text. A newline is automatically added after each write
# to the performance data file. Some examples of what you can do are
# shown below.
這些選項決定了資料檔案當中將記錄什麼樣的資料。模版可以包含宏、指定字元(\t表示tab,\r表示返回,\n表示換行)以及簡單文字。換行則將被自動新增到每個寫入的新的效能資料之後。以下則是示例的格式。
#host_perfdata_file_template=[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
#service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
第五十八部分:主機和服務效能資料檔案模式
# HOST AND SERVICE PERFORMANCE DATA FILE MODES
# This option determines whether or not the host and service
# performance data files are opened in write ("w") or append ("a")
# mode. Unless you are the files are named pipes, you will probably
# want to use the default mode of append ("a").
這個選項將覺得主機和服務效能資料檔案是否開放“寫”(w)或“追加”(a)模式。除非你的檔案透過管道來命名的,否則請使用預設的追加模式a。
#host_perfdata_file_mode=a
#service_perfdata_file_mode=a
預設這裡是註釋掉的。
第五十九部分:主機和服務效能資料檔案處理間隔
# HOST AND SERVICE PERFORMANCE DATA FILE PROCESSING INTERVAL
# These options determine how often (in seconds) the host and service
# performance data files are processed using the commands defined
# below. A value of 0 indicates the files should not be periodically
# processed.
這些選項決定了主機和服務效能資料檔案將多頻繁地透過下面定義的命令來處理。值0表示這些檔案將不會被迴圈處理。
#host_perfdata_file_processing_interval=0
#service_perfdata_file_processing_interval=0
預設這裡是註釋掉的。
第六十部分:主機和服務效能資料檔案處理命令
# HOST AND SERVICE PERFORMANCE DATA FILE PROCESSING COMMANDS
# These commands are used to periodically process the host and
# service performance data files. The interval at which the
# processing occurs is determined by the options above.
這些命令被用來迴圈地處理主機和服務效能資料檔案。而這些處理進行的時間的間隔將由上面的配置選項決定。
#host_perfdata_file_processing_command=process-host-perfdata-file
#service_perfdata_file_processing_command=process-service-perfdata-file
預設這裡是註釋掉的。
第六十一部分:迷惑服務檢測選項?(這裡不我也不是很明白)
# OBSESS OVER SERVICE CHECKS OPTION
# This determines whether or not Nagios will obsess over service
# checks and run the ocsp_command defined below. Unless you're
# planning on implementing distributed monitoring, do not enable
# this option. Read the HTML docs for more information on
# implementing distributed monitoring.
# Values: 1 = obsess over services, 0 = do not obsess (default)
這個選項將決定Nagios是否被服務檢測迷惑並執行之後定義的ocsp_command。除非機會執行分散式的監測,否則不要輕易啟用這個選項。值1表示迷惑服務。值0表示不迷惑服務。
obsess_over_services=0
預設不啟用。
第六十二部分:OCSP命令
# OBSESSIVE COMPULSIVE SERVICE PROCESSOR COMMAND
# This is the command that is run for every service check that is
# processed by Nagios. This command is executed only if the
# obsess_over_service option (above) is set to 1. The command
# argument is the short name of a command definition that you
# define in your host configuration file. Read the HTML docs for
# more information on implementing distributed monitoring.
這是個由Nagios處理的、為每個服務檢測而執行的命令。這個命令僅僅當obsess_over_service選項設定值1啟動時才執行有效。這個命令的引數則是在主機配置檔案中定義的簡寫名。
#ocsp_command=somecommand
預設這裡配置為空。
第六十三部分:孤兒服務檢測選項
# ORPHANED SERVICE CHECK OPTION
# This determines whether or not Nagios will periodically
# check for orphaned services. Since service checks are not
# rescheduled until the results of their previous execution
# instance are processed, there exists a possibility that some
# checks may never get rescheduled. This seems to be a rare
# problem and should not happen under normal circumstances.
# If you have problems with service checks never getting
# rescheduled, you might want to try enabling this option.
# Values: 1 = enable checks, 0 = disable checks
這個設定決定了Nagios是否會週期地檢查被孤立的服務。因為服務檢測在直到他們的上一個執行例項被處理前都不會被重新排程,所以就會有一個可能就是一些檢測將會永遠得不到重新排程。雖然這似乎會是一個比較罕見的問題,並且在正常情況下不會發生。如果你有這種某些服務檢測永遠得不到重排程的問題的話,可能需要將此選項置值為1啟用。值0表示關閉。
check_for_orphaned_services=1
預設情況下是啟用孤兒服務檢測選項的。
第六十四部分:服務更新監測選項
# SERVICE FRESHNESS CHECK OPTION
# This option determines whether or not Nagios will periodically
# check the "freshness" of service results. Enabling this option
# is useful for ensuring passive checks are received in a timely
# manner.
# Values: 1 = enabled freshness checking, 0 = disable freshness checking
這個選項將決定Nagios是否會週期性地檢查服務更新結果。啟用置1,不啟用置0。
check_service_freshness=1
預設啟用服務更新監測。
第六十五部分:服務更新監測間隔
# SERVICE FRESHNESS CHECK INTERVAL
# This setting determines how often (in seconds) Nagios will
# check the "freshness" of service check results. If you have
# disabled service freshness checking, this option has no effect.
這個設定決定Nagios將多頻繁地對服務更新進行檢查。如果關閉了服務更新監測選項的話,那麼這個選項將無效。
service_freshness_check_interval=60
預設服務更新監測時間間隔是60秒。
第六十六部分:主機更新檢測選項。
# HOST FRESHNESS CHECK OPTION
# This option determines whether or not Nagios will periodically
# check the "freshness" of host results. Enabling this option
# is useful for ensuring passive checks are received in a timely
# manner.
# Values: 1 = enabled freshness checking, 0 = disable freshness checking
這個選項將決定Nagios是否會週期性地檢查主機更新結果。啟用置1,不啟用置0。
check_host_freshness=0
預設關閉主機更新檢測。
第六十七部分:主機更新檢測間隔
# HOST FRESHNESS CHECK INTERVAL
# This setting determines how often (in seconds) Nagios will
# check the "freshness" of host check results. If you have
# disabled host freshness checking, this option has no effect.
這個設定決定Nagios將多頻繁地對主機更新進行檢查。如果關閉了主機更新監測選項的話,那麼這個選項將無效。
host_freshness_check_interval=60
預設主機更新監測間隔為60秒。
第六十八部分:聚集狀態更新
# AGGREGATED STATUS UPDATES
# This option determines whether or not Nagios will
# aggregate updates of host, service, and program status
# data. Normally, status data is updated immediately when
# a change occurs. This can result in high CPU loads if
# you are monitoring a lot of services. If you want Nagios
# to only refresh status data every few seconds, disable
# this option.
# Values: 1 = enable aggregate updates, 0 = disable aggregate updates
這個選項決定了Nagios將是否聚集主機、服務以及程式狀態的資料更新。正常情況下,當一個變化發生時,狀態資料將會立即更新。但是當對多個服務進行檢測的時候這種情況會造成高額的CPU負載。如果想要Nagios只隔若干秒就重新整理一次狀態的話,就關閉這個選項。值1表示啟用聚集狀態更新,值0的話則關閉。
aggregate_status_updates=1
預設情況下啟用聚集狀態更新。
第六十九部分:聚集狀態更新間隔
# AGGREGATED STATUS UPDATE INTERVAL
# Combined with the aggregate_status_updates option,
# this option determines the frequency (in seconds!) that
# Nagios will periodically dump program, host, and
# service status data. If you are not using aggregated
# status data updates, this option has no effect.
該選項須結合aggregate_status_update選項的設定。這個選項將決定Nagios是否週期性地更新程式、主機以及服務的狀態資料。如果沒有啟用聚集狀態更新功能選項,那麼這個選項將無效。
status_update_interval=15
預設聚集狀態更新間隔為15秒。
第七十部分:抖動探測選項
# FLAP DETECTION OPTION
# This option determines whether or not Nagios will try
# and detect hosts and services that are "flapping".
# Flapping occurs when a host or service changes between
# states too frequently. When Nagios detects that a
# host or service is flapping, it will temporarily suppress
# notifications for that host/service until it stops
# flapping. Flap detection is very experimental, so read
# the HTML documentation before enabling this feature!
# Values: 1 = enable flap detection
# 0 = disable flap detection (default)
這個選項決定Nagios將是否嘗試去檢測那些“發生抖動”的主機和服務。所謂“抖動”就是發生在當一個主機或者服務頻繁地在兩種狀態之間變化的現象。當Nagios探測到一個主機或者服務正在發生抖動的時候,它將暫時抑制這個主機/服務的通知訊息,直到抖動停止。值1表示啟用抖動探測,值0表示關閉抖動檢測,預設關閉。
enable_flap_detection=0
預設是關閉抖動檢測的。
第七十一部分:主機和服務的抖動檢測閥值
# FLAP DETECTION THRESHOLDS FOR HOSTS AND SERVICES
# Read the HTML documentation on flap detection for
# an explanation of what this option does. This option
# has no effect if flap detection is disabled.
設定主機和服務抖動的高低閥值。如果抖動檢測沒有被啟動的話,那麼這些配置項將無效。
low_service_flap_threshold=5.0
最低服務抖動閥值,預設為5秒。
high_service_flap_threshold=20.0
最高服務抖動法制,預設為20秒。
low_host_flap_threshold=5.0
最低主機抖動閥值,預設為5秒。
high_host_flap_threshold=20.0
最高主機抖動閥值,預設為20秒。
第七十二部分:日期格式選項
# DATE FORMAT OPTION
# This option determines how short dates are displayed. Valid options
# include:
# us (MM-DD-YYYY HH:MM:SS)
# euro (DD-MM-YYYY HH:MM:SS)
# iso8601 (YYYY-MM-DD HH:MM:SS)
# strict-iso8601 (YYYY-MM-DDTHH:MM:SS)
#
這個選項決定了簡寫日期顯示的格式,可用選項如下:
美國標準 us (MM-DD-YYYY HH:MM:SS)
歐洲標準 euro (DD-MM-YYYY HH:MM:SS)
國際標準 iso8601 (YYYY-MM-DD HH:MM:SS)
嚴格國際標準 strict-iso8601 (YYYY-MM-DDTHH:MM:SS)
date_format=us
預設格式為美國標準。
第七十三部分:P1.PL檔案檔案位置
# P1.PL FILE LOCATION
# This value determines where the p1.pl perl script (used by the
# embedded Perl interpreter) is located. If you didn't compile
# Nagios with embedded Perl support, this option has no effect.
這個值決定了p1.pl perl指令碼的路徑位置。如果你沒有配合使用perl編譯的話,那麼這個選項將無效。
p1_file=/usr/bin/p1.pl
第七十四部分:非法物件命名字元
# ILLEGAL OBJECT NAME CHARACTERS
# This option allows you to specify illegal characters that cannot
# be used in host names, service descriptions, or names of other
# object types.
在這個選項裡定義了哪些字元將不能使用在主機名、服務描述或者其他物件型別當中。
illegal_object_name_chars=`~!$%^&*|'"<>?,()=
預設已經列出了一些非法命名字元。
第七十五部分:非法宏輸出字元
# ILLEGAL MACRO OUTPUT CHARACTERS
# This option allows you to specify illegal characters that are
# stripped from macros before being used in notifications, event
# handlers, etc. This DOES NOT affect macros used in service or
# host check commands.
# The following macros are stripped of the characters you specify:
# $HOSTOUTPUT$
# $HOSTPERFDATA$
# $HOSTACKAUTHOR$
# $HOSTACKCOMMENT$
# $SERVICEOUTPUT$
# $SERVICEPERFDATA$
# $SERVICEACKAUTHOR$
# $SERVICEACKCOMMENT$
這個選項裡定義了哪些字元將不能作為宏的輸出字元。以下的這些宏將受到該選項配置的影響:
$HOSTOUTPUT$
$HOSTPERFDATA$
$HOSTACKAUTHOR$
$HOSTACKCOMMENT$
$SERVICEOUTPUT$
$SERVICEPERFDATA$
$SERVICEACKAUTHOR$
$SERVICEACKCOMMENT$
illegal_macro_output_chars=`~$&|'"<>
預設已經列出了一些非法命名字元。
第七十六部分:正規表示式匹配
# REGULAR EXPRESSION MATCHING
# This option controls whether or not regular expression matching
# takes place in the object config files. Regular expression
# matching is used to match host, hostgroup, service, and service
# group names/descriptions in some fields of various object types.
# Values: 1 = enable regexp matching, 0 = disable regexp matching
這個選項控制了表示式在物件配置檔案中是否會發生表示式的匹配。正規表示式用來在一些欄位中匹配主機、主機組、服務、服務組的命名/描述。值1表示啟用正規表示式匹配功能,值0表示關閉。
use_regexp_matching=0
預設關閉正規表示式的匹配功能。
第七十七部分:真值正規表示式匹配
# "TRUE" REGULAR EXPRESSION MATCHING
# This option controls whether or not "true" regular expression
# matching takes place in the object config files. This option
# only has an effect if regular expression matching is enabled
# (see above). If this option is DISABLED, regular expression
# matching only occurs if a string contains wildcard characters
# (* and ?). If the option is ENABLED, regexp matching occurs
# all the time (which can be annoying).
# Values: 1 = enable true matching, 0 = disable true matching
這個選項控制了在物件配置檔案中是否會發生值為“真”的正規表示式的匹配。這個選項僅僅在啟正規表示式匹配功能的前提下有效。如果這個選項被關閉了,那麼正則表送達式匹配將僅發生在一個字串包含通配字元(“*”和“?”)的情況下了。如果這個選項被啟用了,那麼正規表示式匹配將會在任何情況下發生了(這可能會引起一些不希望發生的問題)。
use_true_regexp_matching=0
預設情況下真值的正規表示式匹配功能是關閉的。
第七十八部分:管理員電子郵件地址
# ADMINISTRATOR EMAIL ADDRESS
# The email address of the administrator of *this* machine (the one
# doing the monitoring). Nagios never uses this value itself, but
# you can access this value by using the $ADMINEMAIL$ macro in your
# notification commands.
指定管理員的郵件地址
admin_email=nagios
預設情況下該項值為nagios。
第七十九部分:管理員聯絡地址
# ADMINISTRATOR PAGER NUMBER/ADDRESS
# The pager number/address for the administrator of *this* machine.
# Nagios never uses this value itself, but you can access this
# value by using the $ADMINPAGER$ macro in your notification
# commands.
設定管理員的聯絡地址
admin_pager=pagenagios
預設下該項值為pagenagios
第八十部分:守護程式核心轉儲
# DAEMON CORE DUMP OPTION
# This option determines whether or not Nagios is allowed to create
# a core dump when it runs as a daemon. Note that it is generally
# considered bad form to allow this, but it may be useful for
# debugging purposes.
# Values: 1 - Allow core dumps
# 0 - Do not allow core dumps (default)
這個選項決定了當Nagios作為一個守護程式執行的時候,是否允許建立一個核心轉儲。注意通常情況下啟用這個選項被認為是一種不優的方式,但是它可能對診斷排錯帶來幫助。值1表示允許核心轉儲,值0表示不允許核心轉儲,預設情況下是關閉的。
daemon_dumps_core=0
預設情況下不允許核心轉儲。
這裡開始要講一些Nagios的配置。
首先要看看目前Nagios的主配置路徑下有哪些檔案。
[root@nagios etc]# ll
總用量 152
-rwxrwxr-x. 1 nagios nagios 1825 9月 24 14:40 cgi.cfg
-rwxrwxr-x. 1 nagios nagios 9747 9月 24 14:40 checkcommands.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 connectors.cfg
-rwxrwxr-x. 1 nagios nagios 1352 9月 24 14:40 contactgroups.cfg
-rwxrwxr-x. 1 nagios nagios 1539 9月 24 14:40 contacts.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 contactTemplates.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 dependencies.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 escalations.cfg
-rwxrwxr-x. 1 nagios nagios 1211 9月 24 14:40 hostgroups.cfg
-rwxrwxr-x. 1 nagios nagios 1956 9月 24 14:40 hosts.cfg
-rwxrwxr-x. 1 nagios nagios 2949 9月 24 14:40 hostTemplates.cfg
-rwxrwxr-x. 1 apache nagios 26 6月 3 2013 htpasswd.users
-rwxrwxr-x. 1 nagios nagios 1573 9月 24 14:40 meta_commands.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_contact.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_contactgroup.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_dependencies.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_escalations.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_host.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_hostgroup.cfg
-rwxrwxr-x. 1 nagios nagios 1089 9月 24 14:40 meta_services.cfg
-rwxrwxr-x. 1 nagios nagios 1341 9月 24 14:40 meta_timeperiod.cfg
-rwxrwxr-x. 1 nagios nagios 5683 9月 24 14:40 misccommands.cfg
-rwxrwxr-x. 1 nagios nagios 4170 9月 24 14:40 nagios.cfg
-rwxrwxr-x. 1 nagios nagios 1448 9月 24 14:40 ndo2db.cfg
-rwxrwxr-x. 1 nagios nagios 1351 9月 24 14:40 ndomod.cfg
-rwxrwxr-x. 1 nagios nagios 7988 6月 3 2013 nrpe.cfg
drwxrwxr-x. 2 nagios nagios 4096 6月 3 2013 objects
-rwxrwxr-x. 1 nagios nagios 1158 9月 24 14:40 resource.cfg
-rwxrwxr-x. 1 nagios nagios 1236 9月 24 14:40 servicegroups.cfg
-rwxrwxr-x. 1 nagios nagios 2244 9月 24 14:40 services.cfg
-rwxrwxr-x. 1 nagios nagios 5533 9月 24 14:40 serviceTemplates.cfg
-rwxrwxr-x. 1 nagios nagios 2138 9月 24 14:40 timeperiods.cfg
Nagios主配置檔案:
Nagios的主配置檔案為/etc/nagios/nagios.cfg,在進行操作前首先要對主配置檔案進行備份。
# cp /etc/nagios/nagios.cfg /etc/nagios/nagios.cfg.backup
配置Nagios的主配置檔案:
# vi /etc/nagios/nagios.cfg
--------------------------------------------------------------------------------
第一部分:日誌檔案
# LOG FILE
# This is the main log file where service and host events are logged
# for historical purposes. This should be the first option specified
# in the config file!!!
日誌檔案,用來記錄主機活動事件的主要日誌檔案檔案,這應該是配置檔案中位於最首的。
log_file=/var/log/nagios/nagios.log
設定Nagios的主日誌檔案路徑。
第二部分:物件配置檔案模組
# OBJECT CONFIGURATION FILE(S)
# This is the configuration file in which you define hosts, host
# groups, contacts, contact groups, services, etc. I guess it would
# be better called an object definition file, but for historical
# reasons it isn't. You can split object definitions into several
# different config files by using multiple cfg_file statements here.
# Nagios will read and process all the config files you define.
# This can be very useful if you want to keep command definitions
# separate from host and contact definitions...
物件配置檔案。這些配置檔案將會分別用來定義主機、主機組、聯絡人、聯絡人組、服務、等等。這些更應當被理解為“物件定義”檔案較為貼切。
可以透過將一些物件透過多個不同獨立的cfg_file語句指明的配置檔案分開定義。
Nagios將會讀取並且處理所有這些配置檔案中記載的定義。
對於需要將命令定義和其他類似於主機、聯絡人等定義分開處理記錄的話,將會非常有用。
# Command definitions
cfg_file=/etc/nagios/commands.cfg
設定命令定義配置檔案路徑。
# Host and service definitions for monitoring this machine
cfg_file=/etc/nagios/localhost.cfg
設定主機和服務監視定義配置檔案路徑。
# You can split other types of object definitions across several
# config files if you wish (as done here), or keep them all in a
# single config file.
以下則是其它型別細分定義的配置檔案,也可以將它們全部寫在一張配置檔案當中。這些預設是加註的,如果要啟用的話需要手動解注。而且這些檔案預設也是沒有的,如果要啟用還必須手動建立它們。
#cfg_file=/etc/nagios/contactgroups.cfg
#cfg_file=/etc/nagios/contacts.cfg
#cfg_file=/etc/nagios/dependencies.cfg
#cfg_file=/etc/nagios/escalations.cfg
#cfg_file=/etc/nagios/hostgroups.cfg
#cfg_file=/etc/nagios/hosts.cfg
#cfg_file=/etc/nagios/services.cfg
#cfg_file=/etc/nagios/timeperiods.cfg
#cfg_dir=/etc/nagios/servers
#cfg_dir=/etc/nagios/printers
#cfg_dir=/etc/nagios/switches
#cfg_dir=/etc/nagios/routers
# Extended host/service info definitions are now stored along with
# other object definitions:
以下是一些擴充套件的主機/服務資訊定義配置檔案。
#cfg_file=/etc/nagios/hostextinfo.cfg
#cfg_file=/etc/nagios/serviceextinfo.cfg
第三部分:物件快取檔案
# OBJECT CACHE FILE
# This option determines where object definitions are cached when
# Nagios starts/restarts. The CGIs read object definitions from
# this cache file (rather than looking at the object config files
# directly) in order to prevent inconsistencies that can occur
# when the config files are modified after Nagios starts.
物件快取檔案。這些選項將決定當Nagios啟動時或重新啟動時,物件定義將被快取在什麼地方。CGI將從這個物件檔案中讀取物件的定義,而不是在之前的物件配置檔案路徑中去找。這樣做是為了避免修改Nagios配置檔案後引起的不一致問題。換句簡單的話說就是更改配置檔案後要重新運新Nagios新的配置引數才會生效,而當前執行的Nagios只參考快取中的配置引數而已。
object_cache_file=/var/log/nagios/objects.cache
設定物件快取檔案的路徑。
第四部分:狀態檔案
# STATUS FILE
# This is where the current status of all monitored services and
# hosts is stored. Its contents are read and processed by the CGIs.
# The contents of the status file are deleted every time Nagios
# restarts.
狀態檔案。這個檔案將儲存著目前檢測到的服務和主機資料資訊。這個檔案當中的內容是被CGI讀取並處理的,而它也是在每次Nagios重新啟動的時候被刪除清空的。
status_file=/var/log/nagios/status.dat
設定狀態檔案的路徑。
第五部分:Nagios服務宿主使用者
# NAGIOS USER
# This determines the effective user that Nagios should run as.
# You can either supply a username or a UID.
支撐Nagios服務執行的使用者。貌似預設安裝後沒有這個使用者,如果沒有的話,手動建立一個。
nagios_user=nagios
預設情況下宿主使用者就是nagios。
第六部分:Nagios服務宿主使用者組
# NAGIOS GROUP
# This determines the effective group that Nagios should run as.
# You can either supply a group name or a GID.
支撐Nagios服務執行的使用者組。貌似安裝後也沒,如果沒有的話,和使用者一起手動建立。
nagios_group=nagios
預設情況下宿主使用者組就是nagios。
第七部分:外部命令選項
# EXTERNAL COMMAND OPTION
# This option allows you to specify whether or not Nagios should check
# for external commands (in the command file defined below). By default
# Nagios will *not* check for external commands, just to be on the
# cautious side. If you want to be able to use the CGI command interface
# you will have to enable this. Setting this value to 0 disables command
# checking (the default), other values enable it.
外部命令選項。這個選項允許使用者指定是否Nagios應該對外部的命令進行檢查。預設下,Nagios將不會檢查外部命令,如果需要能夠使用CGI命令介面的話,那麼就必須要啟用這個選項。設定0值表示關閉命令檢查(預設),其它值表示啟用。
#check_external_commands=0
check_external_commands=1
設定是否檢測外部命令。預設是不啟用的,但是由於需要配合Apache工作,在Web介面下進行Nagiso的控制和管理的話,必須要將此項開啟。
第八部分:外部命令檢測時間間隔
# EXTERNAL COMMAND CHECK INTERVAL
# This is the interval at which Nagios should check for external commands.
# This value works of the interval_length you specify later. If you leave
# that at its default value of 60 (seconds), a value of 1 here will cause
# Nagios to check for external commands every minute. If you specify a
# number followed by an "s" (i.e. 15s), this will be interpreted to mean
# actual seconds rather than a multiple of the interval_length variable.
# Note: In addition to reading the external command file at regularly
# scheduled intervals, Nagios will also check for external commands after
# event handlers are executed.
# NOTE: Setting this value to -1 causes Nagios to check the external
# command file as often as possible.
這個配置選項是用來指定外部命令檢測的頻率。預設值-1表示Nagios將會盡可能頻繁地進行檢測。這裡的配置的數值如果不加上單位的話,預設單位表示分鐘,如1就是表示1分鐘,Nagios每分鐘檢測一次。如果要指定單位是秒的話,那麼需要在數值後面跟上s,如15s就表示15秒。
command_check_interval=15s
#command_check_interval=-1
設定外部命令檢測時間間隔。預設值是-1,Nagios會盡可能頻繁地進行檢測,這樣會造成系統資源換的巨大消耗。這裡還是建議將此條註釋,而將另外一條備選的15s的項解注,讓Nagios每15秒進行一次檢測好了。具體值請根據具體情況決定。
第九部分:外部命令檔案
# EXTERNAL COMMAND FILE
# This is the file that Nagios checks for external command requests.
# It is also where the command CGI will write commands that are submitted
# by users, so it must be writeable by the user that the web server
# is running as (usually 'nobody'). Permissions should be set at the
# directory level instead of on the file, as the file is deleted every
# time its contents are processed.
這是Nagios用來檢查外部命令請求的檔案。這個檔案同樣也是使用者操作提交與CGI命令寫入的地方,所以這個檔案必須對於相關服務可寫,一般是針對Apache的宿主使用者可寫。並且注意,這個檔案所在的目錄的許可權必須被Apache可寫,而不單指這檔案,因為這個檔案在工作當中是頻繁被刪除的。(之前我們將Apahe歸入Nagios組的時候就已經完成了)
command_file=/var/log/nagios/rw/nagios.cmd
設定外部命令檔案的路徑。
第十部分:外部命令緩衝插槽
# EXTERNAL COMMAND BUFFER SLOTS
# This settings is used to tweak the number of items or "slots" that
# the Nagios daemon should allocate to the buffer that holds incoming
# external commands before they are processed. As external commands
# are processed by the daemon, they are removed from the buffer.
這裡將設定Nagios守護程式對接收進來的外部命令進行處理前的緩衝區大小。一旦一個外部命令被Nagios守護程式處理完了之後就會被從緩衝區刪除掉。
external_command_buffer_slots=4096
設定外部命令快取區大小。
第十一部分:註解檔案
# COMMENT FILE
# This is the file that Nagios will use for storing host and service
# comments.
這是Nagios用來儲存主機和服務的註解資訊的檔案。
comment_file=/var/log/nagios/comments.dat
設定註解檔案的路徑。
第十二部分:故障時間檔案
# DOWNTIME FILE
# This is the file that Nagios will use for storing host and service
# downtime data.
這是Nagios用來記錄主機和服務故障停機時間資料的檔案。
downtime_file=/var/log/nagios/downtime.dat
設定故障時間檔案。
第十三部分:鎖定檔案
# LOCK FILE
# This is the lockfile that Nagios will use to store its PID number
# in when it is running in daemon mode.
這是Nagios在守護程式模式執行時用來儲存它的PID號的檔案。
lock_file=/var/run/nagios.pid
設定Nagios的PID檔案。
第十四部分:臨時檔案
# TEMP FILE
# This is a temporary file that is used as scratch space when Nagios
# updates the status log, cleans the comment file, etc. This file
# is created, used, and deleted throughout the time that Nagios is
# running.
這是當Nagios更新狀態日至、清除註解檔案等等工作時暫時保留檔案內容的臨時檔案。它將在Nagios執行時不停地被建立、使用和刪除。
temp_file=/var/log/nagios/nagios.tmp
設定臨時檔案的路徑。
第十五部分:事件代理選項
# EVENT BROKER OPTIONS
# Controls what (if any) data gets sent to the event broker.
# Values: 0 = Broker nothing
# -1 = Broker everything
#
控制事件代理將受理什麼樣的資料。設定0值時表示不代理任何東西,設定-1值時表示代理任何資訊,設定其它值的話要參考專門的手冊。
event_broker_options=-1
設定事件代理。預設值就是-1。
第十六部分:事件代理模組
# EVENT BROKER MODULE(S)
# This directive is used to specify an event broker module that should
# by loaded by Nagios at startup. Use multiple directives if you want
# to load more than one module. Arguments that should be passed to
# the module at startup are seperated from the module path by a space.
#
# Example:
#
# broker_module=
指定Nagios事件採集代理的模組庫的路徑,可以指定多個,後面可以跟上引數。
#broker_module=/somewhere/module1.o
#broker_module=/somewhere/module2.o arg1 arg2=3 debug=0
預設這裡是空的。如果有強人找到定製模組或者自己開發的話就寫在這邊吧= =||
第十七部分:日誌迴圈方式
# LOG ROTATION METHOD
# This is the log rotation method that Nagios should use to rotate
# the main log file. Values are as follows..
# n = None - don't rotate the log
# h = Hourly rotation (top of the hour)
# d = Daily rotation (midnight every day)
# w = Weekly rotation (midnight on Saturday evening)
# m = Monthly rotation (midnight last day of month)
指定Nagios用在寫主日誌記錄時的迴圈記錄方式。
值n表示none,不做迴圈。
值h表示hourly,每小時迴圈一次。(每小時的開始)
值d表示daily,每天迴圈一次。(每天的午夜)
值w表示weekly,每週迴圈一次。(每週六的晚上)
值m表示monthly,每月迴圈一次。(每上個月的最後一天的午夜)
log_rotation_method=d
設定主日誌迴圈方式,預設是每天迴圈。
第十八部分:日誌歸檔路徑
# LOG ARCHIVE PATH
# This is the directory where archived (rotated) log files should be
# placed (assuming you've chosen to do log rotation).
這個路徑將作為日誌歸檔存放的地方(需要之前日誌迴圈設定啟用)
log_archive_path=/var/log/nagios/archives
設定日誌歸檔路徑。
第十九部分:加入系統日誌選項
# LOGGING OPTIONS
# If you want messages logged to the syslog facility, as well as the
# NetAlarm log file set this option to 1. If not, set it to 0.
選擇是否將Nagios的執行資訊加入系統的Syslog當中。值1表示加入,值0表示不加入。
use_syslog=1
預設設定Nagio資訊加入系統日誌。
第二十部分:通知訊息記錄選項
# NOTIFICATION LOGGING OPTION
# If you don't want notifications to be logged, set this value to 0.
# If notifications should be logged, set the value to 1.
如果不想記錄通知訊息的話,就設定該項為0值,相對的值1表示記錄。
log_notifications=1
預設設定Nagios的通知資訊是記錄的。
第二十一部分:服務重啟資訊記錄選項
# SERVICE RETRY LOGGING OPTION
# If you don't want service check retries to be logged, set this value
# to 0. If retries should be logged, set the value to 1.
如果要記錄服務重啟資訊,設定值1。不記錄設定值0。
log_service_retries=1
預設設定記錄服務重啟資訊。
第二十二部分:主機重啟資訊記錄選項
# HOST RETRY LOGGING OPTION
# If you don't want host check retries to be logged, set this value to
# 0. If retries should be logged, set the value to 1.
如果要記錄主機重啟資訊,設定值1。不記錄設定值0。
log_host_retries=1
預設設定記錄主機重啟資訊。
第二十三部分:事件處理程式資訊記錄選項
# EVENT HANDLER LOGGING OPTION
# If you don't want host and service event handlers to be logged, set
# this value to 0. If event handlers should be logged, set the value
# to 1.
如果要記錄事件處理資訊,設定值1。不記錄設定值0。
log_event_handlers=1
預設啟用記錄事件處理程式資訊。
第二十四部分:初始狀態資訊記錄選項
# INITIAL STATES LOGGING OPTION
# If you want Nagios to log all initial host and service states to
# the main log file (the first time the service or host is checked)
# you can enable this option by setting this value to 1. If you
# are not using an external application that does long term state
# statistics reporting, you do not need to enable this option. In
# this case, set the value to 0.
如果想要Nagios記錄所有初始化的主機和服務狀態到主日誌檔案的話,那麼請將這個配置項的值設定為1。不記錄設定值0
log_initial_states=0
預設不記錄初始化狀態資訊。
第二十五部分:外部命令資訊記錄選項。
# EXTERNAL COMMANDS LOGGING OPTION
# If you don't want Nagios to log external commands, set this value
# to 0. If external commands should be logged, set this value to 1.
# Note: This option does not include logging of passive service
# checks - see the option below for controlling whether or not
# passive checks are logged.
如果想要Nagios記錄外部命令資訊的話,那麼請將這個配置項的值設定為1,不記錄設定值0。注意,這個選項將不包括被動服務的檢查。
log_external_commands=1
預設設定記錄外部命令資訊。
第二十六部分:被動檢查資訊記錄
# PASSIVE CHECKS LOGGING OPTION
# If you don't want Nagios to log passive host and service checks, set
# this value to 0. If passive checks should be logged, set
# this value to 1.
如果想要Nagios記錄被動主機和服務的檢查資訊的話,請設定為1,不記錄設定為0。
log_passive_checks=1
預設設定記錄被動檢查資訊。
第二十七部分:全域性主機和服務的事件處理程式
# GLOBAL HOST AND SERVICE EVENT HANDLERS
# These options allow you to specify a host and service event handler
# command that is to be run for every host or service state change.
# The global event handler is executed immediately prior to the event
# handler that you have optionally specified in each host or
# service definition. The command argument is the short name of a
# command definition that you define in your host configuration file.
# Read the HTML docs for more information.
這些選項允許指定針對所有主機或服務狀態變化執行的一個主機和服務事件處理程式命令。這個全域性事件處理程式將比每一個主機上和服務上的定義要來的優先。命令的引數是在主機配置檔案中,命令定義的簡短名。
#global_host_event_handler=somecommand
#global_service_event_handler=somecommand
預設這裡為空。
第二十八部分:服務間內部檢查之間延時的方式
# SERVICE INTER-CHECK DELAY METHOD
# This is the method that Nagios should use when initially
# "spreading out" service checks when it starts monitoring. The
# default is to use smart delay calculation, which will try to
# space all service checks out evenly to minimize CPU load.
# Using the dumb setting will cause all checks to be scheduled
# at the same time (with no delay between them)! This is not a
# good thing for production, but is useful when testing the
# parallelization functionality.
# n = None - don't use any delay between checks
# d = Use a "dumb" delay of 1 second between checks
# s = Use "smart" inter-check delay calculation
# x.xx = Use an inter-check delay of x.xx seconds
這是Nagios啟動初始化、對服務展開監控的時候使用的方式。預設情況下使用smart延時計算方式,它將盡力分隔開所有服務的檢查,平衡地減少CPU屆時的負載。如使用dump方式會造成所有檢查作業在初始化時併發(這種方式下它們之間將沒有時間延遲間隙)。
值n表示none,不做任何任何延遲。
值d表示dump,表示在兩個相鄰的檢查之間做1秒鐘的延遲。
值s表示smart,表示預設精簡方式安排延遲。
值x.xx表示手動定製每相鄰的檢查之間固定的x.xx秒延遲。
service_inter_check_delay_method=s
預設設定服務間檢查間隔採用smart演算法。
第二十九部分:最大服務檢查擴張
# MAXIMUM SERVICE CHECK SPREAD
# This variable determines the timeframe (in minutes) from the
# program start time that an initial check of all services should
# be completed. Default is 30 minutes.
這個變數值決定了從程式開始時間起,對所有服務進行一次初始化檢查完成的時間框架。預設是30分鐘。
max_service_check_spread=30
預設最大服務檢查擴張是30分鐘。
第三十部分:服務交錯檢查因數
# SERVICE CHECK INTERLEAVE FACTOR
# This variable determines how service checks are interleaved.
# Interleaving the service checks allows for a more even
# distribution of service checks and reduced load on remote
# hosts. Setting this value to 1 is equivalent to how versions
# of Nagios previous to 0.0.5 did service checks. Set this
# value to s (smart) for automatic calculation of the interleave
# factor unless you have a specific reason to change it.
# s = Use "smart" interleave factor calculation
# x = Use an interleave factor of x, where x is a
# number greater than or equal to 1.
這個變數決定了服務檢查之間是如何被交錯檢查的。交錯的服務檢查將更加離散化,並且減少遠端主機的負載。設定值分為s,或者任何比1大的數字。
service_interleave_factor=s
預設下交錯因數為s,即smart精簡演算法。
第三十一部分:主機間內部檢查之間延時的方式
# HOST INTER-CHECK DELAY METHOD
# This is the method that Nagios should use when initially
# "spreading out" host checks when it starts monitoring. The
# default is to use smart delay calculation, which will try to
# space all host checks out evenly to minimize CPU load.
# Using the dumb setting will cause all checks to be scheduled
# at the same time (with no delay between them)!
# n = None - don't use any delay between checks
# d = Use a "dumb" delay of 1 second between checks
# s = Use "smart" inter-check delay calculation
# x.xx = Use an inter-check delay of x.xx second
這是Nagios啟動初始化、對主機展開監控的時候使用的方式。預設情況下使用smart延時計算方式,它將盡力分隔開所有主機的檢查,平衡地減少CPU屆時的負載。如使用dump方式會造成所有檢查作業在初始化時併發(這種方式下它們之間將沒有時間延遲間隙)。
值n表示none,不做任何任何延遲。
值d表示dump,表示在兩個相鄰的檢查之間做1秒鐘的延遲。
值s表示smart,表示預設精簡方式安排延遲。
值x.xx表示手動定製每相鄰的檢查之間固定的x.xx秒延遲
host_inter_check_delay_method=s
預設設定主機間檢查間隔是採用smart演算法。
第三十二部分:最大主機檢查擴張
# MAXIMUM HOST CHECK SPREAD
# This variable determines the timeframe (in minutes) from the
# program start time that an initial check of all hosts should
# be completed. Default is 30 minutes.
這個變數值決定了從程式開始時間起,對所有主機進行一次初始化檢查完成的時間框架。預設是30分鐘。
max_host_check_spread=30
預設最大主機檢查擴張是30分鐘。
第三十三部分:最大併發服務檢查
# MAXIMUM CONCURRENT SERVICE CHECKS
# This option allows you to specify the maximum number of
# service checks that can be run in parallel at any given time.
# Specifying a value of 1 for this variable essentially prevents
# any service checks from being parallelized. A value of 0
# will not restrict the number of concurrent checks that are
# being executed.
這個選項將影響Nagios任一時刻間對服務檢查的併發數量。設定值1的話會防止任何併發的服務檢查。如果設定值0的話,每一時刻的服務檢查併發數量將不嚴格按照當時實際執行的服務併發數量。
max_concurrent_checks=0
預設下這個引數設定是0。
第三十四部分:服務檢查結果處理頻率
# SERVICE CHECK REAPER FREQUENCY
# This is the frequency (in seconds!) that Nagios will process
# the results of services that have been checked.
這個值是Nagios將服務檢查結果進行處理的頻率。
service_reaper_frequency=10
預設這個頻率值設定為10。
第三十五部分:檢查結果緩衝區
# CHECK RESULT BUFFER SLOTS
# This settings is used to tweak the number of items or "slots" that
# the Nagios daemon should allocate to the buffer that holds
# service check results before they are processed. As check results
# are processed by the daemon, they are removed from the buffer.
這個緩衝區是Nagios守護程式對服務檢查結果未處理前進行保留緩衝的大小。一旦這些結果被處理完畢之後就被立即清除出緩衝區。
check_result_buffer_slots=4096
預設這個檢查結果的緩衝區是4MB。
第三十六部分:自動重排程選項
# AUTO-RESCHEDULING OPTION
# This option determines whether or not Nagios will attempt to
# automatically reschedule active host and service checks to
# "smooth" them out over time. This can help balance the load on
# the monitoring server.
# WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
# PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
這個選項決定了Nagios是否將嘗試自動去排程對活動主機和服務的檢查,並使這些工作更平穩進行。這將對監視伺服器的負載起到均衡幫助。警告:這個值的設定請慎重透過實驗效能的測試,否則效果適得其反。
auto_reschedule_checks=0
預設下自動排程引數為0,關閉。
第三十七部分:自動重排程間隔
# AUTO-RESCHEDULING INTERVAL
# This option determines how often (in seconds) Nagios will
# attempt to automatically reschedule checks. This option only
# has an effect if the auto_reschedule_checks option is enabled.
# Default is 30 seconds.
# WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
# PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
這個選項決定了Nagios將多頻繁地嘗試自動重新排程檢查工作,單位為秒。這個選項只有在AUTO-RESCHEULING OPTION選項啟用時才有效。預設情況下是30秒。警告:這個值的設定請慎重透過實驗效能的測試,否則效果適得其反。
auto_rescheduling_interval=30
預設下自動重排程間隔時間為30秒。
第三十八部分:自動重排程視窗大小
# AUTO-RESCHEDULING WINDOW
# This option determines the "window" of time (in seconds) that
# Nagios will look at when automatically rescheduling checks.
# Only host and service checks that occur in the next X seconds
# (determined by this variable) will be rescheduled. This option
# only has an effect if the auto_reschedule_checks option is
# enabled. Default is 180 seconds (3 minutes).
# WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
# PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
這個選項決定了Nagios一次嘗試自動重新排程檢查工作視窗的大小,單位為秒。只有在下一個X秒中內的主機和服務的檢查會被重新排程(大小就是由這個值來決定)。同樣,這個選項只有在AUTO-RESCHEULING OPTION選項啟用時才有效。預設情況下是180秒。警告:這個值的設定請慎重透過實驗效能的測試,否則效果適得其反。
auto_rescheduling_window=180
預設下自動重新排程視窗大小為180秒。
第三十九部分:休眠時間
# SLEEP TIME
# This is the number of seconds to sleep between checking for system
# events and service checks that need to be run.
這個以秒為單位的數值是在檢查系統事件和服務檢測之間的時間差值。
sleep_time=0.25
預設休眠時間是0.25秒。
第四十部分:超時數值
# TIMEOUT VALUES
# These options control how much time Nagios will allow various
# types of commands to execute before killing them off. Options
# are available for controlling maximum time allotted for
# service checks, host checks, event handlers, notifications, the
# ocsp command, and performance data commands. All values are in
# seconds.
這些選項控制著Nagios將能夠多長時間允許那些不同型別命令在它們被終止以前保持執行。
service_check_timeout=60
host_check_timeout=30
event_handler_timeout=30
notification_timeout=30
ocsp_timeout=5
perfdata_timeout=5
第四十一部分:保持狀態資訊
# RETAIN STATE INFORMATION
# This setting determines whether or not Nagios will save state
# information for services and hosts before it shuts down. Upon
# startup Nagios will reload all saved service and host state
# information before starting to monitor. This is useful for
# maintaining long-term data on state statistics, etc, but will
# slow Nagios down a bit when it (re)starts. Since its only
# a one-time penalty, I think its well worth the additional
# startup delay.
這個設定決定了Nagios是否在Nagios自己關閉前為服務和主機儲存狀態資訊。緊接在Nagios啟動之後,Nagios將在開始進行檢測工作前重新載入之前儲存的服務和主機的狀態資訊。這將對維護長期狀態監測資料統計等工作有利。但是這個設定也會略微造成Nagios啟動緩慢的效果。由於這種影響是一時性的,因此有開啟的必要。
retain_state_information=1
預設保持狀態資訊功能是開啟的。
第四十二部分:狀態保留檔案
# STATE RETENTION FILE
# This is the file that Nagios should use to store host and
# service state information before it shuts down. The state
# information in this file is also read immediately prior to
# starting to monitor the network when Nagios is restarted.
# This file is used only if the preserve_state_information
# variable is set to 1.
這個檔案將保留Nagios關閉前記錄的主機和服務的狀態資訊。而這個檔案也將是當Nagios再次啟動後立即讀取的檔案。這個選項僅僅在保持狀態資訊功能開啟時才有效。
state_retention_file=/var/log/nagios/retention.dat
設定狀態保留檔案路徑。
第四十三部分:保留狀態資料更新間隔
# RETENTION DATA UPDATE INTERVAL
# This setting determines how often (in minutes) that Nagios
# will automatically save retention data during normal operation.
# If you set this value to 0, Nagios will not save retention
# data at regular interval, but it will still save retention
# data before shutting down or restarting. If you have disabled
# state retention, this option has no effect.
這個設定決定Nagios將多頻繁地在正常工作過程中自動儲存狀態資料。如果設定值0的話,那麼Nagios將在正常間隔中不儲存資料,但是它仍然會在關閉或重啟前對主機和服務狀態做一次儲存。如果關閉了保持狀態資訊功能的話,那麼這個選項將無效。
retention_update_interval=60
預設儲存狀態資料間隔是60秒。
第四十四部分:使用保留程式狀態
# USE RETAINED PROGRAM STATE
# This setting determines whether or not Nagios will set
# program status variables based on the values saved in the
# retention file. If you want to use retained program status
# information, set this value to 1. If not, set this value
# to 0.
這個設定決定了Nagios是否將程式的狀態設定為基於上次保留的狀態。如果使用保留的程式狀態的話,那麼設定值1,不啟用則設定值0。
use_retained_program_state=1
預設是啟用保留程式狀態。
第四十五部分:使用保留排程資訊
# USE RETAINED SCHEDULING INFO
# This setting determines whether or not Nagios will retain
# the scheduling info (next check time) for hosts and services
# based on the values saved in the retention file. If you
# If you want to use retained scheduling info, set this
# value to 1. If not, set this value to 0.
這個設定決定了Nagios是否保留將在下一個主機和服務的檢測時間裡使用上次保留的排程。如果啟用保留排程資訊的話設定值1,不啟用為0。
use_retained_scheduling_info=0
預設不啟用保留排程資訊。
第四十六部分:間隔長度
# INTERVAL LENGTH
# This is the seconds per unit interval as used in the
# host/contact/service configuration files. Setting this to 60 means
# that each interval is one minute long (60 seconds). Other settings
# have not been tested much, so your mileage is likely to vary...
這是個以秒為單位,被用在主機/服務配置檔案中。設定這個值為60意味著每個間隔將會是一分鐘的長度。
interval_length=60
預設時間間隔長度是60秒。
第四十七部分:強行主機檢測選項
# AGGRESSIVE HOST CHECKING OPTION
# If you don't want to turn on aggressive host checking features, set
# this value to 0 (the default). Otherwise set this value to 1 to
# enable the aggressive check option. Read the docs for more info
# on what aggressive host check is or check out the source code in
# base/checks.c
如果不想啟用強行主機檢測特性的話,設定該配置項值為0。否則設定該項值為1來啟用強行主機檢測選項。如果想更多瞭解關於強行主機檢測功能的話請閱讀base/checks.c的原始碼或相關手冊。
use_aggressive_host_checking=0
預設是不啟用強制主機檢測特性的。
第四十八部分:服務檢測執行選項
# SERVICE CHECK EXECUTION OPTION
# This determines whether or not Nagios will actively execute
# service checks when it initially starts. If this option is
# disabled, checks are not actively made, but Nagios can still
# receive and process passive check results that come in. Unless
# you're implementing redundant hosts or have a special need for
# disabling the execution of service checks, leave this enabled!
# Values: 1 = enable checks, 0 = disable checks
這個設定決定了Nagios在啟動初始的時候是否將主動地執行服務檢測。如果這個選項被關閉了,監測將不會主動進行,但是Nagios會仍然接收和處理被動檢測的結果。除非正在執行冗餘主機或者有一個特殊的理由需要關閉服務檢測的執行,否則應該讓這個配置項保持啟用。值1表示啟用檢測,值0表示關閉監測。
execute_service_checks=1
預設下服務檢測是啟用的。
第四十九部分:被動服務檢測接受選項
# PASSIVE SERVICE CHECK ACCEPTANCE OPTION
# This determines whether or not Nagios will accept passive
# service checks results when it initially (re)starts.
# Values: 1 = accept passive checks, 0 = reject passive checks
這個設定決定了Nagios在啟動或者重啟時,是否將接受被動服務檢測的結果。值1表示接受被動檢測,值0表示拒絕被動檢測。
accept_passive_service_checks=1
預設是啟用被動服務檢測功能的。
第五十部分:主機檢測執行選項。
# HOST CHECK EXECUTION OPTION
# This determines whether or not Nagios will actively execute
# host checks when it initially starts. If this option is
# disabled, checks are not actively made, but Nagios can still
# receive and process passive check results that come in. Unless
# you're implementing redundant hosts or have a special need for
# disabling the execution of host checks, leave this enabled!
# Values: 1 = enable checks, 0 = disable checks
這個設定決定了Nagios在啟動初始的時候是否將主動地執行主機檢測。如果這個選項被關閉了,監測將不會主動進行,但是Nagios會仍然接收和處理被動檢測的結果。除非正在執行冗餘主機或者有一個特殊的理由需要關閉服務檢測的執行,否則應該讓這個配置項保持啟用。值1表示啟用檢測,值0表示關閉監測。
execute_host_checks=1
預設下啟用主機檢測功能的。
第五十一部分:被動主機檢測接受選項
# PASSIVE HOST CHECK ACCEPTANCE OPTION
# This determines whether or not Nagios will accept passive
# host checks results when it initially (re)starts.
# Values: 1 = accept passive checks, 0 = reject passive checks
這個設定決定了Nagios在啟動或者重啟時,是否將接受被動主機檢測的結果。值1表示接受被動檢測,值0表示拒絕被動檢測。
accept_passive_host_checks=1
預設下是啟用被動主機檢測功能的。
第五十二部分:通知選項
# NOTIFICATIONS OPTION
# This determines whether or not Nagios will sent out any host or
# service notifications when it is initially (re)started.
# Values: 1 = enable notifications, 0 = disable notifications
這個設定將決定當Nagios啟動或者重啟時是否傳送出任何主機或服務的通知。值1表示啟用通知,值0表示關閉通知。
enable_notifications=1
預設是啟用通知。
第五十三部分:事件處理程式使用選項
# EVENT HANDLER USE OPTION
# This determines whether or not Nagios will run any host or
# service event handlers when it is initially (re)started. Unless
# you're implementing redundant hosts, leave this option enabled.
# Values: 1 = enable event handlers, 0 = disable event handlers
這個設定將決定當Nagios啟動或者重啟時是否執行任何主機或者服務的事件處理程式。除非在執行冗餘主機或者有特殊的理由,否則請務必開啟此功能。值1表示開啟事件處理程式,值0表示關閉事件處理程式。
enable_event_handlers=1
預設啟用事件處理程式。
第五十四部分:處理效能資料選項
# PROCESS PERFORMANCE DATA OPTION
# This determines whether or not Nagios will process performance
# data returned from service and host checks. If this option is
# enabled, host performance data will be processed using the
# host_perfdata_command (defined below) and service performance
# data will be processed using the service_perfdata_command (also
# defined below). Read the HTML docs for more information on
# performance data.
# Values: 1 = process performance data, 0 = do not process performance data
這個選項將決定Nagios是否處理從服務和主機檢測當中返回的效能資料。如果這個選項被啟用了,那麼主機效能資料將透過host_perfdata_command中定義的方式進行處理,並且服務效能資料也將透過service_perfdata_command中定義的方式進行處理。設定值1表示處理效能資料,值0表示不處理效能資料。
process_performance_data=0
預設不對效能資料進行處理。
第五十五部分:主機和服務效能資料處理命令
# HOST AND SERVICE PERFORMANCE DATA PROCESSING COMMANDS
# These commands are run after every host and service check is
# performed. These commands are executed only if the
# enable_performance_data option (above) is set to 1. The command
# argument is the short name of a command definition that you
# define in your host configuration file. Read the HTML docs for
# more information on performance data.
這些命令在每個主機和服務檢測被執行的時候執行。這些命令僅僅當enable_performance_data選項置1的時候才會被執行。這個命令的引數則是在主機配置檔案中定義的簡寫名。
#host_perfdata_command=process-host-perfdata
#service_perfdata_command=process-service-perfdata
預設這裡是空的。
第五十六部分:主機和服務效能資料檔案
# HOST AND SERVICE PERFORMANCE DATA FILES
# These files are used to store host and service performance data.
# Performance data is only written to these files if the
# enable_performance_data option (above) is set to 1.
這些檔案被用來儲存主機和服務效能的資料。如果enable_performance_data項設定值1的話,效能資料將能寫入到這些檔案當中。
#host_perfdata_file=/tmp/host-perfdata
#service_perfdata_file=/tmp/service-perfdata
預設註釋掉效能資料檔案的路徑。
第五十七部分:主機和服務效能資料檔案模版
# HOST AND SERVICE PERFORMANCE DATA FILE TEMPLATES
# These options determine what data is written (and how) to the
# performance data files. The templates may contain macros, special
# characters (\t for tab, \r for carriage return, \n for newline)
# and plain text. A newline is automatically added after each write
# to the performance data file. Some examples of what you can do are
# shown below.
這些選項決定了資料檔案當中將記錄什麼樣的資料。模版可以包含宏、指定字元(\t表示tab,\r表示返回,\n表示換行)以及簡單文字。換行則將被自動新增到每個寫入的新的效能資料之後。以下則是示例的格式。
#host_perfdata_file_template=[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
#service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
第五十八部分:主機和服務效能資料檔案模式
# HOST AND SERVICE PERFORMANCE DATA FILE MODES
# This option determines whether or not the host and service
# performance data files are opened in write ("w") or append ("a")
# mode. Unless you are the files are named pipes, you will probably
# want to use the default mode of append ("a").
這個選項將覺得主機和服務效能資料檔案是否開放“寫”(w)或“追加”(a)模式。除非你的檔案透過管道來命名的,否則請使用預設的追加模式a。
#host_perfdata_file_mode=a
#service_perfdata_file_mode=a
預設這裡是註釋掉的。
第五十九部分:主機和服務效能資料檔案處理間隔
# HOST AND SERVICE PERFORMANCE DATA FILE PROCESSING INTERVAL
# These options determine how often (in seconds) the host and service
# performance data files are processed using the commands defined
# below. A value of 0 indicates the files should not be periodically
# processed.
這些選項決定了主機和服務效能資料檔案將多頻繁地透過下面定義的命令來處理。值0表示這些檔案將不會被迴圈處理。
#host_perfdata_file_processing_interval=0
#service_perfdata_file_processing_interval=0
預設這裡是註釋掉的。
第六十部分:主機和服務效能資料檔案處理命令
# HOST AND SERVICE PERFORMANCE DATA FILE PROCESSING COMMANDS
# These commands are used to periodically process the host and
# service performance data files. The interval at which the
# processing occurs is determined by the options above.
這些命令被用來迴圈地處理主機和服務效能資料檔案。而這些處理進行的時間的間隔將由上面的配置選項決定。
#host_perfdata_file_processing_command=process-host-perfdata-file
#service_perfdata_file_processing_command=process-service-perfdata-file
預設這裡是註釋掉的。
第六十一部分:迷惑服務檢測選項?(這裡不我也不是很明白)
# OBSESS OVER SERVICE CHECKS OPTION
# This determines whether or not Nagios will obsess over service
# checks and run the ocsp_command defined below. Unless you're
# planning on implementing distributed monitoring, do not enable
# this option. Read the HTML docs for more information on
# implementing distributed monitoring.
# Values: 1 = obsess over services, 0 = do not obsess (default)
這個選項將決定Nagios是否被服務檢測迷惑並執行之後定義的ocsp_command。除非機會執行分散式的監測,否則不要輕易啟用這個選項。值1表示迷惑服務。值0表示不迷惑服務。
obsess_over_services=0
預設不啟用。
第六十二部分:OCSP命令
# OBSESSIVE COMPULSIVE SERVICE PROCESSOR COMMAND
# This is the command that is run for every service check that is
# processed by Nagios. This command is executed only if the
# obsess_over_service option (above) is set to 1. The command
# argument is the short name of a command definition that you
# define in your host configuration file. Read the HTML docs for
# more information on implementing distributed monitoring.
這是個由Nagios處理的、為每個服務檢測而執行的命令。這個命令僅僅當obsess_over_service選項設定值1啟動時才執行有效。這個命令的引數則是在主機配置檔案中定義的簡寫名。
#ocsp_command=somecommand
預設這裡配置為空。
第六十三部分:孤兒服務檢測選項
# ORPHANED SERVICE CHECK OPTION
# This determines whether or not Nagios will periodically
# check for orphaned services. Since service checks are not
# rescheduled until the results of their previous execution
# instance are processed, there exists a possibility that some
# checks may never get rescheduled. This seems to be a rare
# problem and should not happen under normal circumstances.
# If you have problems with service checks never getting
# rescheduled, you might want to try enabling this option.
# Values: 1 = enable checks, 0 = disable checks
這個設定決定了Nagios是否會週期地檢查被孤立的服務。因為服務檢測在直到他們的上一個執行例項被處理前都不會被重新排程,所以就會有一個可能就是一些檢測將會永遠得不到重新排程。雖然這似乎會是一個比較罕見的問題,並且在正常情況下不會發生。如果你有這種某些服務檢測永遠得不到重排程的問題的話,可能需要將此選項置值為1啟用。值0表示關閉。
check_for_orphaned_services=1
預設情況下是啟用孤兒服務檢測選項的。
第六十四部分:服務更新監測選項
# SERVICE FRESHNESS CHECK OPTION
# This option determines whether or not Nagios will periodically
# check the "freshness" of service results. Enabling this option
# is useful for ensuring passive checks are received in a timely
# manner.
# Values: 1 = enabled freshness checking, 0 = disable freshness checking
這個選項將決定Nagios是否會週期性地檢查服務更新結果。啟用置1,不啟用置0。
check_service_freshness=1
預設啟用服務更新監測。
第六十五部分:服務更新監測間隔
# SERVICE FRESHNESS CHECK INTERVAL
# This setting determines how often (in seconds) Nagios will
# check the "freshness" of service check results. If you have
# disabled service freshness checking, this option has no effect.
這個設定決定Nagios將多頻繁地對服務更新進行檢查。如果關閉了服務更新監測選項的話,那麼這個選項將無效。
service_freshness_check_interval=60
預設服務更新監測時間間隔是60秒。
第六十六部分:主機更新檢測選項。
# HOST FRESHNESS CHECK OPTION
# This option determines whether or not Nagios will periodically
# check the "freshness" of host results. Enabling this option
# is useful for ensuring passive checks are received in a timely
# manner.
# Values: 1 = enabled freshness checking, 0 = disable freshness checking
這個選項將決定Nagios是否會週期性地檢查主機更新結果。啟用置1,不啟用置0。
check_host_freshness=0
預設關閉主機更新檢測。
第六十七部分:主機更新檢測間隔
# HOST FRESHNESS CHECK INTERVAL
# This setting determines how often (in seconds) Nagios will
# check the "freshness" of host check results. If you have
# disabled host freshness checking, this option has no effect.
這個設定決定Nagios將多頻繁地對主機更新進行檢查。如果關閉了主機更新監測選項的話,那麼這個選項將無效。
host_freshness_check_interval=60
預設主機更新監測間隔為60秒。
第六十八部分:聚集狀態更新
# AGGREGATED STATUS UPDATES
# This option determines whether or not Nagios will
# aggregate updates of host, service, and program status
# data. Normally, status data is updated immediately when
# a change occurs. This can result in high CPU loads if
# you are monitoring a lot of services. If you want Nagios
# to only refresh status data every few seconds, disable
# this option.
# Values: 1 = enable aggregate updates, 0 = disable aggregate updates
這個選項決定了Nagios將是否聚集主機、服務以及程式狀態的資料更新。正常情況下,當一個變化發生時,狀態資料將會立即更新。但是當對多個服務進行檢測的時候這種情況會造成高額的CPU負載。如果想要Nagios只隔若干秒就重新整理一次狀態的話,就關閉這個選項。值1表示啟用聚集狀態更新,值0的話則關閉。
aggregate_status_updates=1
預設情況下啟用聚集狀態更新。
第六十九部分:聚集狀態更新間隔
# AGGREGATED STATUS UPDATE INTERVAL
# Combined with the aggregate_status_updates option,
# this option determines the frequency (in seconds!) that
# Nagios will periodically dump program, host, and
# service status data. If you are not using aggregated
# status data updates, this option has no effect.
該選項須結合aggregate_status_update選項的設定。這個選項將決定Nagios是否週期性地更新程式、主機以及服務的狀態資料。如果沒有啟用聚集狀態更新功能選項,那麼這個選項將無效。
status_update_interval=15
預設聚集狀態更新間隔為15秒。
第七十部分:抖動探測選項
# FLAP DETECTION OPTION
# This option determines whether or not Nagios will try
# and detect hosts and services that are "flapping".
# Flapping occurs when a host or service changes between
# states too frequently. When Nagios detects that a
# host or service is flapping, it will temporarily suppress
# notifications for that host/service until it stops
# flapping. Flap detection is very experimental, so read
# the HTML documentation before enabling this feature!
# Values: 1 = enable flap detection
# 0 = disable flap detection (default)
這個選項決定Nagios將是否嘗試去檢測那些“發生抖動”的主機和服務。所謂“抖動”就是發生在當一個主機或者服務頻繁地在兩種狀態之間變化的現象。當Nagios探測到一個主機或者服務正在發生抖動的時候,它將暫時抑制這個主機/服務的通知訊息,直到抖動停止。值1表示啟用抖動探測,值0表示關閉抖動檢測,預設關閉。
enable_flap_detection=0
預設是關閉抖動檢測的。
第七十一部分:主機和服務的抖動檢測閥值
# FLAP DETECTION THRESHOLDS FOR HOSTS AND SERVICES
# Read the HTML documentation on flap detection for
# an explanation of what this option does. This option
# has no effect if flap detection is disabled.
設定主機和服務抖動的高低閥值。如果抖動檢測沒有被啟動的話,那麼這些配置項將無效。
low_service_flap_threshold=5.0
最低服務抖動閥值,預設為5秒。
high_service_flap_threshold=20.0
最高服務抖動法制,預設為20秒。
low_host_flap_threshold=5.0
最低主機抖動閥值,預設為5秒。
high_host_flap_threshold=20.0
最高主機抖動閥值,預設為20秒。
第七十二部分:日期格式選項
# DATE FORMAT OPTION
# This option determines how short dates are displayed. Valid options
# include:
# us (MM-DD-YYYY HH:MM:SS)
# euro (DD-MM-YYYY HH:MM:SS)
# iso8601 (YYYY-MM-DD HH:MM:SS)
# strict-iso8601 (YYYY-MM-DDTHH:MM:SS)
#
這個選項決定了簡寫日期顯示的格式,可用選項如下:
美國標準 us (MM-DD-YYYY HH:MM:SS)
歐洲標準 euro (DD-MM-YYYY HH:MM:SS)
國際標準 iso8601 (YYYY-MM-DD HH:MM:SS)
嚴格國際標準 strict-iso8601 (YYYY-MM-DDTHH:MM:SS)
date_format=us
預設格式為美國標準。
第七十三部分:P1.PL檔案檔案位置
# P1.PL FILE LOCATION
# This value determines where the p1.pl perl script (used by the
# embedded Perl interpreter) is located. If you didn't compile
# Nagios with embedded Perl support, this option has no effect.
這個值決定了p1.pl perl指令碼的路徑位置。如果你沒有配合使用perl編譯的話,那麼這個選項將無效。
p1_file=/usr/bin/p1.pl
第七十四部分:非法物件命名字元
# ILLEGAL OBJECT NAME CHARACTERS
# This option allows you to specify illegal characters that cannot
# be used in host names, service descriptions, or names of other
# object types.
在這個選項裡定義了哪些字元將不能使用在主機名、服務描述或者其他物件型別當中。
illegal_object_name_chars=`~!$%^&*|'"<>?,()=
預設已經列出了一些非法命名字元。
第七十五部分:非法宏輸出字元
# ILLEGAL MACRO OUTPUT CHARACTERS
# This option allows you to specify illegal characters that are
# stripped from macros before being used in notifications, event
# handlers, etc. This DOES NOT affect macros used in service or
# host check commands.
# The following macros are stripped of the characters you specify:
# $HOSTOUTPUT$
# $HOSTPERFDATA$
# $HOSTACKAUTHOR$
# $HOSTACKCOMMENT$
# $SERVICEOUTPUT$
# $SERVICEPERFDATA$
# $SERVICEACKAUTHOR$
# $SERVICEACKCOMMENT$
這個選項裡定義了哪些字元將不能作為宏的輸出字元。以下的這些宏將受到該選項配置的影響:
$HOSTOUTPUT$
$HOSTPERFDATA$
$HOSTACKAUTHOR$
$HOSTACKCOMMENT$
$SERVICEOUTPUT$
$SERVICEPERFDATA$
$SERVICEACKAUTHOR$
$SERVICEACKCOMMENT$
illegal_macro_output_chars=`~$&|'"<>
預設已經列出了一些非法命名字元。
第七十六部分:正規表示式匹配
# REGULAR EXPRESSION MATCHING
# This option controls whether or not regular expression matching
# takes place in the object config files. Regular expression
# matching is used to match host, hostgroup, service, and service
# group names/descriptions in some fields of various object types.
# Values: 1 = enable regexp matching, 0 = disable regexp matching
這個選項控制了表示式在物件配置檔案中是否會發生表示式的匹配。正規表示式用來在一些欄位中匹配主機、主機組、服務、服務組的命名/描述。值1表示啟用正規表示式匹配功能,值0表示關閉。
use_regexp_matching=0
預設關閉正規表示式的匹配功能。
第七十七部分:真值正規表示式匹配
# "TRUE" REGULAR EXPRESSION MATCHING
# This option controls whether or not "true" regular expression
# matching takes place in the object config files. This option
# only has an effect if regular expression matching is enabled
# (see above). If this option is DISABLED, regular expression
# matching only occurs if a string contains wildcard characters
# (* and ?). If the option is ENABLED, regexp matching occurs
# all the time (which can be annoying).
# Values: 1 = enable true matching, 0 = disable true matching
這個選項控制了在物件配置檔案中是否會發生值為“真”的正規表示式的匹配。這個選項僅僅在啟正規表示式匹配功能的前提下有效。如果這個選項被關閉了,那麼正則表送達式匹配將僅發生在一個字串包含通配字元(“*”和“?”)的情況下了。如果這個選項被啟用了,那麼正規表示式匹配將會在任何情況下發生了(這可能會引起一些不希望發生的問題)。
use_true_regexp_matching=0
預設情況下真值的正規表示式匹配功能是關閉的。
第七十八部分:管理員電子郵件地址
# ADMINISTRATOR EMAIL ADDRESS
# The email address of the administrator of *this* machine (the one
# doing the monitoring). Nagios never uses this value itself, but
# you can access this value by using the $ADMINEMAIL$ macro in your
# notification commands.
指定管理員的郵件地址
admin_email=nagios
預設情況下該項值為nagios。
第七十九部分:管理員聯絡地址
# ADMINISTRATOR PAGER NUMBER/ADDRESS
# The pager number/address for the administrator of *this* machine.
# Nagios never uses this value itself, but you can access this
# value by using the $ADMINPAGER$ macro in your notification
# commands.
設定管理員的聯絡地址
admin_pager=pagenagios
預設下該項值為pagenagios
第八十部分:守護程式核心轉儲
# DAEMON CORE DUMP OPTION
# This option determines whether or not Nagios is allowed to create
# a core dump when it runs as a daemon. Note that it is generally
# considered bad form to allow this, but it may be useful for
# debugging purposes.
# Values: 1 - Allow core dumps
# 0 - Do not allow core dumps (default)
這個選項決定了當Nagios作為一個守護程式執行的時候,是否允許建立一個核心轉儲。注意通常情況下啟用這個選項被認為是一種不優的方式,但是它可能對診斷排錯帶來幫助。值1表示允許核心轉儲,值0表示不允許核心轉儲,預設情況下是關閉的。
daemon_dumps_core=0
預設情況下不允許核心轉儲。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29500582/viewspace-1279528/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Nagios伺服器端配置檔案詳解(2)iOS伺服器
- nagios配置過程詳解iOS
- redis 配置檔案詳解Redis
- haproxy配置檔案詳解
- redis配置檔案詳解Redis
- SSH配置檔案詳解
- zookeeper配置檔案詳解
- nginx配置檔案詳解Nginx
- WCF配置檔案詳解
- Nginx的配置檔案詳解Nginx
- vim的配置檔案詳解
- Hibernate配置檔案詳解
- BIND配置檔案詳解(三)
- Spring 配置檔案詳解Spring
- vsftpd配置檔案詳解FTP
- spring配置檔案詳解Spring
- 開發nagios修改配置檔案平臺iOS
- Nginx 配置檔案引數詳解Nginx
- 屬性配置檔案詳解(2)
- Docker Compose 配置檔案詳解Docker
- MyBatis--主配置檔案詳解MyBatis
- influx詳解(二):配置檔案UX
- Struts配置檔案詳細講解
- redis配置檔案引數詳解Redis
- 做nagios分散式需要修改的配置檔案iOS分散式
- Mysql配置檔案my.ini配置項詳解MySql
- MyBatis 核心配置檔案詳細內容詳解MyBatis
- linux的啟動配置檔案inittab檔案詳解Linux
- PHP配置檔案詳解php.iniPHP
- nginx.conf 配置檔案詳解Nginx
- Tomcat 的 Server 檔案配置詳解!!!TomcatServer
- linux網路卡配置檔案詳解Linux
- Python之ini配置檔案詳解Python
- git config配置檔案詳解Git
- Maven pom.xml檔案配置詳解MavenXML
- MySQL 配置檔案 (my.ini) 詳解MySql
- sysctl.conf檔案配置詳解
- compose配置檔案引數詳解