配置检测参数有几下方法

1. Creating manual checks instead of inventorized checks (using the variable checks).
2. Using the config variable check_parameters.
3. Setting check specific global default values.
4. using a check specific special configuration such as filesystem_levels.

manual check

在main.mk文件中配置条目.条目中的变量是list 或者tuple类型. 条目包括:Host specification,check type,check item,check parameter.
1. Host specification
checks = [
( "abc123", "df", "/var", (80.0, 90.0) ),
( "abc123", "df", "/tmp", (90.0, 95.0) ),
] # host list
checks = [
( ["abc123", "def456"], "df", "/var", (80.0, 90.0) ),
] # list of tags
all_hosts = [
"abc123|lnx",
"def456|lnx",
"xyz987|win",
] checks = [
( ["lnx"], ALL_HOSTS, "df", "/var", (80.0, 90.0) ),
] # all hosts
checks = [
( ALL_HOSTS, "df", "/var", (80.0, 90.0) ),
] 2. Check type
cmk -L 3. Check item
有些类型没有item,如mem,必须指定None
checks = [
( "abc123", "mem", None, (80.0, 120.0) ),
] #Table of check types
https://mathias-kettner.de/checkmk_checks.html 4. check parameter
有执行次序,后面的覆写前面的,如
checks = [
# All hosts with Tag 'lnx' get levels 10 and 20...
( ["lnx"], ALL_HOSTS, "cpu.loads", None, (10, 20) ), # ...but sv01 and sv02 get levels 5 and 10
( ["sv01", "sv01"], "cpu.loads", None, ( 5, 10) ),
]

处理方式

1. 假如定义了manual check,则不管其他方式定义的参数。
2. 假如inventory建立完check,使用rules方式定义参数有效。
3. 假如使用rules方式定义参数没有生效,下次的inventory可以设置参数。
4. 假如没有参数确定,将使用main.mk里的system wide default levels
5. 最后使用代码里的global default parameters

Rule based check parameters

Each entry in check_parameters is a tuple with up to four columns:
1. The check parameters to be set for the rule (e.g. warning and critical levels)
2. Optional: list of tags the hosts must have
3. List of hosts matched by the entry, or ALL_HOSTS
4. List of service patterns (regular expressions) that must match the beginning of the service name in question. check_parameters = [
# (1) Filesystem C: on winsrv02 gets levels (92, 96)
( (92, 96), [ "winsrv02" ], [ "fs_C:" ]), # (2) Filesystems on hosts with tag 'sap' and 'test' are always OK
( (101, 101), [ 'sap', 'test' ], ALL_HOSTS, [ "fs_"]), # (3) Levels for filesystems below /sap (also /saptrans, /saptest)
( (80, 95), ALL_HOSTS, [ "fs_/sap" ]), # (4) Levels for filesystems /var and /tmp on all hosts
( (90, 95), ALL_HOSTS, [ "fs_/var$", "fs_/tmp$" ] ), # (5) Set levels for all remaining file systems to 80% / 90%
( (80, 90), ALL_HOSTS, [ "fs_" ] ),
] # $表示未尾

check_mk 之 Check Parameters的更多相关文章

  1. Effective Java 38 Check parameters for validity

    For public methods, use the Javadoc @throws tag to document the exception that will be thrown if a r ...

  2. check_mk 之 Configuration variables

    Basic settings #check_parameters This is a configuration list assigning specific check parameters to ...

  3. check_MK安装部署(nagios4版本)

    概述: 操作系统版本:CentOS release 6.3 (Final) 64位 nagios版本:Nagios Core 4.0.6 pnp4nagios版本:pnp4nagios-0.6.22 ...

  4. [No0000A5]批处理常用命令大全

    1.Echo 命令打开回显或关闭请求回显功能,或显示消息.如果没有任何参数,echo 命令将显示当前回显设置.语法echo [{on|off}] [message]Sample: echo off e ...

  5. Effective Java Index

    Hi guys, I am happy to tell you that I am moving to the open source world. And Java is the 1st langu ...

  6. [转]学习Nop中Routes的使用

    本文转自:http://www.cnblogs.com/miku/archive/2012/09/27/2706276.html 1. 映射路由 大型MVC项目为了扩展性,可维护性不能像一般项目在Gl ...

  7. Giving Data Backup Option in Oracle Forms 6i

    Suppose you want to give the data backup option in Oracle Forms application to some client users, wh ...

  8. windows批处理

    1.日期作为变量当做文件名的一部分. C:\Documents and Settings\Simon>echo %date%2008-09-09 星期二 C:\Documents and Set ...

  9. Effective Java 64 Strive for failure atomicity

    Principle Failure atomic - A failed method invocation should leave the object in the state that it w ...

随机推荐

  1. Spring注解实现定时功能以及Quartz定时器

    一:Spring注解实现--------->Spring3.0以后自带的task,可以将它看成一个轻量级的Quartz 1:maven配置: <!-- quartz--> <d ...

  2. mysql 字段类型VARCHAR转换成DECIMAL

    在我们写代码的实际业务中,有时候实体类用的是String,数据库中自然是VARCHAR类型,但是如果这个实体的属性值放的是数字类型,你查询的时候又需要对它进行排序.sql怎么写呢. 别担心mysql提 ...

  3. java程序员的从0到1:@Resource与@Autowired的比较

    目录: 1.@Resource与@Autowired的源码分析 2.@Resource与@Autowired的相同点 3.@Resource与@Autowired的不同点 正文: 1.@Resourc ...

  4. Python语言、编译解释、动态库静态库、编译过程、头文件

    学习Python这门语言首先要了解 什么是编译与解释,什么是连接,什么是动态库与静态库, 什么是编译: 编译就是先把高级语言设计的程序翻译成二进制的机器语言,然后CPU直接执行机器码就可以了.一把翻译 ...

  5. 修改jupyter notebook的默认浏览器

    1.打开命令行 2.输入jupyter notebook --generate-config 3.显示出jupyter_notebook_config.py 文件所在的目录.按文件目录找到这个文件. ...

  6. python 元组拾遗

    python 元组拾遗 python 语法糖 def printall(*args):  return args  一个以 * 开头的参数将参数聚集为一个元组. printall函数可以接收任意个数的 ...

  7. Jenkins遇到哪些坑~

    1Jenkins关闭和重启实现方式. 1.关闭Jenkins ​ 只需要在访问jenkins服务器的网址url地址后加上exit.例如我jenkins的地址http://localhost:8080/ ...

  8. Mac 终端执行sql命令

    https://www.cnblogs.com/sbj-dawn/p/6905930.html. 远程登录MYSQL数据库 > mysql -u username -p -h hostname ...

  9. 【Java】Java中的Collections类——Java中升级版的数据结构【转】

    一般来说课本上的数据结构包括数组.单链表.堆栈.树.图.我这里所指的数据结构,是一个怎么表示一个对象的问题,有时候,单单一个变量声明不堪大用,比如int,String,double甚至一维数组.二维数 ...

  10. notepad++查看Log

    安装步骤:打开notepad++,插件→ Plugin Manager→ Show Plugin Manager→ Avaliable→ 等待插件列表刷新出来后,选中Android Logger插件→ ...