Zabbix监控(五)

Host group --> Host --> Application --> Item --> Trigger (OK-->PROBLEM, trigger event) --> Action(Conditon+Operation(Send Message,Remote Command))

Send Message:
Media:
Email、SMS、Jabber、Script、EZ Texting

            给出具体实现:
User groups --> User (Media) 

    示例中:node2.smoke.com -- Traffic --> Inboud traffic, Outbound traffic --> trigger (inboud)

Zabbix常用术语:
Item Key
Escalation
Template
Web Scennario

Zabbix服务器进程:
housekeeper,alter,discoverer,httppoller,Poller,Pinger,db_config_syncer,timer,escaltor

Item key:
命名要求:只能使用字母、数字、下划线、点号、连接符
接受参数:system.cpu.load[<cpu>,<mode>], net.if.inboud[if,<mode>]

        注意:每个key背后都应该有一个命令或脚本来负责实现数据收集,此命令或脚本可调用传递给key的参数,调用方式为$1, $2,...

    在zabbix中定义item时调用某key,还需要额外定义数据采集频率、历史数据的保存时长等;

Trigger:
触发器表达式:{<Server>:<key>.<funcation>(<parameter>)}<operator><constant>

    {node2.smoke.com:net.if.in[eth0,bytes].last(#1)}> 1200

    <funcation>:评估采集到的数据是否在合理范围内时所使用的函数,其评估过程可以根据采集到的数据、当前时间或其他因素;
        avg, count, change, date, dayofweek, dayofmonth, delta, diff, iregexp, regexp, last, max, min, nodata, now, str, strlen, sum

                regexp:检查最近一次采样的数据是否能够被指定的模式所匹配,1表示匹配,0表示不匹配;
                now:返回自Unix元年此刺客经历的秒数;
                    prev:倒数第二个采样值;
                    str:从最后一次的采样中查找此处指定的子串;
                    strlen:

    <parameter>:
        >, <, =, #(不等于)
        /, =, -, +
            &, |

点击Monitoring -- Events,Group选择test group,Host选择node2,Source选择Trigger;
Zabbix监控(五)

node1:zabbix-server
[root@node1 ~]# mail
Heirloom Mail version 12.4 7/29/08. Type ? for help.
"/var/spool/mail/root": 4 messages 2 new 4 unread
U 1 [email protected] Mon Jul 1 11:07 29/908 "OK: Inboud traffic warning"
U 2 [email protected] Mon Jul 1 11:09 29/918 "PROBLEM: Inboud traffic warning"

N 3 [email protected] Tue Jul 2 20:49 28/908 "PROBLEM: Inboud traffic warning"
N 4 [email protected] Tue Jul 2 20:50 28/898 "OK: Inboud traffic warning"

猜你喜欢

转载自blog.51cto.com/smoke520/2416030