告警管理,告警日志接口。更改计算95值定时任务时间
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
package com.ruoyi.rocketmq.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警策略对象 rm_alarm_policy
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-09-12
|
||||
*/
|
||||
@Data
|
||||
public class RmAlarmPolicy extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 告警策略名称 */
|
||||
@Excel(name = "告警策略名称")
|
||||
private String alarmName;
|
||||
|
||||
/** 策略描述 */
|
||||
@Excel(name = "策略描述")
|
||||
private String alarmDescription;
|
||||
|
||||
/** 关联的资源组ID */
|
||||
@Excel(name = "关联的资源组ID")
|
||||
private Long resourceGroupId;
|
||||
/** 关联资源组名称*/
|
||||
private String resourceGroupName;
|
||||
/** 包含设备 */
|
||||
private String resourceName;
|
||||
|
||||
/** 状态:0-禁用,1-启用 */
|
||||
@Excel(name = "状态:0-禁用,1-启用")
|
||||
private String status;
|
||||
|
||||
/** 策略下发时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "策略下发时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date deployTime;
|
||||
/** 告警策略内容*/
|
||||
private List<RmAlarmRule> alarmRuleList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package com.ruoyi.rocketmq.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 告警记录对象 rm_alarm_record
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-09-12
|
||||
*/
|
||||
public class RmAlarmRecord extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 客户端ID/设备ID */
|
||||
@Excel(name = "客户端ID/设备ID")
|
||||
private String clientId;
|
||||
|
||||
/** 资源名称 */
|
||||
@Excel(name = "资源名称")
|
||||
private String resourceName;
|
||||
|
||||
/** 源IP地址 */
|
||||
@Excel(name = "源IP地址")
|
||||
private String sourceIp;
|
||||
|
||||
/** 告警发生时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "告警发生时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date occurTime;
|
||||
|
||||
/** 告警详细内容 */
|
||||
@Excel(name = "告警详细内容")
|
||||
private String content;
|
||||
|
||||
/** 重复告警次数 */
|
||||
@Excel(name = "重复告警次数")
|
||||
private Long repeatCount;
|
||||
|
||||
/** 状态:0-未处理,1-已处理 */
|
||||
@Excel(name = "状态:0-未处理,1-已处理")
|
||||
private String status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setClientId(String clientId)
|
||||
{
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public String getClientId()
|
||||
{
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setResourceName(String resourceName)
|
||||
{
|
||||
this.resourceName = resourceName;
|
||||
}
|
||||
|
||||
public String getResourceName()
|
||||
{
|
||||
return resourceName;
|
||||
}
|
||||
|
||||
public void setSourceIp(String sourceIp)
|
||||
{
|
||||
this.sourceIp = sourceIp;
|
||||
}
|
||||
|
||||
public String getSourceIp()
|
||||
{
|
||||
return sourceIp;
|
||||
}
|
||||
|
||||
public void setOccurTime(Date occurTime)
|
||||
{
|
||||
this.occurTime = occurTime;
|
||||
}
|
||||
|
||||
public Date getOccurTime()
|
||||
{
|
||||
return occurTime;
|
||||
}
|
||||
|
||||
public void setContent(String content)
|
||||
{
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getContent()
|
||||
{
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setRepeatCount(Long repeatCount)
|
||||
{
|
||||
this.repeatCount = repeatCount;
|
||||
}
|
||||
|
||||
public Long getRepeatCount()
|
||||
{
|
||||
return repeatCount;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("clientId", getClientId())
|
||||
.append("resourceName", getResourceName())
|
||||
.append("sourceIp", getSourceIp())
|
||||
.append("occurTime", getOccurTime())
|
||||
.append("content", getContent())
|
||||
.append("repeatCount", getRepeatCount())
|
||||
.append("status", getStatus())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.ruoyi.rocketmq.domain;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 告警规则对象 rm_alarm_rule
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-09-12
|
||||
*/
|
||||
@Data
|
||||
public class RmAlarmRule extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 关联的告警策略ID */
|
||||
@Excel(name = "关联的告警策略ID")
|
||||
private Long alarmPolicyId;
|
||||
|
||||
/** 规则名称 */
|
||||
@Excel(name = "规则名称")
|
||||
private String ruleName;
|
||||
|
||||
/** 监控指标键 */
|
||||
@Excel(name = "监控指标键")
|
||||
private String metricKey;
|
||||
|
||||
/** 比较运算符(>, <, >=, <=, =, !=) */
|
||||
@Excel(name = "比较运算符", readConverterExp = ">=,,<=,,>==,,<==,,==,,!==")
|
||||
private String operator;
|
||||
|
||||
/** 告警阈值 */
|
||||
@Excel(name = "告警阈值")
|
||||
private BigDecimal threshold;
|
||||
|
||||
/** 资源类型(linux/switch) */
|
||||
@Excel(name = "资源类型", readConverterExp = "l=inux/switch")
|
||||
private String resourceType;
|
||||
|
||||
/** 状态:0-禁用,1-启用 */
|
||||
@Excel(name = "状态:0-禁用,1-启用")
|
||||
private String status;
|
||||
|
||||
/** 端口白名单 */
|
||||
@Excel(name = "端口白名单")
|
||||
private String portWhitelist;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.ruoyi.rocketmq.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 告警规则模板对象 rm_alarm_rule_template
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-09-12
|
||||
*/
|
||||
public class RmAlarmRuleTemplate extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 规则名称 */
|
||||
@Excel(name = "规则名称")
|
||||
private String ruleName;
|
||||
|
||||
/** 监控指标键 */
|
||||
@Excel(name = "监控指标键")
|
||||
private String metricKey;
|
||||
|
||||
/** 资源类型(linux/switch) */
|
||||
@Excel(name = "资源类型", readConverterExp = "l=inux/switch")
|
||||
private String resourceType;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setRuleName(String ruleName)
|
||||
{
|
||||
this.ruleName = ruleName;
|
||||
}
|
||||
|
||||
public String getRuleName()
|
||||
{
|
||||
return ruleName;
|
||||
}
|
||||
|
||||
public void setMetricKey(String metricKey)
|
||||
{
|
||||
this.metricKey = metricKey;
|
||||
}
|
||||
|
||||
public String getMetricKey()
|
||||
{
|
||||
return metricKey;
|
||||
}
|
||||
|
||||
public void setResourceType(String resourceType)
|
||||
{
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public String getResourceType()
|
||||
{
|
||||
return resourceType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("ruleName", getRuleName())
|
||||
.append("metricKey", getMetricKey())
|
||||
.append("resourceType", getResourceType())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ruoyi.rocketmq.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class AlarmVo {
|
||||
/** 规则类型 */
|
||||
private String type;
|
||||
/** 是否开启 */
|
||||
private boolean collect = false;
|
||||
/** 比较运算符 */
|
||||
private String operator;
|
||||
/** 阈值 */
|
||||
private BigDecimal threshold;
|
||||
/** 是否启用 */
|
||||
private String status;
|
||||
/** 端口白名单 */
|
||||
private String portWhitelist;
|
||||
}
|
||||
Reference in New Issue
Block a user