导出zabbix监控数据
mysql -u zabbix -p -h 127.0.0.1 zabbix -e "select h.name, 100-AVG(hi.value_avg) from hosts h join items i on h.hostid=i.hostid join trends_uint hi on i.itemid=hi.itemid where h.status=0 and i.key_='vm.memory.free.[percent]' and hi.clock >= 1535731200 and hi.clock <= 1538352000 group by h.name;" | awk '{print $1",",$2}' > /tmp/linux_memory.csv
mysql -u zabbix -p -h 127.0.0.1 zabbix -e "select h.name, 100-AVG(hi.value_avg) from hosts h join items i on h.hostid=i.hostid join trends hi on i.itemid=hi.itemid where h.status=0 and i.key_='system.cpu.util[,idle]' and hi.clock >= 1535731200 and hi.clock <= 1538352000 group by h.name;" | awk '{print $1",",$2}' > /tmp/linux_cpu.csv
mysql -u zabbix -p -h 127.0.0.1 zabbix -e "select h.name, AVG(hi.value_avg) from hosts h join items i on h.hostid=i.hostid join trends hi on i.itemid=hi.itemid where h.status=0 and i.name='Cpu use percent' and hi.clock >= 1535731200 and hi.clock <= 1538352000 group by h.name;" | awk '{print $1",",$2}' > /tmp/windows_cpu.csv
mysql -u zabbix -p -h 127.0.0.1 zabbix -e "select h.name, AVG(hi.value_avg) from hosts h join items i on h.hostid=i.hostid join trends_uint hi on i.itemid=hi.itemid where h.status=0 and i.name='Used memory percent' and hi.clock >= 1535731200 and hi.clock <= 1538352000 group by h.name;" | awk '{print $1",",$2}' > /tmp/windows_memory.csv
http://tool.chinaz.com/Tools/unixtime.aspx
导出zabbix监控数据的更多相关文章
- Grafana展示zabbix监控数据
一.安装步骤 (1)进入官网选择合适的操作系统版本下载Grafana:https://grafana.com/grafana/download?platform=linux [root@zabbix- ...
- 项目上使用的每月1日自动导出Zabbix性能数据的python脚本
基于zabbix-manager python2.7 #!/usr/bin/env python # -*- coding: utf-8 -*- # __author__ = "life&q ...
- python导出zabbix数据并发邮件脚本
Zabbix没有报表导出的功能,于是通过编写脚本导出zabbix数据并发邮件.效果如下: 下面是脚本,可根据自己的具体情况修改: #!/usr/bin/python #coding:utf-8 imp ...
- [ python3 ] 基于zabbix 自动抓取每天监控数据
通过python登录到zabbix直接抓取每天的数据的图片趋势图,并制作成静态index.html给与展示并发送提示邮件. 操作系统:Centos6.7 python版本:python3.5 #!/u ...
- Zabbix监控实现跨区域跨网络监控数据
Zabbix监控实现跨区域跨网络监控数据 环境: 公司现有服务器10台,其中5台服务器有一台安装了zabbix,并且这5台服务器处于一个网络,只有一台服务器有公网ip, 另外的5台处于另一个网络,仅有 ...
- zabbix监控系统的应用---数据监控、导入模板、告警
一.zabbix监控nginx服务 1)在server2中安装nginx服务 ---> rpm -ivh nginx-1.8.0-1.el6.ngx.x86_64.rpm 2)编辑配置文件 ...
- 跟着ttlsa一起学zabbix监控呗
本章转载至:http://www.ttlsa.com/zabbix/follow-ttlsa-to-study-zabbix/ 虽然接触zabbix时间很长,但是中间相当一段时间没去配置,这次算是重新 ...
- Zabbix的数据表结构
看到Zabbix的数据表结构吧,就知道数据量大了 性能问题很让人担忧,不过基于Zabbix数据库导出报表,或自动跑报表的时候,就必须去了解一下zabbix的数据表结构了,得知道XX放在哪才能找到XX, ...
- 第4章Zabbix监控实践
p.MsoNormal,li.MsoNormal,div.MsoNormal { margin: 0cm; margin-bottom: .0001pt; text-align: justify; t ...
随机推荐
- Windows迁移打印机与打印队列
移动打印机时,打印机当前所在服务器为源服务器,打印机将迁移到的服务器为目的服务器. 步骤: 1.为源服务器创建打印机配置文件 printbrm -b -s Servername -f SaveFile ...
- June 30th. 2018, Week 26th. Saturday
Curiosity is the wick in the candle of learning. 如果学习是一根蜡烛,那好奇心就是烛芯. From William Arthur Ward. Pleas ...
- ios的跨站脚本限制
概述 项目中碰到一个问题,就是在ios机上,用iframe内嵌的网页有时需要登录,有时候又不需要登录.查找了半天,终于发现是ios的跨站脚本限制导致的.这里就来介绍下跨站脚本限制,供以后开发时参考,相 ...
- 2. CMake 系列 - 编译多文件项目
目录 1. 编译不使用第三方库的项目 1.1 项目目录结构 1.2 相关代码 1.3 编译 2. 编译使用第三方库的项目 2.1 项目目录结构 2.2 相关代码 2.3 编译 1. 编译不使用第三方库 ...
- 老毛桃pe安装系统
1.准备一个空白U盘,插入电脑. 2.下载老毛桃pe 3.下载完成后,打开老毛桃,默认制作成系统盘,傻瓜操作,无需修改参数 4.打开浏览器,下载要安装的系统 www.msdn.itellyou.cn ...
- RecyclerSwipeAdapterDemo【使用AndroidSwipeLayout用于列表项侧滑功能】
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 记录AndroidSwipeLayout搭配Recyclerview实现列表项侧滑功能. 效果图 代码分析 适配器类中设置Swipe ...
- Python:游戏:扫雷(附源码)
这次我们基于 pygame 来做一个扫雷,上次有园友问我代码的 python 版本,我说明一下,我所有的代码都是基于 python 3.6 的. 先看截图,仿照 XP 上的扫雷做的,感觉 XP 上的样 ...
- .NET Core 2.2 新增部分功能使用尝鲜
前言 美国当地时间12月4日,微软2019开发者大会中发布了一系列的重磅消息,包含了软硬件和开源社区的各种好消息是铺天盖地,作为一名普通的开发者,我第一时间下载了 .NET Core 2.2 ...
- winform中使用委托进行窗体之间的传值
一.传统的方式 创建一个公共数据资源类,用于存储窗体2的TextBox的值: public class ComValue { public static string Txtvalue { get; ...
- [转]How to: Create a Report Server Database (Reporting Services Configuration)
本文转自:https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/ms157300%28v%3dsql.10 ...