Actions
配置action
点击configuration(配置)->Actions(报警)->选择事件来源

type Of calculation:各种条件之间的关系,包含AND、OR 以及AND/OR,如上图是AND关系,同时要满足以上机器不在维护状态以及触发器值为PROBLEM才会触发报警的动作。
概述
如果想接收到告警,需要配置actions
Actions 支持如下事件:
-
Trigger events - 触发器状态由OK变为PROBLEM,或从PROBLEM到OK
-
Discovery events - 网络自动发现
-
Auto registration events - 新客户端自动注册进来
-
Internal events - 当items变为unsupported,或触发器变为unknown 状态
配置action
点击configuration(配置)->Actions(报警)->选择事件来源
| Parameter | Description |
|---|---|
| Name | 唯一action 名字 |
| Default subject | 报警的默认标题 |
| Default message | 报警默认消息 |
| Recovery message | 是否在问题解决后发送消息 |
| Recovery subject | 恢复的标题 |
| Recovery message | 恢复的消息 |
| Enabled | 是否启用Action |
配置Conditions
| Condition type | Supported operators | Description |
|---|---|---|
| Application | = like not like |
限定application = 名字与application中的名字完全一致 like - 名字包含 not like - 名字不包含 |
| Host group | = <> |
Host是否属于一个Host group = - event belongs to this host group. <> - event does not belong to this host group. |
| Template | = <> |
Trigger是否属于一个Template = - event belongs to a trigger inherited from this template. <> - event does not belong to a trigger inherited from this template. |
| Host | = <> |
Host是否是某一个Template = - event belongs to this host. <> - event does not belong to this host. |
| Trigger | = <> |
触发的trigger是否是某一个Trigger = - event is generated by this trigger. <> - event is generated by any other trigger, except this one. |
| Trigger name | like not like |
Trigger名字是否和一个字符串匹配 like - event is generated by a trigger, containing this string in the name. Case sensitive. not like - this string cannot be found in the trigger name. Case sensitive. Note: Entered value will be compared to trigger name with all macros expanded. |
| Trigger severity | = <> >= <= |
Trigger的严重等级范围 = - equal to trigger severity <> - not equal to trigger severity >= - more or equal to trigger severity <= - less or equal to trigger severity |
| Trigger value | = | Trigger是OK还是PROBLEM = - equal to trigger value (OK or PROBLEM) |
| Time period | in not in |
Event生成的时间是否属于某一个范围 in - event time is within the time period. not in - event time is not within the time period. See Time period specification page for description of the format. |
| Maintenance status | in not in |
Host是否在Maintenance状态,如果Trigger中有多个Host,至少其中一个是(或者不是)Maintenace状态 in - host is in maintenance mode. not in - host is not in maintenance mode. Note: If several hosts are involved in the trigger expression, the condition matches if at least one of the hosts is/is not in maintenance mode. |
type Of calculation:各种条件之间的关系,包含AND、OR 以及AND/OR,如上图是AND关系,同时要满足以上机器不在维护状态以及触发器值为PROBLEM才会触发报警的动作。
配置Operation
概述
你可以定义下面Action触发以后具体的操作:
发送一条消息
执行一条远程命令(包括IPMI)
对于discovery事件,还有一些额外操作:
1.添加一台host
2.删除一台host
3.启用一个host
4.禁用一个host
5.(host)添加到一个host group
6.(host)从一个Host group中删除
7.关联到一个Template
8.取消和一个Template的关联
对于auto-registration events事件,也有额外的一些操作:
1)添加一个Host
2)禁用一个Host
3)添加到一个Host group
4)关联到一个Template
配置一个operation
| Parameter | Description | |
|---|---|---|
| Default operation step duration | 最小60秒,例如,设置了1小时,则表明执行了一个操作,要等待一个小时,才会执行下一个操作 |
|
| Action operations | Steps - 报警升级的时候,会按照step的顺序来执行 Details - 操作类型和目标。从zabbix2.2开始,会显示在发送信息时的medial type(e-mail,SMS,Jabber,etc)用户的名字也会显示。 Start in - 在event发生后多久执行 Duration (sec) - 显示的是step的持续时间,如果step使用了默认的'持续时间',那么显示default Action - 显示的是两个标签"edit","remove",用来编辑和移除operation的操作 |
|
| Operation details | |
|
| step |
在escalation的过程中的执行计划 From - 从哪一步执行开始 To - 到哪一步执行结束 (0=无穷, 执行将不被限制) Step duration - 每一步持续时间 (0=使用上面默认的). 可以在同一个步骤中,进行多个操作,如果这些操作有多个duration,那么会选择最短的那个生效 |
|
| Operation type | 有如下2种: Send message - 给用户发送信息 Remote command - 执行远程命令 对于discovery事件和auto-registration事件,可以在这里选择更多的操作 |
| Operation type: send message | |
|---|---|
| Send to user groups | 可以添加选择User groups |
| Send to users | 添加选择用户 |
| Send only to | 发送的消息是定义好的media type |
| Default message | 如果选择,默认消息格式将被使用 |
| Subject | Subject of the custom message. The subject may contain macros. |
| Message | The custom message. The message may contain macros. |
| Operation type: remote command | |
| Target list | Select current host, other hosts or host groups as targets to execute the command on. |
| Type | Select the command type: IPMI - execute an IPMI command Custom script - execute a custom set of commands. You can select to execute the command on Zabbix agent or Zabbix server. SSH - execute an SSH command Telnet - execute a Telnet command Global script - execute one of the global scripts defined in Administration→Scripts. |
| Commands | Enter the command(s). |
| Conditions | Condition for performing the operation: Not ack - only when the event is unacknowledged Ack - only when the event is acknowledged. |
转载于:https://my.oschina.net/davehe/blog/407983