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/ ...
随机推荐
- 阿里巴巴Java开发手册(格式规约篇)——查自己的漏-补自己的缺
(三) 格式规约 1. [强制]大括号的使用约定.如果是大括号内为空,则简洁地写成{}即可,不需要换行:如果是非空代码块则: 1) 左大括号前不换行.行. 2) 左大括号后换行. 3) 右大括号前换行 ...
- Generative Adversarial Networks overview(3)
Libo1575899134@outlook.com Libo (原创文章,转发请注明作者) 本文章主要介绍Gan的应用篇,3,主要介绍图像应用,4, 主要介绍文本以及医药化学其他领域应用 原理篇请看 ...
- [POJ3468]关于整数的简单题 (你想要的)树状数组区间修改区间查询
#include <cstdio> #include <algorithm> #include <cstring> #include <cctype> ...
- 监听localStorage中的数据变化
问题描述:我们在js里面获取了某一个localstorage的值,但是后期它可能改变了,我们js只执行一遍没办法再次获取它的值,当然可以刷新页面获取,但如果是我们的但页面就不能刷新页面了,此时:我们可 ...
- (知识点4)C++ 中vector
1.定义vector<vector<int>> M; 2.添加元素这里是vector的嵌套使用,本质是vector元素里的每个元素也是vector类型,所以抓住本质来添加元素就 ...
- 洛谷 P1121 环状最大两段子段和 题解
每日一题 day57 打卡 Analysis 对于这个问题,由于分成了两个子序列,我们不妨就是枚举一下可能出现的情况: 无非就这两种: 1.+++++0000+++++0000++++ 2.0000+ ...
- 在WinDbg中调试时如何查看类/结构对象成员的值
有时,当您调试应用程序时,会碰巧得到指向类的指针,该类只有几个成员变量,包括结构和其他类对象!如何看待内部类/结构变量成员的值??所以,这是提示.下面是用于演示命令的代码. struct testSt ...
- Linux 检测 tls
检测 tls # openssl s_client -connect intl.jdair.net: -tls1
- 使用 ML.NET 对 K-Means 平均值聚类分析和分类
数据集 :https://en.wikipedia.org/wiki/Iris_flower_data_set 聚类分析 非监管式机器学习任务,用于将数据实例分组到包含类似特性的群集. 聚类分析还可用 ...
- canal简单安装使用
canal简介:https://github.com/alibaba/canal 1.数据库配置 首先使用canal需要修改数据库配置 [mysqld] log-bin=mysql-bin # 开启 ...