Version: zabbix 3.0.1

概述

Low-Level discovery 可以自动创建items,triggers,graphs为不同的实体对象。

例如:zabbix能自动监控服务器上的所有文件系统,网路接口。而不用手动在每个文件系统,网络接口上创建items。

除此之外,也可以根据discovery返回的结果,配置zabbix移除不需要的实体对象

zabbix支持六种不同的discovery items

  discovery of file systems;
  discovery of network interfaces;
  discovery of CPUs and CPU cores;
  discovery of SNMP OIDs;
  discovery using ODBC SQL queries;
  discovery of Windows services.

用户也可以自定义discovery,通过独有的JSON协议

  1、用户定义discovery脚本

    返回宏变量  例如:{#DEVICENAME} -> sda,{#DEVICENAME} -> sdb

  2、创建prototypes

    例如:custom.vfs.dev.io.active[{#DEVICENAME}]

以下是一般的自定义discovery处理结构

  首先,创建discovery rule在”Configuration” → “Templates” → “Discovery“列

  (discovery rule的组成(1)发现实体对象(列如:文件系统,网络接口) (2)prototypes:在之前发现的实体对象上创建items,triggers,graphs)

(1)

属性说明

Discovery rule

  Keep lost resources period (in days)  # 数据保留的天数

Filter

  对返回的数据进行过滤筛选,支持regexp

(2)

lld-disks.py;chmod +x lld-disks.py

#!/usr/bin/env python

'''
zabbix disks Low-Level discovery
''' import os
import re
import json def Devices(diskdir, skippable): raw_devices = (device for device in os.listdir(diskdir) if not any(ignore in device for ignore in skippable))
devices = (device for device in raw_devices if re.match(r'^\w{3}$', device)) # 保留整块磁盘 去掉分区, such as remove sda1 sdb2
data = [{"{#DEVICENAME}": device} for device in devices]
print(json.dumps({"data": data}, indent=)) if __name__ == "__main__":
# Iterate over all block devices, but ignore them if they are in the skippable set
diskdir = "/sys/class/block"
skippable = ("sr", "loop", "ram", "dm")
Devices(diskdir, skippable)

response  # json格式

{
"data": [
{
"{#DEVICENAME}": "sdb"
},
{
"{#DEVICENAME}": "sda"
}
]
}

Zabbix low-level discovery的更多相关文章

  1. zabbix监控redis多实例(low level discovery)

    对于多实例部署的tomcat.redis等应用,可以利用zabbix的low level discovery功能来实现监控,减少重复操作.  注:Zabbix版本: Zabbix 3.0.2 一.服务 ...

  2. Zabbix监控Low level discovery实时监控网站URL状态

    今天我们来聊一聊Low level discovery这个功能,我们为什么要用到loe level discovery这个功能呢? 很多时候,在使用zabbix监控一些东西,需要对类似于Itens进行 ...

  3. zabbix(10)自动发现规则(low level discovery)

    1.概念 在配置Iterms的过程中,有时候需要对类似的Iterms进行添加,这些Iterms具有共同的特征,表现为某些特定的参数是变量,而其他设置都是一样的,例如:一个程序有多个端口,而需要对端口配 ...

  4. Solr实现Low Level查询解析(QParser)

    Solr实现Low Level查询解析(QParser) Solr基于Lucene提供了方便的查询解析和搜索服务器的功能,可以以插件的方式集成,非常容易的扩展我们自己需要的查询解析方式.其中,Solr ...

  5. C++ Low level performance optimize 2

    C++ Low level performance optimize 2 上一篇 文章讨论了一些底层代码的优化技巧,本文继续讨论一些相关的内容. 首先,上一篇文章讨论cache missing的重要性 ...

  6. C++ Low level performance optimize

    C++ Low level performance optimize 1.  May I have 1 bit ? 下面两段代码,哪一个占用空间更少,那个速度更快?思考10秒再继续往下看:) //v1 ...

  7. 使用Java Low Level REST Client操作elasticsearch

    Java REST客户端有两种风格: Java低级别REST客户端(Java Low Level REST Client,以后都简称低级客户端算了,难得码字):Elasticsearch的官方low- ...

  8. ChibiOS/RT 2.6.9 CAN Low Level Driver for STM32

    /* ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio Licensed under the Apache License, Version 2 ...

  9. Consumer设计-high/low Level Consumer

    1 Producer和Consumer的数据推送拉取方式   Producer Producer通过主动Push的方式将消息发布到Broker n Consumer Consumer通过Pull从Br ...

  10. Elasticsearch java api操作(一)(Java Low Level Rest Client)

    一.说明: 一.Elasticsearch提供了两个JAVA REST Client版本: 1.java low level rest client: 低级别的rest客户端,通过http与集群交互, ...

随机推荐

  1. C#字符串默认值

    using System; class MYTestX { class CT { } class CO { public CT ott; //默认是null public string strx;// ...

  2. jQuery学习笔记(三):选择器总结

    这一节详细的总结jQuery选择器. 一.基础选择器 $('#info'); // 选择id为info的元素,id为document中是唯一的,因此可以通过该选择器获取唯一的指定元素$('.infoC ...

  3. Node基础:url查询参数解析之querystring

    模块概述 在nodejs中,提供了querystring这个模块,用来做url查询参数的解析,使用非常简单. 模块总共有四个方法,绝大部分时,我们只会用到 .parse(). .stringify() ...

  4. MVC————扩展方法MvcHtmlString

    使用前: public static class MyHtmlHelper { public static string GroupPage(this HtmlHelper helper) { str ...

  5. PLSQL Developer不支持Oracle 64位客户端解决方法

    问题描述: 在虚拟机同网段,搭建Oracle 11.2.04数据库64位的,本机操作系统Win10 x64和PLSQL 9.03,目前想利用PLSQL远程登录ORACLE数据库操作.当初用 insta ...

  6. canvas三角函数做椭圆运动效果

    <canvas id="canvas" width="800" height="400" style="background ...

  7. Java--剑指offer(9)

    41.输出所有和为S的连续正数序列.序列内按照从小至大的顺序,序列间按照开始数字从小到大的顺序 import java.util.ArrayList; public class Solution { ...

  8. android时区

    <timezones>    <timezone id="Pacific/Majuro">马朱罗</timezone>    <timez ...

  9. JavaMelody监控SQL

    前言 前面讲过了Javamelody的基本配置,这里简单的介绍下,如何使用Javamelody来监控JDBC以及SQL. 手码不易,转载请注明:xingoo 在网上搜索很多资料,仅有开源社区上的两篇帖 ...

  10. 了解ASP.NET MVC几种ActionResult的本质:JavaScriptResult & JsonResult

    在之前的两篇文章(<EmptyResult & ContentResult>和<FileResult>)我们剖析了EmptyResult.ContentResult和F ...