1、优化tcpdump解析速度。

2、补充tcpdump晚8点默认策略下发。
3、服务器管理列表增加出省流量占比列。
This commit is contained in:
gaoyutao
2026-02-04 17:41:00 +08:00
parent f8e0ab1b2a
commit 5dd9004081
12 changed files with 183 additions and 40 deletions
@@ -88,6 +88,9 @@ public class RmResourceRegistration extends BaseEntity
*/
@Excel(name = "心跳时间间隔")
private Integer heartbeatInterval;
/** 出省流量占比 */
@Excel(name = "出省流量占比")
private BigDecimal outboundRate;
/** 需要绑定的网卡信息 */
private List<Map> bindNetworkMsg;
@@ -258,10 +261,12 @@ public class RmResourceRegistration extends BaseEntity
/** 昨日95值排序 1正序 2倒叙 3不排序 4 cpu内存倒叙*/
private Integer bandwidthResultSort;
/** cpu利用率 */
@Excel(name = "cpu利用率")
private BigDecimal cpuUtil;
/** cpu核数 */
private BigDecimal cpuCores;
/** 内存使用率 */
@Excel(name = "内存使用率")
private BigDecimal memUtil;
/** 总内存 */
private Integer memTotalSize;
@@ -1063,6 +1063,11 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio
updateData.setHardwareSn(rmResourceRegistration.getHardwareSn());
needUpdate = true;
}
if(rmResourceRegistration.getOutboundRate()!=null){
// 设置出省流量百分比
updateData.setOutboundRate(rmResourceRegistration.getOutboundRate());
needUpdate = true;
}
if(needUpdate){
updateData.setId(exits.getId());
rmResourceRegistrationMapper.updateRmResourceRegistration(updateData);
@@ -1193,6 +1198,14 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio
// 注册成功,下发优先级为0的策略
remoteRocketMqService.issueDefaultPolicyByClientId(clientId, SecurityConstants.INNER);
// 下发tcpdump默认策略
String detectTimes = "20:00:00";
RmTcpdumpConfigRemote tcpdumpInsertData = new RmTcpdumpConfigRemote();
tcpdumpInsertData.setClientId(clientId);
tcpdumpInsertData.setDetectFlag(1);
tcpdumpInsertData.setFrequency("1");
tcpdumpInsertData.setDetectTimes(detectTimes);
remoteRocketMqService.innerInsertRmTcpdumpConfig(tcpdumpInsertData, SecurityConstants.INNER);
}
}
@@ -25,13 +25,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="reportedBandwidth" column="reported_bandwidth" />
<result property="delAlarmTime" column="del_alarm_time" />
<result property="outboundRate" column="outbound_rate" />
<result property="frpcConnectionStatus" column="frpc_connection_status" />
<result property="frpcRemotePort" column="frpc_remote_port" />
<result property="frpcServerAddr" column="frpc_server_addr" />
</resultMap>
<sql id="selectRmResourceRegistrationVo">
select id, client_id, hardware_sn, business_name, logical_node_id, multi_public_ip_status, registration_status, online_status, resource_type, agent_version, create_time, update_time, heartbeat_count, heartbeat_interval, onboard_time, remark, create_by, update_by, reported_bandwidth, del_alarm_time from rm_resource_registration
select id, client_id, hardware_sn, business_name, logical_node_id, multi_public_ip_status, registration_status, online_status, resource_type, agent_version, create_time, update_time, heartbeat_count, heartbeat_interval, onboard_time, remark, create_by, update_by, reported_bandwidth, del_alarm_time, outbound_rate from rm_resource_registration
</sql>
<select id="selectRmResourceRegistrationList" parameterType="RmResourceRegistration" resultMap="RmResourceRegistrationResult">
@@ -73,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.remark as remark,
a.reported_bandwidth as reportedBandwidth,
a.del_alarm_time as delAlarmTime,
a.outbound_rate as outboundRate,
b.machine_code as machineCode,
(select bandwidth_result from eps_node_bandwidth
where client_id=a.client_id and calculation_mode='1000' and bandwidth_type=1
@@ -101,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.remark as remark,
a.reported_bandwidth as reportedBandwidth,
a.del_alarm_time as delAlarmTime,
a.outbound_rate as outboundRate,
b.machine_code as machineCode,
(select bandwidth_result from eps_node_bandwidth
where client_id=a.client_id and calculation_mode='1000' and bandwidth_type=1
@@ -133,6 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="reportedBandwidth != null">reported_bandwidth,</if>
<if test="delAlarmTime != null">del_alarm_time,</if>
<if test="outboundRate != null">outbound_rate,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null">#{clientId},</if>
@@ -154,6 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="reportedBandwidth != null">#{reportedBandwidth},</if>
<if test="delAlarmTime != null">#{delAlarmTime},</if>
<if test="outboundRate != null">#{outboundRate},</if>
</trim>
</insert>
@@ -179,6 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="reportedBandwidth != null">reported_bandwidth = #{reportedBandwidth},</if>
<if test="delAlarmTime != null">del_alarm_time = #{delAlarmTime},</if>
<if test="outboundRate != null">outbound_rate = #{outboundRate},</if>
</trim>
where id = #{id}
</update>
@@ -218,6 +224,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="reportedBandwidth != null">reported_bandwidth = #{reportedBandwidth},</if>
<if test="outboundRate != null">outbound_rate = #{outboundRate},</if>
</trim>
<where>
<choose>
@@ -271,6 +278,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.remark as remark,
a.reported_bandwidth as reportedBandwidth,
a.del_alarm_time as delAlarmTime,
a.outbound_rate as outboundRate,
b.machine_code as machineCode,
c.frpc_connection_status frpcConnectionStatus,
c.frpc_remote_port frpcRemotePort,