Nagios plug-in development guidelines(1)
本帖最后由monicazhang于2015-10-3021:25编辑20151030淡然
TableofContentsPreface1.Developmentplatformrequirements开发平台要求
2.PluginOutputforNagiosNagios插件输出2.1.Printonlyonelineoftext只输出一行文本2.2.Verboseoutput详细输出2.3.ScreenOutput屏幕输出2.4.PluginReturnCodesplugin返回代码2.5.Thresholdandranges阀值和区间2.6.Performancedata性能数据2.7.Translations翻译
3.SystemCommandsandAuxiliaryFiles系统命令和附录文件3.1.Don'texecutesystemcommandswithoutspecifyingtheirfullpath不指定完整路径的情况下请不要执行系统命令3.2.Usespopen()ifexternalcommandsmustbeexecuted使用spopen()执行外部命令3.3.Don'tmaketempfilesunlessabsolutelyrequired如果不是绝对需要不要创建临时文件3.4.Don'tbetrickedintofollowingsymlinks不要被下面的符号连接欺骗3.5.Validateallinput验证所有输入
4.PerlPluginsPerl插件
5.RuntimeTimeouts运行时超时5.1.UseDEFAULT_SOCKET_TIMEOUT使用DEFAULT_SOCKET_TIMEOUT5.2.Addalarmstonetworkplugins添加报警到网络插件
6.PluginOptions插件选项6.1.OptionProcessing选项处理6.2.Pluginswithmorethanonetypeofthreshold,orwiththresholdranges有多个临界值或有临界值序列的插件
7.Testcases测试用例7.1.Testcasesforplugins插件测试用例7.2.TestingtheClibraryfunctions测试C库函数
8.Codingguidelines编码向导8.1.CcodingC编码8.2.Creditingsources认证源码8.3.CVScommentsCVS提交8.4.Translationsfordevelopers开发者翻译8.5.Translationsfortranslators翻译人员翻译
9.Submissionofnewpluginsandpatches提交新插件或补丁nagios安装9.1.Patches补丁9.2.Contributedplugins分发插件9.3.Newplugins新插件
ListofTables1.Verboseoutputlevels详细输出级别2.PluginReturnCodes插件返回代码3.Exampleranges系列实例4.Commandlineexamples命令行实例
PrefaceThepurposeofthisguidelinesistoprovideareferencefortheplug-indevelopersandencouragethestandarizationofthedifferentkindofplug-ins:C,shell,perl,python,etc.这个向导的目的是为插件开发者提供一个手册,并为不同类型插件(如:C,shell,perl,python等)提供一个标准。NagiosPlug-inDevelopmentGuidelinesCopyright(C)2000-2009(NagiosPluginsTeam)Permissionisgrantedtomakeanddistributeverbatimcopiesofthismanualprovidedthecopyrightnoticeandthispermissionnoticearepreservedonallcopies.Thepluginsthemselvesarecopyrightedbytheirrespectiveauthors.插件的版权归开发者个人。开源监控软件
TableofContents1.Developmentplatformrequirements2.PluginOutputforNagios2.1.Printonlyonelineoftext2.2.Verboseoutput2.3.ScreenOutput2.4.PluginReturnCodes2.5.Thresholdandranges2.6.Performancedata2.7.Translations
3.SystemCommandsandAuxiliaryFiles3.1.Don'texecutesystemcommandswithoutspecifyingtheirfullpathnagios配置3.2.Usespopen()ifexternalcommandsmustbeexecuted3.3.Don'tmaketempfilesunlessabsolutelyrequired3.4.Don'tbetrickedintofollowingsymlinks3.5.Validateallinput
4.PerlPlugins
5.RuntimeTimeouts5.1.UseDEFAULT_SOCKET_TIMEOUT5.2.Addalarmstonetworkplugins
6.PluginOptions6.1.OptionProcessing6.2.Pluginswithmorethanonetypeofthreshold,orwiththresholdranges监控软件
7.Testcases7.1.Testcasesforplugins7.2.TestingtheClibraryfunctions
8.Codingguidelines8.1.Ccoding8.2.Creditingsources8.3.CVScomments8.4.Translationsfordevelopers8.5.Translationsfortranslators
9.Submissionofnewpluginsandpatches9.1.Patches9.2.Contributedplugins9.3.Newplugins
1.DevelopmentplatformrequirementsNagiospluginsaredevelopedtotheGNUstandard,soanyOSwhichissupportedbyGNUshouldruntheplugins.WhiletherequirementsforcompilingtheNagiospluginsreleaseareverybasic,developingfromtheGitrepositoryrequiresadditionalsoftwaretobeinstalled.Thesearetheminimumlevelsofsoftwarerequired:下面是最基本软件环境要求:nagios实施GNUmake3.79
GNUautomake1.9.2
GNUautoconf2.59
GNUm41.4.2
GNUlibtool1.5TocompilefromGit,afteryouhaveclonedtherepository,run:从Git编译,从库中复制了代码后,运行以下命令:tools/setup
./configurenagios培训
make
makeinstall
待续:http://www.ITILxf.com/thread-53033-1-1.html
本帖关键字:Nagios
页:
[1]