Nagios 配置文件解析(1)
Nagios 配置文件解析(1)
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
评论暂时关闭