银行专用验钞机报价系统填钞间插座需不需要应急电源

Zabbix与RRDtool绘图篇之用ZabbixAPI取监控数据(2)
  return res[0]['graphs']  注意传入的参数是主机名而不是主机id,结果也是由字典组成的列表。  4、获取每张图的监控对象item  #可以返回完整信息rs,含有hostid  tmp = res[0]['items']  items = []  for value in tmp:  if '$' in value['name']:  name0 = value['key_'].split('[')[1].split(']')[0].replace(',', '')  name1 = value['name'].split()  if 'CPU' in name1:  name1.pop(-2)  name1.insert(1,name0)  else:  name1.pop()  name1.append(name0)  name = ' '.join(name1)  tmpitems =
{'itemid':value['itemid'],'delay':value['delay'],'units':value['units'],'name':name,'value_type':value['value_type'],'lastclock':value['lastclock'],'lastvalue':value['lastvalue']}  else:  tmpitems =
{'itemid':value['itemid'],'delay':value['delay'],'units':value['units'],'name':value['name'],'value_type':value['value_type'],'lastclock':value['lastclock'],'lastvalue':value['lastvalue']}  items.append(tmpitems)  return items  返回的数据已经包含了最新的一次监控数据的值和取值的时间戳,如果只需要取最新的监控数据,到这里其实就可以了,记得这次传入的参数是graphid。  5、根据itemid取得更多的监控数据  下面是取10条监控数据,可以任意更改参数获取更多的数据,全凭自己所需了。  ################################################################  #获取历史数据,history必须赋值正确的类型0,1,2,3,4 float,string,log,integer,text  def history_get(self, itemid, i):  data = /edu//json.dumps({  &jsonrPC&: &2.0&,  &method&: &history.get&,  &params&: { &output&: &extend&,  &history&: i,  &itemids&: itemid,  &sortfIEld&: &clock&,  &sortorder&: &DESC&,  &limit&: 10},  &auth&: self.authID,  &id&: 1})  res = self.get_data(data)['result']  return res  上面的所有代码加起来就是一个Zabbix取数据的类。取出来的数据可以用RRDtool绘图或做其它用途了python程序调用zabbix系统的api接口实现对zabbix_server端主机的增删改查,使用相关功能时候,需要打开脚本中的相关函数。
函数说明:
zabbixtools() &调用zabbix api
template_get() &获取zabbix &server端已经配置的模板信息
hostgroup_get() &获取已经添加的主机组列表信息
host_get() & 单个主机信息
host_del() &删除主机
host_create() &新建主机
get_grouphost() &获取某个组下面所有的主机信息
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 import json
4 import urllib2
5 import sys
6 class zabbixtools:
def __init__(self):
self.url = "http://x.x.x.x/zabbix/api_jsonrpc.php"
self.header = {"Content-Type": "application/json"}
self.authID = self.user_login()
def user_login(self):
data = json.dumps(
"jsonrpc": "2.0",
"method": "user.login",
"params": {
"user": "Admin",
"password": "xxxx"
request = urllib2.Request(self.url,data)
for key in self.header:
request.add_header(key,self.header[key])
result = urllib2.urlopen(request)
except URLError as e:
print "Auth Failed, Please Check Your Name And Password:",e.code
response = json.loads(result.read())
result.close()
authID = response['result']
return authID
def get_data(self,data,hostip=""):
request = urllib2.Request(self.url,data)
for key in self.header:
request.add_header(key,self.header[key])
result = urllib2.urlopen(request)
except URLError as e:
if hasattr(e, 'reason'):
print 'We failed to reach a server.'
print 'Reason: ', e.reason
elif hasattr(e, 'code'):
print 'The server could not fulfill the request.'
print 'Error code: ', e.code
response = json.loads(result.read())
result.close()
return response
def host_get(self,hostip):
#hostip = raw_input("\033[1;35;40m%s\033[0m" % 'Enter Your Check Host:Host_ip :')
data = json.dumps(
"jsonrpc": "2.0",
"method": "host.get",
"params": {
"output":["hostid","name","status","host"],
"filter": {"host": [hostip]}
"auth": self.authID,
res = self.get_data(data)['result']
if (res != 0) and (len(res) != 0):
#for host in res:
host = res[0]
if host['status'] == '1':
print "\t","\033[1;31;40m%s\033[0m" % "Host_IP:","\033[1;31;40m%s\033[0m" %host['host'].ljust(15),'\t',"\033[1;31;40m%s\033[0m" % "Host_Name:","\033[1;31;40m%s\033[0m"% host['name'].encode('GBK'),'\t',"\033[1;31;40m%s\033[0m" % u'unmonitor'.encode('GBK')
return host['hostid']
elif host['status'] == '0':
print "\t","\033[1;32;40m%s\033[0m" % "Host_IP:","\033[1;32;40m%s\033[0m" %host['host'].ljust(15),'\t',"\033[1;32;40m%s\033[0m" % "Host_Name:","\033[1;32;40m%s\033[0m"% host['name'].encode('GBK'),'\t',"\033[1;32;40m%s\033[0m" % u'monitor'.encode('GBK')
return host['hostid']
print '\t',"\033[1;31;40m%s\033[0m" % "Get Host Error or cannot find this host,please check !"
def get_grouphost(self):
groupid = raw_input("\033[1;35;40m%s\033[0m" % 'Enter Your groupid:')
data = json.dumps(
"jsonrpc":"2.0",
"method":"host.get",
"params":{
"output":["hostid","name","status","host"],
#"output": "extend",
"groupids":groupid,
"auth": self.authID,
res = self.get_data(data)
if 'result' in res.keys():
res = res['result']
if (res !=0) or (len(res) != 0):
print "\033[1;32;40m%s\033[0m" % "Number Of Hosts: ","\033[1;31;40m%d\033[0m" % len(res)
for host in res:
print "Host ID:",host['hostid'],"Visible name:",host['name'],"Host-status:",host['status'],"HostName:",host['host']
print "The groupid does not exist, please check!"
def host_del(self):
hostip = raw_input("\033[1;35;40m%s\033[0m" % 'Enter Your Check Host:Host_ip :')
hostid = self.host_get(hostip)
print hostid
if hostid == 0:
print '\t',"\033[1;31;40m%s\033[0m" % "This host cannot find in zabbix,please check it !"
sys.exit()
data = json.dumps(
"jsonrpc": "2.0",
"method": "host.delete",
"params": [hostid],
"auth": self.authID,
res = self.get_data(data)['result']
if 'hostids' in res.keys():
print "\t","\033[1;32;40m%s\033[0m" % "Delet Host:%s success !" % hostip
print "\t","\033[1;31;40m%s\033[0m" % "Delet Host:%s failure !" % hostip
def hostgroup_get(self):
data = json.dumps(
"jsonrpc": "2.0",
"method": "hostgroup.get",
"params": {
"output": "extend",
"auth": self.authID,
res = self.get_data(data)
if 'result' in res.keys():
res = res['result']
if (res !=0) or (len(res) != 0):
print "\033[1;32;40m%s\033[0m" % "Number Of Group: ","\033[1;31;40m%d\033[0m" % len(res)
for host in res:
print"\t","HostGroup_id:",host['groupid'],"\t","HostGroup_Name:",host['name'].encode('GBK')
print "Get HostGroup Error,please check !"
def template_get(self):
data = json.dumps(
"jsonrpc": "2.0",
"method": "template.get",
"params": {
"output": "extend",
"auth": self.authID,
res = self.get_data(data)#['result']
if 'result' in res.keys():
res = res['result']
if (res !=0) or (len(res) != 0):
print "\033[1;32;40m%s\033[0m" % "Number Of Template: ","\033[1;31;40m%d\033[0m" % len(res)
for host in res:
print"\t","Template_id:",host['templateid'],"\t","Template_Name:",host['name'].encode('GBK')
print "Get Template Error,please check !"
def host_create(self):
hostip = raw_input("\033[1;35;40m%s\033[0m" % 'Enter your:Host_ip :')
#Visible_name = raw_input("\033[1;35;40m%s\033[0m" % 'Enter your:Visible name :')
groupid = raw_input("\033[1;35;40m%s\033[0m" % 'Enter your:Group_id :')
templateid = raw_input("\033[1;35;40m%s\033[0m" % 'Enter your:Tempate_id :')
for i in groupid.split(','):
var['groupid'] = i
g_list.append(var)
for i in templateid.split(','):
var['templateid'] = i
t_list.append(var)
if hostip and groupid and templateid:
data = json.dumps(
"jsonrpc": "2.0",
"method": "host.create",
"params": {
"host": hostip,
"interfaces": [
"type": 1,
"main": 1,
"useip": 1,
"ip": hostip,
"dns": "",
"port": "10050"
"groups": g_list,
"templates": t_list,
"auth": self.authID,
res = self.get_data(data,hostip)
if 'result' in res.keys():
res = res['result']
if 'hostids' in res.keys():
print "\033[1;32;40m%s\033[0m" % "Create host success"
print "\033[1;31;40m%s\033[0m" % "Create host failure: %s" % res['error']['data']
print "\033[1;31;40m%s\033[0m" % "Enter Error: ip or groupid or tempateid is NULL,please check it !"
215 def main():
test = zabbixtools()
test.template_get()
test.hostgroup_get()
#test.host_get()
#test.host_del()
test.host_create()
#test.get_grouphost()
223 if __name__ == "__main__":
阅读(...) 评论()Perling_ 的BLOG
用户名:Perling_
访问量:44309
注册日期:
阅读量:5863
阅读量:12276
阅读量:369900
阅读量:1064428
51CTO推荐博文
& 现在越来越多的公司选择使用开源软件Zabbix来做服务器业务监控,其高逼格的用户管理是个亮点,所以可以通过调用它的接口将权限管理应用到很多地方,比如说堡垒机权限。以下是用python简单写了个小脚本,通过定义分组名便可以得到分组下的服务器信息。#coding=utf-8
__author__&=&'Perling'
from&urllib&import&urlencode
import&urllib2
import&json
def&post(post_data):
&&&&api_url&=&'/api_jsonrpc.php'&&&&#api&url
&&&&req&=&urllib2.Request(api_url,json.dumps(post_data))&
&&&&req.add_header("Content-Type","application/json")
&&&&resp&=&urllib2.urlopen(req)
&&&&re&=&json.loads(resp.read())
&&&&return&re
def&get_sessionid():
&&&&login_post_data&=&{"jsonrpc":&"2.0",
&&&&&&&&&&&&&&&&&&&&&&&"method":&"user.login",
&&&&&&&&&&&&&&&&&&&&&&&"params":&{"user":&"admin",
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"password":&"pass"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&},
&&&&&&&&&&&&&&&&&&&&&&&"id":&"1",
&&&&&&&&&&&&&&&&&&&&&&&}
&&&&re&=&post(login_post_data)
&&&&if&re.has_key("result"):
&&&&&&&&return&re["result"]
&&&&&&&&return&re
&&&&&&&&exit(1,"login_error")
def&hostget():
&&&&hostget_post_json&=&{
&&&&&&&&&&&&&&&&&&&&&&&&&&&&"jsonrpc":&"2.0",
&&&&&&&&&&&&&&&&&&&&&&&&&&&&"method":&"hostgroup.get",
&&&&&&&&&&&&&&&&&&&&&&&&&&&&"params":&{
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"output":&"extend",
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"filter":&{
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"name":&[
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"Zabbix&servers",&&##要获取主机列表的分组名称
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&]
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&},
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"selectHosts":&['hostid','host'],
&&&&&&&&&&&&&&&&&&&&&&&&&&&&},
&&&&&&&&&&&&&&&&&&&&&&&&&&&&"auth":&get_sessionid(),
&&&&&&&&&&&&&&&&&&&&&&&&&&&&"id":&1
&&&&return&post(hostget_post_json)
print&hostget()selectHosts字段是定义 选中分组下边的主机的信息显示选项 具体包括下边的内容PropertyTypeDescriptionhostidstring(readonly) ID of the host.host (required)stringTechnical name of the host.availableinteger(readonly) Availability of Zabbix agent. Possible values are:0 - (default)1 -2 - unavailable.disable_untiltimestamp(readonly) The next polling time of an unavailable Zabbix agent.errorstring(readonly) Error text if Zabbix agent is unavailable.errors_fromtimestamp(readonly) Time when Zabbix agent became unavailable.flagsinteger(readonly) Origin of the host. Possible values: 0 - 4 - a discovered host.ipmi_authtypeintegerIPMI authentication algorithm. Possible values are:-1 - (default) 0 - 1 - MD2; 2 - MD5 4 - 5 - OEM; 6 - RMCP+.ipmi_availableinteger(readonly) Availability of IPMI agent. Possible values are:0 - (default)1 -2 - unavailable.ipmi_disable_untiltimestamp(readonly) The next polling time of an unavailable IPMI agent.ipmi_errorstring(readonly) Error text if IPMI agent is unavailable.ipmi_errors_fromtimestamp(readonly) Time when IPMI agent became unavailable.ipmi_passwordstringIPMI password.ipmi_privilegeintegerIPMI privilege level. Possible values are:1 -2 - (default)3 -4 -5 - OEM.ipmi_usernamestringIPMI username.jmx_availableinteger(readonly) Availability of JMX agent. Possible values are:0 - (default)1 -2 - unavailable.jmx_disable_untiltimestamp(readonly) The next polling time of an unavailable JMX agent.jmx_errorstring(readonly) Error text if JMX agent is unavailable.jmx_errors_fromtimestamp(readonly) Time when JMX agent became unavailable.maintenance_fromtimestamp(readonly) Starting time of the effective maintenance.maintenance_statusinteger(readonly) Effective maintenance status. Possible values are:0 - (default)1 - maintenance in effect.maintenance_typeinteger(readonly) Effective maintenance type. Possible values are:0 - (default) maintenance 1 - maintenance without data collection.maintenanceidstring(readonly) ID of the maintenance that is currently in effect on the host.namestringVisible name of the host. &Default: host property value.proxy_hostidstringID of the proxy that is used to monitor the host.snmp_availableinteger(readonly) Availability of SNMP agent. Possible values are:0 - (default)1 -2 - unavailable.snmp_disable_untiltimestamp(readonly) The next polling time of an unavailable SNMP agent.snmp_errorstring(readonly) Error text if SNMP agent is unavailable.snmp_errors_fromtimestamp(readonly) Time when SNMP agent became unavailable.statusintegerStatus and function of the host. Possible values are:0 - (default)1 - unmonitored host.本文出自 “” 博客,请务必保留此出处
了这篇文章
类别:未分类┆阅读(0)┆评论(0)如何通过Zabbix获取监控数据?
##################################
zabbix基本架构
##################################
zabbix核心进程,轮询并捕获数据、发送通知等。是zabbix agent和zabbix proxy汇报数据的对象。server自身可远程检测网络服务。所有的前后端配置、统计信息、可操作数据存储于此。包含server、前段界面和后端DB几部分。
部署在被监控主机上用于监控本地资源和应用并向zabbix server汇报结果。使用本地系统调用故非常高效。有主动和被动两种检测模式。被动模式下agent根据server或proxy的具体请求来返回数据。主动模式下先主动由server获取监控项列表在检测并返回新的数据。采用主动或被动检测取决于相应监控项的配置。
可以自由选择部署或者不部署,主要用于分担server的负载。在集中化监控远程位置、分支、网络的场景中是很好的解决方案。可从被监控设备收集数据缓存在proxy本地后传递给其所属的zabbix server。proxy需要单独的。
4. gateway
java实现的守护进程用于监控JMX类型的应用程序。
命令行工具zabbix_sender,用于向zabbix server发送性能数据和可用性数据。多用于用户脚本定期向server发送数据。
shell& cd bin
shell& ./zabbix_sender -z zabbix -s & DB3& -k db.connections -o 43
命令行工具zabbix_get,用于同agent通信从agent获取数据。可用于zabbix agents的troubleshooting。
shell& cd bin
shell& ./zabbix_get -s 127.0.0.1 -p 10050 -k &system.cpu.load[all,avg1]&
####################################
#zabbix术语表
####################################
需要被监控的设备,如、、WEB服务器、DB服务器等
host group
被监控设备的逻辑分组,如DB服务器一组、WEB服务器一组等。可包含主机和模板。用于权限控制
需要被监控的项,如CPU空闲率、某一块磁盘的使用率等
用于评估收到的监控值是否超出设定的阈值的逻辑表达式
如trigger状态改变等值得注意的事件
预先定义的响应event的一系列operations
escalation
执行action中的operations的定制场景;一连串的发送通知、执行远程命令
传递notification的方式
notification
通过media发送给用户的关于某个event的消息
remote command
在被监控机器上触发并自动执行的预定义命令
用于简化和加速主机上大规模监控任务的部署。包含一系列项目,如items, triggers, graphs, screens, applications, low-level discovery rules
application
逻辑组中的一组items
web scenario
一个或多个HTTP request用以检查web站点可用性
zabbix的web界面
zabbix api
允许通过JSON RPC 协议创建、更新和获取zabbix对象如,hosts, items, graphs and others。或者执行其他任务
zabbix server
zabbix核心,履行监控,与zabbix proxies、zabbix client交互、计算trigger、发送notification、存储数据等任务
zabbix agent
部署在被监控主机上用于监控本地资源和应用
zabbix proxy
可代zabbix server收集数据分担处理负载
######################################
#zabbix配置
######################################
可通过WEB界面或者模板进行配置
需配置内容包括users、user groups、hosts、host groups、items、Triggers、Events、notification、templates、visualisation等。
最终配置会被存储在后端database中。
#####################################
zabbix取数方式
####################################
1.zabbix api
基于WEB的API,通过JSON PRC协议获取或更改zabbix配置,并可用于获取历史监控数据。clients和API间的request和response使用JSON格式。包含一系列可从功能上分为不同组别的方法。
发起HTTP请求的格式类似如下:
POST /zabbix/api_jsonrpc.php HTTP/1.1
Content-Type: application/json-rpc
{&jsonrpc&:&2.0&,&method&:&apiinfo.version&,&id&:1,&auth&:null,&params&:{}}
其中/zabbix/是zabbix前端的地址;Content-Type必须指明且为application/json-rpc, application/json or application/jsonrequest三者之一。{&jsonrpc&:&2.0&,&method&:&apiinfo.version&,&id&:1,&auth&:null,&params&:{}}是请求的具体内容。
一些实例:
&jsonrpc&: &2.0&,
&method&: &user.login&,
&params&: {
&user&: &Admin&,
&password&: &zabbix&
&auth&: null
jsonrpc:指明JSON-RPC协议版本,这里是2.0版本
method:指明调用的API方法,这里是用户登录
params:需要传递给API method的参数,这里是用户名和密码
id:本次请求的标识符
auth:用户认证令牌,目前尚无所以为null
若参数无误response将会包含用户认证令牌,如:
&jsonrpc&: &2.0&,
&result&: &d&,
*获取hosts信息
&jsonrpc&: &2.0&,
&method&: &host.get&,
&params&: {
&output&: [
&selectInterfaces&: [
&interfaceid&,
&auth&: &d&
本例使用可用的用户认证令牌通过host.get方法获取所配置的主机的ID 、name等信息,返回如下
&jsonrpc&: &2.0&,
&result&: [
&hostid&: &10084&,
&host&: &Zabbix server&,
&interfaces&: [
&interfaceid&: &1&,
&ip&: &127.0.0.1&
为了考虑性能影响、尽量仅列出所需项而非返回所有数据
*创建新监控项
例如在上一步获取的host上建立新的监控项、监控/home/joe/目录的剩余空间
&jsonrpc&: &2.0&,
&method&: &item.create&,
&params&: {
&name&: &Free disk space on $1&,
&key_&: &vfs.fs.size[/home/joe/,free]&,
&hostid&: &10084&,
&type&: 0,
&value_type&: 3,
&interfaceid&: &1&,
&delay&: 30
&auth&: &d&,
其中params参数中的几个关键参数含义如下:
name:监控项的名称,这个可以自己灵活定义,其中的$1代表key_中的第一个参数,此处为/home/joe/
key_:预定义的监控项,zabbix提供了一系列此类监控内容,此处需从其中进行选择。
hostid:即上步获得的hostid
value_type:监控数据值的类型,不同的数字代表不同的类型,此处的3代表整型
delay:zabbix取数时间间隔,此处为30秒取一次
返回结果如下:
&jsonrpc&: &2.0&,
&result&: {
&itemids&: [
itemid为生成的监控项的id
*获取历史数据:
从历史记录表获取itemids为23296的按clock降序排列的十条记录
history参数可能的取值
&jsonrpc&: &2.0&,
&method&: &history.get&,
&params&: {
&output&: &extend&,
&history&: 0,
&itemids&: &23296&,
&sortfield&: &clock&,
&sortorder&: &DESC&,
&limit&: 10
&auth&: &038e1d7b6ee9eae095879e&,
返回结果:
&jsonrpc&: &2.0&,
&result&: [
&itemid&: &23296&,
&clock&: &&,
&value&: &0.0850&,
&itemid&: &23296&,
&clock&: &&,
&value&: &0.1600&,
下例忘记了groups这个参数
&jsonrpc&: &2.0&,
&method&: &host.create&,
&params&: {
&host&: &Linux server&,
&interfaces&: [
&type&: 1,
&main&: 1,
&useip&: 1,
&ip&: &192.168.3.1&,
&dns&: &&,
&port&: &10050&
&auth&: &d&
返回结果如下,包含的不是result属性而是error属性
&jsonrpc&: &2.0&,
&error&: {
&code&: -32602,
&message&: &Invalid params.&,
&data&: &No groups for host \&Linux server\&.&
对于获取监控数据来说,比较关心的应该是history.get这个方法。这种方式实际上最终还是由后台数据库获取的。方法提供了丰富的参数,使用非常灵活。但对于一次性大规模的取出大量主机大量监控项的大批数据不太适合。
2.zabbix_get:
命令行工具,可从远程的zabbix agent获取数据
zabbix_get [-hV] [-s &host name or IP&] [-p &port number&] [-I &IP address&] [-k &item key&]
-s, --host &host name or IP&
-p, --port &port number&
-I, --source-address &IP address&
-k, --key &item key&
-h, --help
-V, --version.
如:zabbix_get -s 127.0.0.1 -p 10050 -k system.cpu.load[all,avg1]
zabbix api获取到的是数据库中的历史数据,zabbix_get可获得实时的数据。可根据工具的特点选择适合的场景。
3.zabbix databases:
直接由zabbix后台数据库获取历史数据。适用于一次性大规模的取出大量主机大量监控项的大批数据。
history系列表分别存储不同数据类型的历史数据
表中数据以update interval为时间间隔
zabbix.history -numeric(float)
zabbix.history_log -log
zabbix.history_str -character(up to 255 bytes)
zabbix.history_text -text
zabbix.history_unit -numeric(unsigned intergers)
trends_系列表存储不同类型的历史数据统计结果
表中数据以小时为时间间隔,存储每小时的最小、最大和平均值
zabbix.trends -numeric(float)
zabbix.trends_unit -numeric(unsigned intergers)
character\log\text\类型无历史统计结果
history系列的表只包含itemid、clock、value等数据
trends系列的表只包含itemid、clock、value_min、value_avg、value_max等数据
history、trends需与items、hosts、hosts_groups、groups表关联来获取item名称、host名称、组别等。
*表及重要的表字段
hosts.hostid 主机id
hosts.host 主机名
hosts.status 主机状态 0为正常监控,1为关闭,3表示是个Template,5尚不不清楚。
hosts_group
hosts_group.hostid 主机id
hosts_group.groupid 所属组id
groups.groupid 组id
groups.name 组名
items.itemid 监控项id
items.hostid 监控项所在主机id
items.name 监控项别名
items.key_ 监控项标准名称
items.value_type值类型
items.delay 取数时间间隔
items.history 历史表数据保留天数
items.trends 历史统计表数据保留天数
item.units 数据单位
items表中value_type与history的对应关系
(主要为了存取效率将不同值类型存在不同的history表中)
value_type history表
1 history_str
2 history_log
3 history_uint
4 history_text
hisrtory.itemid 监控项id
trends.itemid 监控项id
zabbix后台系统的涉及到大量的表,取历史数据的话关心这几个即可
*监控项规则解读
zabbix.items表中存在类似于如下的配置项(如网络网卡监控、磁盘监控等):
Free disk space on $1 vfs.fs.size[/,free]
Free disk space on / (percentage) vfs.fs.size[/,pfree]
Free disk space on $1 vfs.fs.size[/boot,free]
Free disk space on /boot (percentage) vfs.fs.size[/boot,pfree]
Free disk space on $1 vfs.fs.size[/data,free]
Free disk space on /data (percentage) vfs.fs.size[/data,pfree]
Free disk space on $1 vfs.fs.size[{#FSNAME},free]
Free disk space on {#FSNAME} (percentage) vfs.fs.size[{#FSNAME},pfree]
其中类似于如下的配置是zabbix提供的low level discovery配置方式,用于自动创建监控项适用于有多块磁盘、多个目录、多块网卡等类型情形下监控项的自动发现
可以把{#FSNAME}看做是模板可以匹配配置好的所有的相关项比如:
Free disk space on {#FSNAME} (percentage) vfs.fs.size[{#FSNAME},pfree]
Free disk space on /data (percentage) vfs.fs.size[/data,pfree]
Free disk space on /boot (percentage) vfs.fs.size[/boot,pfree]
Free disk space on / (percentage) vfs.fs.size[/,pfree]
类似的还有:
Incoming network traffic on $1 net.if.in[{#IFNAME}]
Outgoing network traffic on $1 net.if.out[{#IFNAME}]
IO.util.{#DISK_NAME} IO.util[{#DISK_NAME}]
而上边例子中的$1、$2等对应key_的参数位置,例如
Free disk space on $1 vfs.fs.size[/,free]
中$1就代表/ ,Free disk space on $1相当于Free disk space on /依次类推
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467142',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'

我要回帖

更多关于 中国银行现钞买入价 的文章

 

随机推荐