Nagios plug-in development guidelines(1)
20151030淡然
TableofContents
1.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_TIMEOUT
5.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新插件
ListofTables
1.Verboseoutputlevels详细输出级别
2.PluginReturnCodes插件返回代码
3.Exampleranges系列实例
4.Commandlineexamples命令行实例
Preface
Thepurposeofthisguidelinesistoprovideareferencefortheplug-indevelopersandencouragethestandarizationofthedifferentkindofplug-ins:C,shell,perl,python,etc.这个向导的目的是为插件开发者提供一个手册,并为不同类型插件(如:C,shell,perl,python等)提供一个标准。
NagiosPlug-inDevelopmentGuidelinesCopyright(C)2000-2009(NagiosPluginsTeam)
Permissionisgrantedtomakeanddistributeverbatimcopiesofthismanualprovidedthecopyrightnoticeandthispermissionnoticearepreservedonallcopies.
Thepluginsthemselvesarecopyrightedbytheirrespectiveauthors.插件的版权归开发者个人。开源监控软件
TableofContents
2.2.Verboseoutput
2.3.ScreenOutput
2.6.Performancedata
2.7.Translations
3.5.Validateallinput
6.1.OptionProcessing
8.1.Ccoding
8.2.Creditingsources
8.3.CVScomments
9.1.Patches
9.3.Newplugins
1.Developmentplatformrequirements
NagiospluginsaredevelopedtotheGNUstandard,soanyOSwhichissupportedbyGNUshouldruntheplugins.WhiletherequirementsforcompilingtheNagiospluginsreleaseareverybasic,developingfromtheGitrepositoryrequiresadditionalsoftwaretobeinstalled.Thesearetheminimumlevelsofsoftwarerequired:下面是最基本软件环境要求:nagios实施
GNUmake3.79
GNUautomake1.9.2 GNUautoconf2.59 GNUm41.4.2 GNUlibtool1.5
GNUautomake1.9.2 GNUautoconf2.59 GNUm41.4.2 GNUlibtool1.5
TocompilefromGit,afteryouhaveclonedtherepository,run:从Git编译,从库中复制了代码后,运行以下命令:
tools/setup
./configurenagios培训 make makeinstall
./configurenagios培训 make makeinstall
待续:
本帖关键字:Nagios
本帖关键字:Nagios