diff options
| author | renkaige <[email protected]> | 2019-01-16 19:18:08 +0600 |
|---|---|---|
| committer | renkaige <[email protected]> | 2019-01-16 19:18:08 +0600 |
| commit | 0bbd68bb2c7228a812be6e3ba780de0f6569a056 (patch) | |
| tree | 40268b600710949a0a5d7c8b90db0a503ee62f7d | |
| parent | 453f8ae5dd2de65eab7714551d68099285757481 (diff) | |
| parent | d368dcf7811b4643f8edae136a1deeb2cf4b317c (diff) | |
Merge branch 'develop' of https://git.mesalab.cn/galaxy/galaxy-service.git into develop
| -rw-r--r-- | db/201901-update.sql | 2 | ||||
| -rw-r--r-- | src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml | 12 | ||||
| -rw-r--r-- | src/main/resources/maatXml/applicationConfig-maatRedis.xml | 2 |
3 files changed, 9 insertions, 7 deletions
diff --git a/db/201901-update.sql b/db/201901-update.sql new file mode 100644 index 0000000..882c978 --- /dev/null +++ b/db/201901-update.sql @@ -0,0 +1,2 @@ +--活跃端口统计增加传输层协议属性 +alter table traffic_port_active_statistic add trans_proto int(11) default 0 comment '6-tcp 17 -udp';
\ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml b/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml index bf50e8b..2b90249 100644 --- a/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml @@ -31,15 +31,15 @@ SELECT stat_time statTime FROM traffic_trans_statistic order by stat_time desc limit 1
</select>
<!-- 根据最近时间条获取带宽,进出口流量 -->
- <select id="getNetFlowPortInfoNew" resultType="java.util.HashMap">
- SELECT SUM(total_traffic.inoctets) AS inoctets ,SUM(total_traffic.outoctets) AS outoctets FROM (
+ <select id="getNetFlowPortInfoNew" resultType="java.util.HashMap">
+ SELECT SUM(total_traffic.inoctets) AS inoctets ,SUM(total_traffic.outoctets) AS outoctets FROM (
SELECT IFNULL(SUM(c2s_byte_len),0) inoctets ,IFNULL(SUM(s2c_byte_len),0) outoctets FROM traffic_trans_statistic
- where stat_time = (SELECT stat_time FROM traffic_trans_statistic WHERE entrance_id=1 ORDER BY stat_time DESC LIMIT 0,1) and entrance_id=1
+ where stat_time = (SELECT stat_time FROM traffic_trans_statistic WHERE entrance_id=1 and stat_time > DATE_SUB(now(), INTERVAL 15 MINUTE) ORDER BY stat_time DESC LIMIT 0,1) and entrance_id=1
UNION ALL
SELECT IFNULL(SUM(c2s_byte_len),0) inoctets ,IFNULL(SUM(s2c_byte_len),0) outoctets FROM traffic_trans_statistic
- where stat_time = (SELECT stat_time FROM traffic_trans_statistic WHERE entrance_id=2 ORDER BY stat_time DESC LIMIT 0,1) and entrance_id=2
- ) total_traffic
- </select>
+ where stat_time = (SELECT stat_time FROM traffic_trans_statistic WHERE entrance_id=2 and stat_time > DATE_SUB(now(), INTERVAL 15 MINUTE) ORDER BY stat_time DESC LIMIT 0,1) and entrance_id=2
+ ) total_traffic
+ </select>
<!-- 获取近五分钟的带宽根据ip46,协议 tcp,udp变化 -->
<!-- <select id="getBandwidthTrans" resultMap="BandwidthResultMap">
select IFNULL(p.gbps,0) gbps,IFNULL(p.pps,0) pps,IFNULL(p.sumNum,0) linkNum, date_format(a.min5,'%Y-%m-%d %H:%i') time from
diff --git a/src/main/resources/maatXml/applicationConfig-maatRedis.xml b/src/main/resources/maatXml/applicationConfig-maatRedis.xml index 77864e1..434180b 100644 --- a/src/main/resources/maatXml/applicationConfig-maatRedis.xml +++ b/src/main/resources/maatXml/applicationConfig-maatRedis.xml @@ -184,7 +184,7 @@ <p:maatType service="836">
<p:expressions>
<p:keyExpression>EFFECTIVE_RULE;:;{un_maat_table_name};,;[cfg_id]</p:keyExpression>
- <p:valueExpression>[cfg_id];\t;[original_addr_type];\t;[original_dest_ip];\t;[original_dest_port];\t;[original_protocol];\t;[translated_dest_port];\t;[translated_user_type];\t;[translated_user_id];\t;[do_log];\t;[action];\t;[service];\t;[is_valid];\t;[effective_range];\t;[op_time];&nbsp;0;\n</p:valueExpression>
+ <p:valueExpression>[cfg_id];\t;[original_addr_type];\t;[original_dest_ip];\t;[original_dest_port];\t;[original_protocol];\t;[translated_user_type];\t;[translated_user_id];\t;[translated_dest_port];\t;[do_log];\t;[action];\t;[service];\t;[is_valid];\t;[effective_range];\t;[op_time];&nbsp;0;\n</p:valueExpression>
</p:expressions>
<p:sequences>
<p:operation>1</p:operation>
|
