×

扫描二维码登录本站

QQ登录

只需一步,快速开始

标签: 暂无标签
20151030淡然
续上



Notes:
1.                                               start ≤ end
2.                                               start and ":" is not required if start=0 如果start=0则start 和":"不需要
3.                                               if range is of format "start:" and end is not specified, assume end is infinity 如果区间的格式为"start:"且没有指定end,则假定end为无限大
4.                                               to specify negative infinity, use "~" 指定负无限大使用 ~                            nagios安装
5.                                               alert is raised if metric is outside start and end range (inclusive of endpoints) 如果度量标准超出start或end区间(包括)报警发生
6.                                               if range starts with "@", then alert if inside this range (inclusive of endpoints) 如果区间以@开始,则当度量标准在区间内(包含)时报警发生
Note: Not all plugins are coded to expect ranges in this format yet. There will be some work in providing multiple metrics. 注意:使用这种格式,并非所有的插件都被编码为预期的区间。它需要一些工作来提供多个度量标准。

Table 3. Example ranges 区间实例
[td]
Range definition
Generate an alert if x...
10
< 0 or > 10, (outside the range of {0 .. 10}) 超出0-10区间                      开源监控软件
10:
< 10, (outside {10 .. ∞}) 超出10-∞区间
~:10
> 10, (outside the range of {-∞ .. 10}) 超出-∞ - 10区间
10:20
< 10 or > 20, (outside the range of {10 .. 20}) 超出10-20区间
@10:20
≥ 10 and ≤ 20, (inside the range of {10 .. 20}) 在10-20区间
10
< 0 or > 10, (outside the range of {0 .. 10}) 超出0-10区间

Table 4. Command line examples 命令行实例
[td]
Command line
Meaning
check_stuff -w10 -c20
Critical if "stuff" is over 20, else warn if over 10 (will be critical if "stuff" is less than 0)
如果stuff高于20则critical,否则如果超过10则warning(如果stuff低于0则critical)
check_stuff -w~:10 -c~:20
Same as above. Negative "stuff" is OK 同上,负stuff为正常值
check_stuff -w10: -c20
Critical if "stuff" is over 20, else warn if "stuff" is below 10 (will be critical if "stuff" is less than 0) 如果stuff高于20则critical,否则如果超过10则warning(如果stuff低于0则critical)
check_stuff -c1:
Critical if "stuff" is less than 1  如果stuff超过1则critical
check_stuff -w~:0 -c10
Critical if "stuff" is above 10; Warn if "stuff" is above zero
如果stuff高于10则critical,高于0则warning,负数为正常                        nagios配置
check_stuff -c5:6
The only noncritical range is 5:6 只有5-6区间为非critical
check_stuff -c10:20
Critical if "stuff" is 10 to 20 如果stuff为10-20则critical(似乎文档有误!)


2.6. Performance data性能数据
Performance data is defined by Nagios as "everything after the | of the plugin output" - please refer to Nagios documentation for information on capturing this data to logfiles. However, it is the responsibility of the plugin writer to ensure the performance data is in a "Nagios plugins" format. This is the expected format: 性能数据被Nagios定义为“| 之后的输出部分”—请参考Nagios文档信息来捕获这些数据到日志文件。不管怎样,插件编写人员的职责是,确保性能数据满足“Nagios插件”格式。下面是预期的格式:
'label'=value[UOM];[warn];[crit];[min];[max]
Notes:
1.                                               space separated list of label/value pairs 空格分隔label/value对
2.                                               label can contain any characters 其中label可以包含任意字符
3.                                               the single quotes for the label are optional. Required if spaces, = or ' are in the label 单引号可选。包含空格,等号或单引号时单引号为必须。
4.                                               label length is arbitrary, but ideally the first 19 characters are unique (due to a limitation in RRD). Be aware of a limitation in the amount of data that NRPE returns to Nagios 其中label的长度为任意的,但是比较理想的前19个字符应该是不重复的(由于RRD的限制)。须知NRPE返回给Nagios的数据的限制。
5.                                               to specify a quote character, use two single quotes 要指定一个单引号,使用两个单引号
6.                                               warn, crit, min or max may be null (for example, if the threshold is not defined or min and max do not apply). Trailing unfilled semicolons can be dropped 其中warn,crit,min,max也可为null(比如临界值没有被定义或者最小最大值没有被应用)。后面空的分号可以省略
7.                                               min and max are not required if UOM=% 其中minmax是不需要的,如果UOM为%
8.                                               value, min and max in class [-0-9.]. Must all be the same UOM  ??看不懂                       监控软件
9.                                               warn and crit are in the range format (see Section 2.5). Must be the same UOM
10.                                           UOM (unit of measurement) is one of:
a.                                                                        no unit specified - assume a number (int or float) of things (eg, users, processes, load averages)
b.                                                                       s - seconds (also us, ms)
c.                                                                        % - percentage
d.                                                                       B - bytes (also KB, MB, TB)
e.                                                                        c - a continous counter (such as bytes transmitted on an interface)
It is up to third party programs to convert the Nagios plugins performance data into graphs.


2.7. Translations
If possible, use translation tools for all output to respect the user's language settings. See Section 8.4 for guidelines for the core plugins.


3. System Commands and Auxiliary Files
3.1. Don't execute system commands without specifying their full path在没有指定完整路径的情况下不执行系统命令
Don't use exec(), popen(), etc. to execute external commands without explicity using the full path of the external program. 在没有明确指定一个外部程序的完整路径的情况下,不要使用exec(), popen()等函数来执行外部命令                 nagios培训
Doing otherwise makes the plugin vulnerable to hijacking by a trojan horse earlier in the search path. See the main plugin distribution for examples on how this is done. 否则会使得插件很脆弱而很容易被木马劫持。查看主插件分发实例,这些实例说明了这些是怎么发生的。

3.2. Use spopen() if external commands must be executed使用spopen(),如果外部命令必须执行
If you have to execute external commands from within your plugin and you're writing it in C, use the spopen() function that Karl DeBisschop has written. 如果你必须在你的插件内部执行外部命令,并且你是在用C写插件,使用Karl DeBisschop 编写的spopen()函数              nagios培训
The code for spopen() and spclose() is included with the core plugin distribution. 函数spopen()和spclose()的代码已经在核心插件发布中被包含。

3.3. Don't make temp files unless absolutely required如果不是绝对需要不要使用临时文件




待续:http://www.itilxf.com/thread-53035-1-1.html
本帖关键字:Nagios




上一篇:Nagios plug-in development guidelines(2)
下一篇:Nagios plug-in development guidelines(4)
monicazhang

写了 2297 篇文章,拥有财富 12859,被 21 人关注

您需要登录后才可以回帖 登录 | 立即注册
B Color Link Quote Code Smilies

成为第一个吐槽的人

手机版|小黑屋|最新100贴|论坛版块|ITIL先锋论坛 |粤ICP备11099876号|网站地图
Powered by Discuz! X3.4 Licensed  © 2001-2017 Comsenz Inc.
返回顶部