详解Nagios的主配置文件下Word文档格式.docx
《详解Nagios的主配置文件下Word文档格式.docx》由会员分享,可在线阅读,更多相关《详解Nagios的主配置文件下Word文档格式.docx(16页珍藏版)》请在冰点文库上搜索。
#RETAINSTATEINFORMATION
#ThissettingdetermineswhetherornotNagioswillsavestate
#informationforservicesandhostsbeforeitshutsdown.
Upon
#startupNagioswillreloadallsavedserviceandhoststate
#informationbeforestartingtomonitor.
Thisisusefulfor
#maintaininglong-termdataonstatestatistics,etc,butwill
#slowNagiosdownabitwhenit(re)starts.
Sinceitsonly
#aone-timepenalty,Ithinkitswellworththeadditional
#startupdelay.
这个设定决定了Nagios是否在Nagios自己关闭前为服务和主机保存状态信息。
紧接在Nagios启动之后,Nagios将在开始进行检测工作前重新载入之前保存的服务和主机的状态信息。
这将对维护长期状态监测数据统计等工作有利。
但是这个设定也会略微造成Nagios启动缓慢的效果。
由于这种影响是一时性的,因此有开启的必要。
retain_state_information=1
默认保持状态信息功能是开启的。
第四十二部分:
状态保留文件
#STATERETENTIONFILE
#ThisisthefilethatNagiosshouldusetostorehostand
#servicestateinformationbeforeitshutsdown.
Thestate
#informationinthisfileisalsoreadimmediatelypriorto
#startingtomonitorthenetworkwhenNagiosisrestarted.
#Thisfileisusedonlyifthepreserve_state_information
#variableissetto1.
这个文件将保留Nagios关闭前记录的主机和服务的状态信息。
而这个文件也将是当Nagios再次启动后立即读取的文件。
这个选项仅仅在保持状态信息功能开启时才有效。
state_retention_file=/var/log/nagios/retention.dat
设定状态保留文件路径。
第四十三部分:
保留状态数据更新间隔
#RETENTIONDATAUPDATEINTERVAL
#Thissettingdetermineshowoften(inminutes)thatNagios
#willautomaticallysaveretentiondataduringnormaloperation.
#Ifyousetthisvalueto0,Nagioswillnotsaveretention
#dataatregularinterval,butitwillstillsaveretention
#databeforeshuttingdownorrestarting.
Ifyouhavedisabled
#stateretention,thisoptionhasnoeffect.
这个设定决定Nagios将多频繁地在正常工作过程中自动保存状态数据。
如果设定值0的话,那么Nagios将在正常间隔中不保存数据,但是它仍然会在关闭或重启前对主机和服务状态做一次保存。
如果关闭了保持状态信息功能的话,那么这个选项将无效。
retention_update_interval=60
默认保存状态数据间隔是60秒。
第四十四部分:
使用保留程序状态
#USERETAINEDPROGRAMSTATE
#ThissettingdetermineswhetherornotNagioswillset
#programstatusvariablesbasedonthevaluessavedinthe
#retentionfile.
Ifyouwanttouseretainedprogramstatus
#information,setthisvalueto1.
Ifnot,setthisvalue
#to0.
这个设定决定了Nagios是否将程序的状态设定为基于上次保留的状态。
如果使用保留的程序状态的话,那么设定值1,不启用则设定值0。
use_retained_program_state=1
默认是启用保留程序状态。
第四十五部分:
使用保留调度信息
#USERETAINEDSCHEDULINGINFO
#ThissettingdetermineswhetherornotNagioswillretain
#theschedulinginfo(nextchecktime)forhostsandservices
#basedonthevaluessavedintheretentionfile.
Ifyou
#Ifyouwanttouseretainedschedulinginfo,setthis
#valueto1.
Ifnot,setthisvalueto0.
这个设定决定了Nagios是否保留将在下一个主机和服务的检测时间里使用上次保留的调度。
如果启用保留调度信息的话设定值1,不启用为0。
use_retained_scheduling_info=0
默认不启用保留调度信息。
第四十六部分:
间隔长度
#INTERVALLENGTH
#Thisisthesecondsperunitintervalasusedinthe
#host/contact/serviceconfigurationfiles.
Settingthisto60means
#thateachintervalisoneminutelong(60seconds).
Othersettings
#havenotbeentestedmuch,soyourmileageislikelytovary…
这是个以秒为单位,被用在主机/服务配置文件中。
设定这个值为60意味着每个间隔将会是一分钟的长度。
interval_length=60
默认时间间隔长度是60秒。
第四十七部分:
强行主机检测选项
#AGGRESSIVEHOSTCHECKINGOPTION
#Ifyoudon’twanttoturnonaggressivehostcheckingfeatures,set
#thisvalueto0(thedefault).
Otherwisesetthisvalueto1to
#enabletheaggressivecheckoption.
Readthedocsformoreinfo
#onwhataggressivehostcheckisorcheckoutthesourcecodein
#base/checks.c
如果不想启用强行主机检测特性的话,设定该配置项值为0。
否则设定该项值为1来启用强行主机检测选项。
如果想更多了解关于强行主机检测功能的话请阅读base/checks.c的源代码或相关手册。
use_aggressive_host_checking=0
默认是不启用强制主机检测特性的。
第四十八部分:
服务检测执行选项
#SERVICECHECKEXECUTIONOPTION
#ThisdetermineswhetherornotNagioswillactivelyexecute
#servicecheckswhenitinitiallystarts.
Ifthisoptionis
#disabled,checksarenotactivelymade,butNagioscanstill
#receiveandprocesspassivecheckresultsthatcomein.
Unless
#you’reimplementingredundanthostsorhaveaspecialneedfor
#disablingtheexecutionofservicechecks,leavethisenabled!
#Values:
1=enablechecks,0=disablechecks
这个设定决定了Nagios在启动初始的时候是否将主动地执行服务检测。
如果这个选项被关闭了,监测将不会主动进行,但是Nagios会仍然接收和处理被动检测的结果。
除非正在执行冗余主机或者有一个特殊的理由需要关闭服务检测的执行,否则应该让这个配置项保持启用。
值1表示启用检测,值0表示关闭监测。
execute_service_checks=1
默认下服务检测是启用的。
第四十九部分:
被动服务检测接受选项
#PASSIVESERVICECHECKACCEPTANCEOPTION
#ThisdetermineswhetherornotNagioswillacceptpassive
#servicechecksresultswhenitinitially(re)starts.
1=acceptpassivechecks,0=rejectpassivechecks
这个设定决定了Nagios在启动或者重启时,是否将接受被动服务检测的结果。
值1表示接受被动检测,值0表示拒绝被动检测。
accept_passive_service_checks=1
默认是启用被动服务检测功能的。
第五十部分:
主机检测执行选项。
#HOSTCHECKEXECUTIONOPTION
#hostcheckswhenitinitiallystarts.
#disablingtheexecutionofhostchecks,leavethisenabled!
这个设定决定了Nagios在启动初始的时候是否将主动地执行主机检测。
execute_host_checks=1
默认下启用主机检测功能的。
第五十一部分:
被动主机检测接受选项
#PASSIVEHOSTCHECKACCEPTANCEOPTION
#hostchecksresultswhenitinitially(re)starts.
这个设定决定了Nagios在启动或者重启时,是否将接受被动主机检测的结果。
accept_passive_host_checks=1
默认下是启用被动主机检测功能的。
第五十二部分:
通知选项
#NOTIFICATIONSOPTION
#ThisdetermineswhetherornotNagioswillsentoutanyhostor
#servicenotificationswhenitisinitially(re)started.
1=enablenotifications,0=disablenotifications
这个设定将决定当Nagios启动或者重启时是否发送出任何主机或服务的通知。
值1表示启用通知,值0表示关闭通知。
enable_notifications=1
默认是启用通知。
第五十三部分:
事件处理程序使用选项
#EVENTHANDLERUSEOPTION
#ThisdetermineswhetherornotNagioswillrunanyhostor
#serviceeventhandlerswhenitisinitially(re)started.
#you’reimplementingredundanthosts,leavethisoptionenabled.
1=enableeventhandlers,0=disableeventhandlers
这个设定将决定当Nagios启动或者重启时是否运行任何主机或者服务的事件处理程序。
除非在执行冗余主机或者有特殊的理由,否则请务必开启此功能。
值1表示开启事件处理程序,值0表示关闭事件处理程序。
enable_event_handlers=1
默认启用事件处理程序。
第五十四部分:
处理性能数据选项
#PROCESSPERFORMANCEDATAOPTION
#ThisdetermineswhetherornotNagioswillprocessperformance
#datareturnedfromserviceandhostchecks.
#enabled,hostperformancedatawillbeprocessedusingthe
#host_perfdata_command(definedbelow)andserviceperformance
#datawillbeprocessedusingtheservice_perfdata_command(also
#definedbelow).
ReadtheHTMLdocsformoreinformationon
#performancedata.
1=processperformancedata,0=donotprocessperformancedata
这个选项将决定Nagios是否处理从服务和主机检测当中返回的性能数据。
如果这个选项被启用了,那么主机性能数据将通过host_perfdata_command中定义的方式进行处理,并且服务性能数据也将通过service_perfdata_command中定义的方式进行处理。
设定值1表示处理性能数据,值0表示不处理性能数据。
process_performance_data=0
默认不对性能数据进行处理。
第五十五部分:
主机和服务性能数据处理命令
#HOSTANDSERVICEPERFORMANCEDATAPROCESSINGCOMMANDS
#Thesecommandsarerunaftereveryhostandservicecheckis
#performed.
Thesecommandsareexecutedonlyifthe
#enable_performance_dataoption(above)issetto1.
Thecommand
#argumentistheshortnameofacommanddefinitionthatyou
#defineinyourhostconfigurationfile.
ReadtheHTMLdocsfor
#moreinformationonperformancedata.
这些命令在每个主机和服务检测被执行的时候运行。
这些命令仅仅当enable_performance_data选项置1的时候才会被执行。
这个命令的参数则是在主机配置文件中定义的简写名。
#host_perfdata_command=process-host-perfdata
#service_perfdata_command=process-service-perfdata
默认这里是空的。
第五十六部分:
主机和服务性能数据文件
#HOSTANDSERVICEPERFORMANCEDATAFILES
#Thesefilesareusedtostorehostandserviceperformancedata.
#Performancedataisonlywrittentothesefilesifthe
#enable_performance_dataoption(above)issetto1.
这些文件被用来保存主机和服务性能的数据。
如果enable_performance_data项设定值1的话,性能数据将能写入到这些文件当中。
#host_perfdata_file=/tmp/host-perfdata
#service_perfdata_file=/tmp/service-perfdata
默认注释掉性能数据文件的路径。
第五十七部分:
主机和服务性能数据文件模版
#HOSTANDSERVICEPERFORMANCEDATAFILETEMPLATES
#Theseoptionsdeterminewhatdataiswritten(andhow)tothe
#performancedatafiles.
Thetemplatesmaycontainmacros,special
#characters(\tfortab,\rforcarriagereturn,\nfornewline)
#andplaintext.
Anewlineisautomaticallyaddedaftereachwrite
#totheperformancedatafile.
Someexamplesofwhatyoucandoare
#shownbelow.
这些选项决定了数据文件当中将记录什么样的数据。
模版可以包含宏、指定字符(\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$
第五十八部分:
主机和服务性能数据文件模式
#HOSTANDSERVICEPERFORMANCEDATAFILEMODES
#Thisoptiondetermineswhetherornotthehostandservice
#performancedatafilesareopenedinwrite(“w”)orappend(“a”)
#mode.
Unlessyouarethefilesarenamedpipes,youwillprobably
#wanttousethedefaultmodeofappend(“a”).
这