Nagios的設定檔在Nagios安裝和配置時顯得尤為重要,讓我們來具體的看看他的內容!
圖-Nagios
主設定檔[--prefix/nagios/etc/nagios.cfg]:
- # NAGIOS.CFG - Sample Main Config File for Nagios 3.0.6
-
- # Read the documentation for more information on this configuration
-
- # file. I've provided some comments here, but things may not be so
-
- # clear without further explanation.
-
- # Last Modified: 10-15-2008
-
# 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!!!
-
# 這個變數用於設定Nagios在何處建立其記錄檔。
# 它應該是你主設定檔裡面的第一個變數,當Nagios找到你設定檔並發現配置裡有錯誤時會向該檔案中寫入錯誤資訊。
# 如果你使能了日誌復原,Nagios將在每小時、每天、每周或每月對日誌進行復原。
log_file=/usr/local/nagios/var/nagios.log
# OBJECT CONFIGURATION FILE(S)
# 對象的設定檔
- # These are the object configuration files in which you define hosts,
-
- # host groups, contacts, contact groups, services, etc.
-
- # You can split your object definitions across several config files
-
- # if you wish (as shown below), or keep them all in a single config file.
-
# 該變數用於指定一個包含有將用於Nagios監控對象的對象設定檔。
# 對象設定檔中包括有主機、主機群組、連絡人、連絡人群組、服務、命令等等對象的定義。
# 配置資訊可以切分為多個檔案並且用cfg_file=語句來指向每個待處理的設定檔
# You can specify individual object config files as shown below:
# 您可以指定單個對象的設定檔, 如下所示:
- cfg_file=/usr/local/nagios/etc/objects/commands.cfg
-
- cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
-
- cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
-
- cfg_file=/usr/local/nagios/etc/objects/templates.cfg
-
- # Definitions for monitoring the local (Linux) host
-
# 定義監測本地( Linux )主機
- cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
-
- # Definitions for monitoring a Windows machine
-
# 定義監測( windows )主機
- #cfg_file=/usr/local/nagios/etc/objects/windows.cfg
-
- # Definitions for monitoring a router/switch
-
# 定義監測路由器或交換器
- #cfg_file=/usr/local/nagios/etc/objects/switch.cfg
-
- # Definitions for monitoring a network printer
-