登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

伊人诚类的情感世界

~为理想插上翅膀^_^让语言轻舞飞扬~

 
 
 

日志

 
 

MRTG配置参数(高级篇)  

2009-06-30 14:18:40|  分类: 《MRTG》 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

 

Threshold checking

 

Through its threshold checking functionality mrtg is able to detect threshold problems for the various targets and can call external scripts to handle those problems (e.g. send email or a page to an administrator).

 

# 注释 :MRTG 还有一个功能就是针对 threshold 的监测。

 

# 当 MRTG 监测到超过 threshold 时,就调用外部脚本来处理(例如发送 mail 或者 page )

 

Threshold checking is configured through the following parameters:

 

# 注释 :MRTG 的 threshold checking 是通过以下参数来实现的 :

 

ThreshDir (GLOBAL)

By defining ThreshDir to point to a writable directory, MRTG will only alert you when a threshold boundery has been crossed.

Example:

 

# 注释 :ThreshDir (全局)定义一个 mrtg 可写的目录,MRTG 会在该目录下记录超过 threshold 的告警记录


 

 

ThreshDir: /var/mrtg/thresh

 

ThreshMinI (PER TARGET)

This is the minimum acceptable value for the Input (first) parameter. If the parameter falls below this value, the program specified in ThreshProgI will be run. If the value ends in '%' then the threshold is defined relative to MaxBytes.

 

# 注释 :ThresMinI 设置某个 Target 的最小输入 threshold 。

 

# 假如低于某个值,则调用 ThresPorgI 选项指定的脚本

 

# 如果 ThresMinI 的值是以 "%" 结尾,则认为是 MaxBytes 的百分之几

 

ThreshMaxI (PER TARGET)

This is the maximum acceptable value for the Input (first) parameter. If the parameter falls above this value, the program specified in ThreshProgI will be run. If the value ends in '%' then the threshold is defined relative to MaxBytes.

 

# 注释 :ThresMaxI 表示输入数据的最大 threshold。如果超过该值,同样调用 ThreshProgI 。

 

# 同样也可以定义为 "<n>%" 的形式

 

 

ThreshDesc (PER TARGET)

Its value will be assigned to the environment variable THRESH_DESC before any of the programs mentioned below are called. The programms can use the value of this variable to produce more user-friendly output.

 

# 注释 :ThreshDesc 是为某个 Target 的 Threshold 定义的描述信息。

 

# 在调用 ThreshProgI 前,会把该选项定义的内容赋予变量 "$THRESH_DESC"

 

# 这样 ThreshProgI 可以输出比较详细、友好的告警信息


 

 

ThreshProgI (PER TARGET)

This defines a program to be run if ThreshMinI or ThreshMaxI is broken. MRTG passes 3 arguments: the $router variable, the threshold value broken, and the current parameter value.

 

# 注释 :ThreshProgI 定义一个脚本,当达到或者超过 ThreshMinI 或者 ThreshMaxI 时,就调用该脚本

 

# MRTG 会传递3个变量给这个脚本 :$router 也就是 Target 的名称、ThreshMinI 或者 ThreshMaxI 的值、当期 Target 的值


 

 

ThreshProgOKI (PER TARGET)

This defines a program to be run if the parameter is currently OK (based on ThreshMinI and ThreshMaxI), but wasn't OK on the previous running -- based on the files found in ThreshDir. MRTG passes 3 arguments: the $router variable the unbroken threshold value, and the current parameter value.

 

# 注释 :ThresProgOKI 用于定义一个脚本,该脚本在监测的 Target 恢复正常时被调用。

 

# MRTG 会传递3个值给该脚本, $router 、ThreshMinI 或者 ThreshMaxI、Target 的当前值


 

ThreshMinO, ThreshMaxO, ThreshProgO, and ThreshProgOKO

These work the same as their *I counterparts, except on the Output (second) parameter.

 

# 注释 :ThreshMinO、ThreshMaxO、ThreshProgO、ThreshProgOKO 和上面的输入方面的选项的作用类似
 

Note that you can use the SetEnv parameter explained above to pass additional information to the threshold programs.

 

SetEnv

When calling threshold scripts from within your cfg file you might want to pass some data on to the script. This can be done with the SetEnv configuration option which takes a series of environment variable assignments. Note that the quotes are mandatory. This does not work for external scripts. It is not possible to set environment variables per target.

 

# 注释 :当 MRTG 调用上面提到的脚本时,可以通过 SetEnv 再传递一些变量给脚本。

 

# 注释 :用 SetEnv 定义变量时,用 <name>="<value>" 的格式。要注意 " " 是必须的。多个变量的定义之间用空格来分隔。
 


 

Example:

SetEnv[myrouter]:  EMAIL=yinqingsong520@163.com

                   HOST=www.some_server.net

  评论这张
 
阅读(739)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018