第二章:配置nagios 及配置文件关系说明 html
Nagios的主配置文件为/usr/local/nagios/etc/nagios.cfg
本文对主配置文件里的重要变量作一些简单说明
2.1.1 对象配置文件
格式:cfg_file=<file_name>样例:
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
如添加一个新的主机配置 linuxtone.cfg
cfg_file=/usr/local/nagios/etc/linuxtone.cfg
2.1.2 nagios用户及组
nagios_user=nagios
nagios_group=nagios
2.1.3 通知选项
Enable_notifications=1
该选项决定了Nagios在初始化启动或重启动时是否要送出通知。若是这个选项不使能,Nagios将不会向任何主机或服务送出通知。注意,若是你打开了状态保持选项,Nagios在其启动和重启时将忽略此设置并用这个选项的最近的一个设置(已经保存在状态保持文件)的值来工做,除非你取消了use_retained_program_state 选项。若是你想在使能状态保存选项(而且是use_retained_program_state 使能)的状况下更改这个选项,你必需要经过合适的外部命令 或是经过Web接口来修改它。选项的取值能够是:
0 = 关闭通知
1 = 打开通知(默认)
本文不一一列举。详细请查询:
http://nagios‐cn.sourceforge.net/nagios‐cn/configuration.html#configmain
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg //联系人/组配置文件
cfg_file=/usr/local/nagios/etc/objects/localhost.cfg //本机配置文件
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg //监视时段配置文件
cfg_file=/usr/local/nagios/etc/objects/commands.cfg //监视脚本配置
cfg_file=/usr/local/nagios/etc/objects/templates.cfg //监视服务,报警配置
cfg_file=/usr/local/nagios/etc/objects/switch.cfg //监视路由
cfg_file=/usr/local/nagios/etc/objects/windows.cfg //监视微软