zabbix 后台数据库清除数据
alerts 表 problem 表 escalations 表 events 表 event_recovery表 对 这些表进行清除 防止不停发送邮件
-- alerts table rebuild.
-- ----------------------------
-- Table structure for alerts
-- ----------------------------
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `alerts`;
CREATE TABLE `alerts` (
`alertid` bigint(20) unsigned NOT NULL,
`actionid` bigint(20) unsigned NOT NULL,
`eventid` bigint(20) unsigned NOT NULL,
`userid` bigint(20) unsigned DEFAULT NULL,
`clock` int(11) NOT NULL DEFAULT '',
`mediatypeid` bigint(20) unsigned DEFAULT NULL,
`sendto` varchar(100) COLLATE utf8_bin NOT NULL DEFAULT '',
`subject` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
`message` text COLLATE utf8_bin NOT NULL,
`status` int(11) NOT NULL DEFAULT '',
`retries` int(11) NOT NULL DEFAULT '',
`error` varchar(2048) COLLATE utf8_bin NOT NULL DEFAULT '',
`esc_step` int(11) NOT NULL DEFAULT '',
`alerttype` int(11) NOT NULL DEFAULT '',
`p_eventid` bigint(20) unsigned DEFAULT NULL,
`acknowledgeid` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`alertid`),
KEY `alerts_1` (`actionid`),
KEY `alerts_2` (`clock`),
KEY `alerts_3` (`eventid`),
KEY `alerts_4` (`status`),
KEY `alerts_5` (`mediatypeid`),
KEY `alerts_6` (`userid`),
KEY `alerts_7` (`p_eventid`),
KEY `c_alerts_6` (`acknowledgeid`),
CONSTRAINT `c_alerts_1` FOREIGN KEY (`actionid`) REFERENCES `actions` (`actionid`) ON DELETE CASCADE,
CONSTRAINT `c_alerts_2` FOREIGN KEY (`eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE,
CONSTRAINT `c_alerts_3` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE,
CONSTRAINT `c_alerts_4` FOREIGN KEY (`mediatypeid`) REFERENCES `media_type` (`mediatypeid`) ON DELETE CASCADE,
CONSTRAINT `c_alerts_5` FOREIGN KEY (`p_eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE,
CONSTRAINT `c_alerts_6` FOREIGN KEY (`acknowledgeid`) REFERENCES `acknowledges` (`acknowledgeid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
SET FOREIGN_KEY_CHECKS=1; --------------------------------------------------------------------------------------------------------
-- problem table rebuild.
-- ----------------------------
-- Table structure for problem
-- ----------------------------
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `problem`;
CREATE TABLE `problem` (
`eventid` bigint(20) unsigned NOT NULL,
`source` int(11) NOT NULL DEFAULT '',
`object` int(11) NOT NULL DEFAULT '',
`objectid` bigint(20) unsigned NOT NULL DEFAULT '',
`clock` int(11) NOT NULL DEFAULT '',
`ns` int(11) NOT NULL DEFAULT '',
`r_eventid` bigint(20) unsigned DEFAULT NULL,
`r_clock` int(11) NOT NULL DEFAULT '',
`r_ns` int(11) NOT NULL DEFAULT '',
`correlationid` bigint(20) unsigned DEFAULT NULL,
`userid` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`eventid`),
KEY `problem_1` (`source`,`object`,`objectid`),
KEY `problem_2` (`r_clock`),
KEY `problem_3` (`r_eventid`),
CONSTRAINT `c_problem_1` FOREIGN KEY (`eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE,
CONSTRAINT `c_problem_2` FOREIGN KEY (`r_eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
SET FOREIGN_KEY_CHECKS=1; ------------------------------------------------------------------------------------------------------
-- escalations table rebuild
-- ------------------------------------
-- Table structure for escalations
---------------------------------------
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `escalations`;
CREATE TABLE `escalations` (
`escalationid` bigint(20) unsigned NOT NULL,
`actionid` bigint(20) unsigned NOT NULL,
`triggerid` bigint(20) unsigned DEFAULT NULL,
`eventid` bigint(20) unsigned DEFAULT NULL,
`r_eventid` bigint(20) unsigned DEFAULT NULL,
`nextcheck` int(11) NOT NULL DEFAULT '',
`esc_step` int(11) NOT NULL DEFAULT '',
`status` int(11) NOT NULL DEFAULT '',
`itemid` bigint(20) unsigned DEFAULT NULL,
`acknowledgeid` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`escalationid`),
UNIQUE KEY `escalations_1` (`actionid`,`triggerid`,`itemid`,`escalationid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
SET FOREIGN_KEY_CHECKS=1; ---------------------------------------------------------------------------------------------------
-- events table rebuild
-- ------------------------------------
-- Table structure for events
---------------------------------------
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `events`;
CREATE TABLE `events` (
`eventid` bigint(20) unsigned NOT NULL,
`source` int(11) NOT NULL DEFAULT '',
`object` int(11) NOT NULL DEFAULT '',
`objectid` bigint(20) unsigned NOT NULL DEFAULT '',
`clock` int(11) NOT NULL DEFAULT '',
`value` int(11) NOT NULL DEFAULT '',
`acknowledged` int(11) NOT NULL DEFAULT '',
`ns` int(11) NOT NULL DEFAULT '',
PRIMARY KEY (`eventid`),
KEY `events_1` (`source`,`object`,`objectid`,`clock`),
KEY `events_2` (`source`,`object`,`clock`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
SET FOREIGN_KEY_CHECKS=1; -----------------------------------------------------------------------------
-- event_recovery table rebuild
-- ------------------------------------
-- Table structure for event_recovery
---------------------------------------
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `event_recovery`;
CREATE TABLE `event_recovery` (
`eventid` bigint(20) unsigned NOT NULL,
`r_eventid` bigint(20) unsigned NOT NULL,
`c_eventid` bigint(20) unsigned DEFAULT NULL,
`correlationid` bigint(20) unsigned DEFAULT NULL,
`userid` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`eventid`),
KEY `event_recovery_1` (`r_eventid`),
KEY `event_recovery_2` (`c_eventid`),
CONSTRAINT `c_event_recovery_1` FOREIGN KEY (`eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE,
CONSTRAINT `c_event_recovery_2` FOREIGN KEY (`r_eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE,
CONSTRAINT `c_event_recovery_3` FOREIGN KEY (`c_eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
SET FOREIGN_KEY_CHECKS=1;
zabbix 后台数据库清除数据的更多相关文章
- Javaweb项目-下拉列表显示后台数据库的数据
下面将演示前端下拉列表显示后台数据库中class表的说有班级的名称 环境: Tomcat-8.5.40 mysql-8.0.13 eclipse-4.9.0 springmvc框架 一.从mysql中 ...
- AngularJS + Java---前台网页与后台数据库传递数据 基本结构
第一个关于这两种语言的项目,以下只是我自己的理解,欢迎指教:) 基本对应关系 1. controller .jsp(.html) ng-controller="controllerTest ...
- 转 zabbix 优化方法 以及 后台数据库查询方法 两则
############sample 1 https://blog.51cto.com/sfzhang88/1558254 如何从Zabbix数据库中获取监控数据 sfzhang关注6人评论40627 ...
- 利用ajax的方式来提交数据到后台数据库及交互功能
怎么样用ajax来提交数据到后台数据库,并完成交互呢????? 一.当我们在验证表单的时候,为了阻止把错误的也发送到服务器,我们通常这样设置: $(function(){ var ...
- EasyUI动态显示后台数据库中的数据
最近在完成一个项目,采用SSM框架搭建完成,前端使用EasyUI搭建页面: 其中涉及到一个查询显示功能:查询数据库中的数据,动态显示在页面之中,刚开始这部分十分有疑问,所以虚心向同学学习,现总结至博客 ...
- Kubernetes后台数据库etcd:安装部署etcd集群,数据备份与恢复
目录 一.系统环境 二.前言 三.etcd数据库 3.1 概述 四.安装部署etcd单节点 4.1 环境介绍 4.2 配置节点的基本环境 4.3 安装部署etcd单节点 4.4 使用客户端访问etcd ...
- Android实现多次闪退清除数据
背景 很多时候由于后台返回的数据异常,可能会导致App闪退.而如果这些异常数据被App本地缓存下来,那么即使杀掉进程重新进入还是会发生闪退.唯一的解决方法就是清除App数据,但是用户可能没有这个意识或 ...
- Android存储扩展学习-----应用的清除数据和清除缓存
前几天和朋友聊到了APP清除数据这块,聊到了清除数据都会清掉哪些数据,我们每个人的手机在”设置–>应用管理”里面,选择任意一个App,都会看到两个按钮,一个是清除缓存,另一个是清除数据,那么当我 ...
- 编译安装mysql和zabbix,xtrabackup数据库备份
xtrabackup参考文章 https://www.cnblogs.com/linuxk/p/9372990.html 下载5.7的mysql 社区版包 https://cdn.mysql.com/ ...
随机推荐
- Spring启动,constructor,@PostConstruct,afterPropertiesSet,onApplicationEvent执行顺序
package com.xx; import javax.annotation.PostConstruct; import javax.annotation.Resource; import org. ...
- 金融类openapi
股市URL解析 http://money.finance.sina.com.cn/moneyflow/?stockName=上证指数&symbol=sh000001&stockSymb ...
- Quick Start NodeMCU / ESP8266 12E
先说明一下:本来想买常见的ESP 8266作为Arduinoi的WIFI模块,结果错买成ESP 8266 12E,发现网上的资料比较少. ESP8266是WIFI芯片,它只是一块芯片必须要搭配相应的电 ...
- read函数和write函数
read 函数 inline int read() { ,f=; char c=getchar(); ; c=getchar();} +c-'; c=getchar();} return f*x; } ...
- SQL盲注学习-布尔型
本次实验还是使用sqli-labs环境.在开始SQL盲注之前首先学习一下盲注需要用到的基础语法. 1.left()函数:left(str,lenth)它返回具有指定长度的字符串的左边部分. left( ...
- 如何设置网站的robots.txt
做过网站优化的朋友都知道,搜索引擎蜘蛛爬行抓取网站时首先会去访问根目录下的robots.txt文件,如果robots文件存在,则会根据robots文件内设置的规则进行爬行抓取,如果文件不存在则会顺着首 ...
- Spark 部署即提交模式意义解析
Spark 的官方从 Cluster Mode Overview 中,官方向我们介绍了 cluster 模式的部署方式. Spark 作为独立进程在集群上运行,他们通过 SparkContext 进行 ...
- hdu2037 今年暑假不AC[贪心][区间调度问题]
目录 题目地址 题干 代码和解释 参考 题目地址 hdu2037 题干 代码和解释 本题使用贪心.有三种贪心策略:开始时间最早,结束时间最早,用时最短.第二种是正确的策略,因为结束得越早,后面就可以有 ...
- centos7安装hadoop2.7.7
下载hadoop-2.7.7 网址如下 https://www-eu.apache.org/dist/hadoop/core/ 移动到/opt 路径下 在/opt下新建一个文件夹,名为app mkdi ...
- Alpine容器中运行go的二进制文件
Alpine容器中运行go的二进制文件 kuSorZ · 3月之前 · 214 次点击 · 预计阅读时间 1 分钟 · 2分钟之前 开始浏览 原文出处:https://cloud.tencent.co ...