Nagios plug-in开发

 得到怎么写Nagios plug-in的信息: http://sourceforge.net/projects/nagiosplug/
开发指导: http://nagiosplug.sourceforge.net/developer-guidelines.html

2.5. Threshold and ranges
A threshold is a range with an alert level (either warning or critical). Use the set_thresholds(thresholds *, char *, char *) function to set the thresholds.
The theory is that the plugin will do some sort of check which returns back a numerical value, or metric, which is then compared to the warning and critical thresholds. Use the get_status(double, thresholds *) function to compare the value against the thresholds.
ranges的格式如下:
[@]start:end
注:
1.start≤end;
2.当start=0时start和‘:‘不是必须的;
3.如果range的格式是“start:”,并且end未指定,默认end为无穷大;
4.使用“~”表示负无穷大;
5.当返回值不在range范围内时将会发出警告;
6.默认range是包含边界值的,使用@将使其不包含边界值。(即:使用@可使其在边界值时也发出警告)。

2.6. Performance data
格式:
'label'=value[UOM];[warn];[crit];[min];[max]
注:
1.label/value对以空格分隔;
2.label可包含任意字符;
3.label两边的单引号是可选的;当label中包含符号(空格,=,‘)时,必须有单引号;
4.label的长度是任意的,理想值是前19个字符不要相同。
5.用两个单引号表示一个单引号;
6.warn,crit,min,max可以为null,结尾的分号可以省略;
7.当UOM=%时,min和max不是必需的;
8.value,min和max必须使用相同的UOM;
9.warn和crit在相同的range中,必须使用相同的UOM;
10.UOM(unit of measurement)度量单位是下列值的一种:
 (a).没有单位,假想的一个数字(比如用户,进程等);
 (b).s - 秒(也可以是us,ms);
 (c).% - 百分比;
 (d).B - 比特(也可以是KB,MB,TB);
 (e).c - 计数器;

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值