1、新增串联设备运营商页面
This commit is contained in:
@@ -7406,3 +7406,6 @@ xt_mk_jbxx.604.mkmc=Advanced
|
||||
xt_mk_jbxx.604.mkms=Advanced configuration function menu
|
||||
pidFile.keyword.allblank=PID file and keyword can not all blank
|
||||
network.throughput=Network Throughput
|
||||
isp=ISP
|
||||
addr=Entrance
|
||||
deviceType=Device Type
|
||||
@@ -6532,4 +6532,7 @@ topoManage.TopoNameSetting=\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u04
|
||||
xt_mk_jbxx.604.mkmc=\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430
|
||||
xt_mk_jbxx.604.mkms=\u041c\u0435\u043d\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438
|
||||
pidFile.keyword.allblank=Процесс файл PID и процесс поиска ключевых слов не могут быть пустыми одновременно
|
||||
network.throughput=Пропускная Способность Сети
|
||||
network.throughput=Пропускная Способность Сети
|
||||
isp=Оператор
|
||||
addr=Регион
|
||||
deviceType=Тип Оборудования
|
||||
@@ -7417,4 +7417,7 @@ topoManage.TopoNameSetting=\u62d3\u6251\u56fe\u540d\u79f0
|
||||
xt_mk_jbxx.604.mkmc=\u9ad8\u7ea7\u914d\u7f6e
|
||||
xt_mk_jbxx.604.mkms=\u9ad8\u7ea7\u914d\u7f6e\u529f\u80fd\u83dc\u5355
|
||||
pidFile.keyword.allblank=PID文件和进程关键字不能同时为空
|
||||
network.throughput=流量展示
|
||||
network.throughput=流量展示
|
||||
isp=运营商
|
||||
addr=地域
|
||||
deviceType=设备类型
|
||||
147
WebRoot/page/detection/monitorData/inlineInfoList.jsp
Normal file
147
WebRoot/page/detection/monitorData/inlineInfoList.jsp
Normal file
@@ -0,0 +1,147 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib prefix="c" uri="/jstl/c"%>
|
||||
<%@ taglib prefix="fn" uri="/jstl/fn"%>
|
||||
<%@ taglib prefix="fmt" uri="/jstl/fmt"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme() + "://"
|
||||
+ request.getServerName() + ":" + request.getServerPort()
|
||||
+ path + "/";
|
||||
%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>inline device info</title>
|
||||
<link href="<c:url value='/css/nms.css'/>" rel="stylesheet" type="text/css" />
|
||||
<script language="javascript" type="text/javascript" src="<c:url value='/js/jquery-1.4.2.min.js'/>"></script>
|
||||
<script language="javascript" type="text/javascript" src="<c:url value='/js/onmouse.js'/>"></script>
|
||||
<script language="javascript" type="text/javascript" src="<c:url value='/js/jquery.suggest.js'/>"></script>
|
||||
</head>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
var msg = '${MSG}';
|
||||
if(msg=='1'){
|
||||
alert("i18n_bril.message.success_n81i");
|
||||
}else if(msg=='2'){
|
||||
alert("i18n_bril.message.faild_n81i");
|
||||
}
|
||||
//查询记录
|
||||
function qry(){
|
||||
document.form3.action = "<%=path%>/detection/inlineDevice.do?action=query";
|
||||
document.form3.submit();
|
||||
}
|
||||
|
||||
jQuery(function(){
|
||||
$("#info").floatHeaderDiv();
|
||||
})
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<div class="middle_list">
|
||||
<form name="form3" id="frmArticleType"
|
||||
action="<c:url value='/detection/inlineDevice.do?action=query'/>" method="post">
|
||||
<div class="box_1">
|
||||
<label class="divTopText"><font class="selectText">IP</font>
|
||||
<input style="width:140px;" name="nodeIp" id="nodeIp" value="${nodeIp}"></label>
|
||||
<label class="divTopText"><font class="selectText">i18n_addr_n81i</font>
|
||||
<select name="addrCode">
|
||||
<option value="" selected="selected">i18n_dil.message.statusDefault_n81i</option>
|
||||
<c:forEach items="${addrList }" var="addr">
|
||||
<option value="${addr['addr_code']}" <c:if test="${ addr['addr_code'] == addrCode}">selected="selected"</c:if>>${addr['addr_name'] }</option>
|
||||
</c:forEach>
|
||||
</select></label>
|
||||
<label class="divTopText"><font class="selectText">i18n_isp_n81i</font><!-- isp -->
|
||||
<select name="ispKeyCode">
|
||||
<option value="" selected="selected">i18n_dil.message.statusDefault_n81i</option>
|
||||
<c:forEach items="${ispList }" var="isp">
|
||||
|
||||
<option value="${isp['isp_key_code']}" <c:if test="${ isp['isp_key_code'] == ispKeyCode}">selected="selected"</c:if>>${isp['isp_key_name'] }</option>
|
||||
</c:forEach>
|
||||
</select></label>
|
||||
<img src="<c:url value='/images/button_chaxun.png'/>"
|
||||
class="img_middle" onclick="javascript:qry();" />
|
||||
</div>
|
||||
<div class="box_2"><jsp:include page="/include/include.jsp" /></div>
|
||||
<table border="0" cellpadding="0" cellspacing="0" class="table">
|
||||
<tr>
|
||||
<td width="5%" class="color_top">
|
||||
IP
|
||||
</td>
|
||||
<td width="5%" class="color_top">
|
||||
i18n_deviceType_n81i
|
||||
</td>
|
||||
<td width="5%" class="color_top">
|
||||
i18n_addr_n81i
|
||||
</td>
|
||||
<td width="5%" class="color_top">
|
||||
i18n_isp_n81i
|
||||
</td>
|
||||
<td width="5%" class="color_top">
|
||||
pass status
|
||||
</td>
|
||||
|
||||
<td width="10%" class="color_top"><!-- 输入速度 mbps -->
|
||||
i18n_sdigp.text.inoctetsspeed_n81i
|
||||
</td>
|
||||
<td width="10%" class="color_top"><!-- 输入包速率 pps -->
|
||||
i18n_sdigp.text.inpktsspeed_n81i
|
||||
</td>
|
||||
<td width="10%" class="color_8">
|
||||
<!-- 更新时间 -->i18n_dclwl.text.dataCheckTime_n81i
|
||||
</td>
|
||||
</tr>
|
||||
<c:choose>
|
||||
<c:when test="${fn:length(page.result) > 0}">
|
||||
<c:forEach items="${page.result}" var="item" varStatus="vs">
|
||||
<c:set var="color" value="color_1"/>
|
||||
<c:set var="color_end" value="color_7"/>
|
||||
<c:if test="${vs.count%2!=0 }">
|
||||
<c:set var="color" value="color_3"/>
|
||||
<c:set var="color_end" value="color_6"/>
|
||||
</c:if>
|
||||
<tr>
|
||||
<td class="${color }">
|
||||
${item['ip_addr']}
|
||||
</td>
|
||||
<td class="${color }">
|
||||
${item['device_type']}
|
||||
</td>
|
||||
<td class="${color }">
|
||||
${item['addr_name']}
|
||||
</td>
|
||||
<td class="${color }">
|
||||
${item['isp_key_name']}
|
||||
</td>
|
||||
<td class="${color }">
|
||||
${item['propmStatus']}
|
||||
</td>
|
||||
<td class="${color }">
|
||||
${item['INOCTETSSPEED']}
|
||||
</td>
|
||||
<td class="${color }">
|
||||
${item['INPKTSSPEED']}
|
||||
</td>
|
||||
<td class="${color }">
|
||||
${item['DATA_CHECK_TIME']}
|
||||
</td>
|
||||
<tr>
|
||||
</c:forEach>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<tr>
|
||||
<td colspan="10" height="20" align="center" class="color_6">
|
||||
i18n_mil.text.noRecord_n81i
|
||||
</td>
|
||||
</tr>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</table>
|
||||
<c:if test="${!empty page.result}">
|
||||
<jsp:include page="/common/page.jsp" />
|
||||
</c:if>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -397,7 +397,7 @@
|
||||
<%=(si.getIfHighSpeed() ==null?MyNumberFormat.formatStr1(new BigDecimal(si.getIfSpeed()),0,1000):si.getIfHighSpeed()+"Mbps") %>
|
||||
</td>
|
||||
<td class="${color }">
|
||||
${si.ifOperStatus}
|
||||
${si.ifOperStatus==1?'up':'down'}
|
||||
</td>
|
||||
<td class="${color }">
|
||||
<%=MyNumberFormat.formatStr1(si.getIfInOctetsSpeed()==null?null:(new BigDecimal(si.getIfInOctetsSpeed()).multiply(new BigDecimal(8))),0,1024) %>
|
||||
|
||||
@@ -8,12 +8,8 @@ import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
@@ -37,6 +33,7 @@ import org.hibernate.HibernateException;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SQLQuery;
|
||||
import org.hibernate.criterion.Expression;
|
||||
import org.hibernate.transform.Transformers;
|
||||
import org.springframework.dao.DataAccessResourceFailureException;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@@ -203,6 +200,29 @@ public class CommonService<T> extends HibernateGeneralDaoImpl<T>{
|
||||
return page;
|
||||
}
|
||||
|
||||
public Page findByPageForSqlMap(String sql, int pageNo, int pageSize, Object... values) throws Exception {
|
||||
Assert.hasText(sql);
|
||||
Assert.isTrue(pageNo >= 1, "pageNo should start from 1");
|
||||
// Count查询
|
||||
if (values != null && values.length == 0) {
|
||||
values = null;
|
||||
}
|
||||
List countlist = null;
|
||||
long totalCount = 0;
|
||||
String countQueryString = " select count(*) as totalCount from ( " + sql + " ) trySearch ";
|
||||
totalCount = (Long)createSQLQuery(countQueryString, values)
|
||||
.addScalar("totalCount", Hibernate.LONG)
|
||||
.uniqueResult();
|
||||
if (totalCount < 1) return new Page();
|
||||
// 实际查询返回分页对象
|
||||
int startIndex = Page.getStartOfPage(pageNo, pageSize);
|
||||
Query query = createSQLQuery(sql, values);
|
||||
List list = query.setFirstResult(startIndex).setMaxResults(pageSize).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).list();
|
||||
Page page = new Page(startIndex, totalCount, pageSize, list);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
public List executeSQL(String sql,Class entity) throws Exception {
|
||||
Assert.hasText(sql);
|
||||
Query query = createSQLQuery(sql).addEntity(entity);
|
||||
|
||||
249
src/nis/nms/web/actions/detection/InlineDeviceAction.java
Normal file
249
src/nis/nms/web/actions/detection/InlineDeviceAction.java
Normal file
@@ -0,0 +1,249 @@
|
||||
package nis.nms.web.actions.detection;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.struts2.config.Result;
|
||||
import org.apache.struts2.config.Results;
|
||||
import org.hibernate.SQLQuery;
|
||||
|
||||
import com.nis.util.StringUtil;
|
||||
|
||||
import nis.nms.service.CommonService;
|
||||
import nis.nms.util.BaseAction;
|
||||
import nis.nms.util.Constant;
|
||||
import nis.nms.util.Page;
|
||||
|
||||
@Results({
|
||||
@Result(name = "inlineInfoList", value = "/page/detection/monitorData/inlineInfoList.jsp")
|
||||
})
|
||||
@SuppressWarnings("all")
|
||||
public class InlineDeviceAction extends BaseAction{
|
||||
private static final Logger logger = Logger.getLogger(InlineDeviceAction.class);
|
||||
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
private static final long serialVersionUID = 1L;
|
||||
private CommonService commonService;
|
||||
private int pageNo = 1;
|
||||
private int pageSize = this.getDefaultPageSize(); // 每页显示的记录条数
|
||||
private Page page;
|
||||
private String action;
|
||||
private String nodeIp;//查询条件:节点ip
|
||||
private String addrCode; //查询条件:地域编码
|
||||
private String ispKeyCode;//查询条件:运营商唯一标识
|
||||
|
||||
@Override
|
||||
public String executeAction() throws Exception {
|
||||
String result = "inlineInfoList";
|
||||
//查询运营商等信息
|
||||
if("query".equalsIgnoreCase(this.action)) {
|
||||
result = inlineInfoList();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 串联设备运营商等信息
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public String inlineInfoList() throws Exception {
|
||||
Long systemID = this.getSystemID();//当前登录的 视图 id
|
||||
//运营商信息
|
||||
String sql = "select * from sys_isp_info order by id";
|
||||
List ispList = commonService.executeSQLMap(sql);
|
||||
this.getRequest().setAttribute("ispList", ispList);
|
||||
//地域信息
|
||||
sql = "select * from sys_addr_info order by id";
|
||||
List addrList = commonService.executeSQLMap(sql);
|
||||
this.getRequest().setAttribute("addrList", addrList);
|
||||
|
||||
StringBuilder sbSql = new StringBuilder();
|
||||
sql = "SELECT " +
|
||||
" sdi.*, sii.isp_key_name, sai.addr_name, nt.* " +
|
||||
" FROM " +
|
||||
" sys_device_info sdi " +
|
||||
" LEFT JOIN sys_isp_info sii ON sdi.isp = sii.isp_key_code " +
|
||||
" LEFT JOIN sys_addr_info sai ON sdi.entrance_id = sai.addr_code " +
|
||||
" LEFT JOIN ( SELECT node_ip, seq_id FROM node_table GROUP BY node_ip ) nt ON nt.node_ip = sdi.ip_addr " +
|
||||
"where sdi.status != 0 ";
|
||||
sbSql.append(sql);
|
||||
if(systemID != -1) {
|
||||
sbSql.append(" and sdi.system_id = ").append(systemID);
|
||||
}
|
||||
if(!StringUtil.isBlank(nodeIp)) {
|
||||
sbSql.append(" and sdi.ip_addr like '%").append(nodeIp).append("%' ");
|
||||
}
|
||||
if(!StringUtil.isBlank(addrCode)) {
|
||||
sbSql.append(" and sdi.entrance_id = ").append(addrCode);
|
||||
}
|
||||
if(!StringUtil.isBlank(ispKeyCode)) {
|
||||
sbSql.append(" and sdi.isp = ").append(ispKeyCode);
|
||||
}
|
||||
sbSql.append(" order by sdi.ip_addr,sdi.link_id");
|
||||
Page devicePage = commonService.findByPageForSqlMap(sbSql.toString(), pageNo, pageSize);
|
||||
//List<Map<String,Object>> deviceList = commonService.executeSQLMap();
|
||||
|
||||
//查询所有的 串联设备 bypass 状态
|
||||
sql = "SELECT " +
|
||||
" dp.* " +
|
||||
"FROM " +
|
||||
" di_propmstatus dp " +
|
||||
" LEFT JOIN detection_info_new din ON dp.detection_info_id = din.DETECTION_INFO_ID " +
|
||||
" LEFT JOIN node_table nt ON nt.seq_id = din.SEQ_ID " +
|
||||
"WHERE " +
|
||||
" nt.network_element_type = 1 " +
|
||||
" AND node_type = 1 " +
|
||||
" AND node_state = 0 " ;
|
||||
sbSql.setLength(0);
|
||||
sbSql.append(sql);
|
||||
if(systemID != -1) {
|
||||
sbSql.append(" and nt.system_id = ").append(systemID);
|
||||
}
|
||||
List<Map<String,Object>> byPassList = commonService.executeSQLMap(sbSql.toString());
|
||||
Map<String,Map<String,Object>> byPassMap = new HashMap<String, Map<String,Object>>(byPassList.size());
|
||||
for(Map<String,Object> map : byPassList) {
|
||||
String seqId = map.get("SEQ_ID")+"";
|
||||
String status = map.get("propmStatus")+"";
|
||||
String index = map.get("popmIndex")+"";
|
||||
byPassMap.put(seqId+index, map);
|
||||
}
|
||||
|
||||
//查询所有的串联设备的 端口数据
|
||||
sql = "SELECT " +
|
||||
" dp.* " +
|
||||
"FROM " +
|
||||
" di_switchport dp " +
|
||||
" LEFT JOIN detection_info_new din ON dp.detection_info_id = din.DETECTION_INFO_ID " +
|
||||
" LEFT JOIN node_table nt ON nt.seq_id = din.SEQ_ID " +
|
||||
"WHERE " +
|
||||
" nt.network_element_type = 1 " +
|
||||
" AND node_type = 1 " +
|
||||
" AND node_state = 0 " ;
|
||||
sbSql.setLength(0);
|
||||
sbSql.append(sql);
|
||||
if(systemID != -1) {
|
||||
sbSql.append(" and nt.system_id = ").append(systemID);
|
||||
}
|
||||
List<Map<String,Object>> portList = commonService.executeSQLMap(sbSql.toString());
|
||||
Map<String,Map<String,Object>> portMap = new HashMap<String, Map<String,Object>>(byPassList.size());
|
||||
for(Map<String,Object> map : portList) {
|
||||
String seqId = map.get("SEQ_ID")+"";
|
||||
String ifdescr = map.get("IFDESCR")+"";
|
||||
portMap.put(seqId+ifdescr, map);
|
||||
}
|
||||
|
||||
List<Map<String,Object>> deviceList = (List<Map<String,Object>>)devicePage.getResult();
|
||||
for(Map<String,Object> device : deviceList) {
|
||||
String seqId = device.get("seq_id")+"";
|
||||
String linkIndex = device.get("link_id")+"";
|
||||
String portName = device.get("port_name")+"";
|
||||
|
||||
Map<String, Object> map = byPassMap.get(seqId+linkIndex);
|
||||
if(map != null) {
|
||||
String s = map.get("propmStatus")+"";
|
||||
s = (s == null ? "No Data": (s.equals("1") ? "pass" : "bypass"));
|
||||
device.put("propmStatus", s);
|
||||
}
|
||||
if(!StringUtil.isBlank(portName)) {
|
||||
String[] portArr = portName.split(",");
|
||||
long inoctetsspeed = 0l;//输入
|
||||
long inpktsspeed = 0l;//输入包速率
|
||||
String checkTime = null;
|
||||
for(String port : portArr) {
|
||||
Map<String, Object> p = portMap.get(seqId+ port);
|
||||
if(p != null) {
|
||||
Object inOct = p.get("INOCTETSSPEED");
|
||||
Object inPac = p.get("INPKTSSPEED");
|
||||
if(inOct != null) {
|
||||
inoctetsspeed += Long.valueOf(inOct+"");
|
||||
}
|
||||
if(inPac != null) {
|
||||
inpktsspeed += Long.valueOf(inPac+"");
|
||||
}
|
||||
if(checkTime == null) {
|
||||
checkTime = p.get("DATA_CHECK_TIME_DIGITAL") +"";
|
||||
Date date = new Date(Long.valueOf(checkTime));
|
||||
checkTime = sdf.format(date);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
device.put("INOCTETSSPEED", String.format("%.2f", inoctetsspeed/1024.0/1024.0) +" Mbps");
|
||||
device.put("INPKTSSPEED", inpktsspeed +" pps");
|
||||
device.put("DATA_CHECK_TIME",checkTime);
|
||||
}
|
||||
}
|
||||
this.getRequest().setAttribute("page", devicePage);
|
||||
return "inlineInfoList";
|
||||
}
|
||||
|
||||
public CommonService getCommonService() {
|
||||
return commonService;
|
||||
}
|
||||
|
||||
public void setCommonService(CommonService commonService) {
|
||||
this.commonService = commonService;
|
||||
}
|
||||
|
||||
public int getPageNo() {
|
||||
return pageNo;
|
||||
}
|
||||
|
||||
public void setPageNo(int pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Page getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(Page page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public String getNodeIp() {
|
||||
return nodeIp;
|
||||
}
|
||||
|
||||
public void setNodeIp(String nodeIp) {
|
||||
this.nodeIp = nodeIp;
|
||||
}
|
||||
|
||||
public String getAddrCode() {
|
||||
return addrCode;
|
||||
}
|
||||
|
||||
public void setAddrCode(String addrCode) {
|
||||
this.addrCode = addrCode;
|
||||
}
|
||||
|
||||
public String getIspKeyCode() {
|
||||
return ispKeyCode;
|
||||
}
|
||||
|
||||
public void setIspKeyCode(String ispKeyCode) {
|
||||
this.ispKeyCode = ispKeyCode;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -860,10 +860,9 @@ public class SwitchDetectionAction extends BaseAction {
|
||||
si.setIfAdminStatus(objs[6] == null ? null : ((BigDecimal) objs[6]).intValue());
|
||||
si.setIfOperStatus(objs[7] == null ? null : ((BigDecimal) objs[7]).intValue());
|
||||
// si.setIfLastChange(objs[8]==null?null:Long.parseLong((String)objs[8]));
|
||||
|
||||
si.setIfInOctets(objs[9] == null ? null : ((BigDecimal) objs[9]).doubleValue());
|
||||
si.setIfInUcastPkts(objs[10] == null ? null : ((BigDecimal) objs[10]).doubleValue());
|
||||
si.setIfInNUcastPkts(objs[11] == null ? null : ((BigDecimal) objs[11]).doubleValue());
|
||||
si.setIfInOctets(objs[9] == null ? 0.00d : ((BigDecimal) objs[9]).doubleValue());
|
||||
si.setIfInUcastPkts(objs[10] == null ? 0.00d : ((BigDecimal) objs[10]).doubleValue());
|
||||
si.setIfInNUcastPkts(objs[11] == null ? 0.00d : ((BigDecimal) objs[11]).doubleValue());
|
||||
// logger.debug((objs[10]==null?null:((BigDecimal)objs[10]).doubleValue())+"
|
||||
// vs
|
||||
// "+(objs[11]==null?null:((BigDecimal)objs[11]).doubleValue()));
|
||||
@@ -871,7 +870,7 @@ public class SwitchDetectionAction extends BaseAction {
|
||||
si.setIfInErrors(objs[13] == null ? null : ((BigDecimal) objs[13]).doubleValue());
|
||||
si.setIfInUnknownProtos(objs[14] == null ? null : ((BigDecimal) objs[14]).doubleValue());
|
||||
|
||||
si.setIfOutOctets(objs[15] == null ? null : ((BigDecimal) objs[15]).doubleValue());
|
||||
si.setIfOutOctets(objs[15] == null ? 0.00d : ((BigDecimal) objs[15]).doubleValue());
|
||||
si.setIfOutUcastPkts(objs[16] == null ? null : ((BigDecimal) objs[16]).doubleValue());
|
||||
si.setIfOutNUcastPkts(objs[17] == null ? null : ((BigDecimal) objs[17]).doubleValue());
|
||||
|
||||
@@ -1050,8 +1049,7 @@ public class SwitchDetectionAction extends BaseAction {
|
||||
portInfo.setIfInNUcastPkts(news.getIfInNUcastPkts() == null ? 0 : news.getIfInNUcastPkts().longValue());
|
||||
portInfo.setIfInDiscards(news.getIfInDiscards() == null ? 0 : news.getIfInDiscards().longValue());
|
||||
portInfo.setIfInErrors(news.getIfInErrors() == null ? 0 : news.getIfInErrors().longValue());
|
||||
portInfo.setIfInUnknownProtos(
|
||||
news.getIfInUnknownProtos() == null ? 0 : news.getIfInUnknownProtos().longValue());
|
||||
portInfo.setIfInUnknownProtos(news.getIfInUnknownProtos() == null ? 0 : news.getIfInUnknownProtos().longValue());
|
||||
portInfo.setIfOutOctets(news.getIfOutOctets() == null ? 0 : news.getIfOutOctets().longValue());
|
||||
portInfo.setIfOutUcastPkts(news.getIfOutUcastPkts() == null ? 0 : news.getIfOutUcastPkts().longValue());
|
||||
portInfo.setIfOutNUcastPkts(news.getIfOutNUcastPkts() == null ? 0 : news.getIfOutNUcastPkts().longValue());
|
||||
@@ -1208,8 +1206,7 @@ public class SwitchDetectionAction extends BaseAction {
|
||||
}
|
||||
double dOutPks = oupks + onupks;
|
||||
|
||||
BigDecimal outPksSpeed = new BigDecimal(dOutPks * 1000).divide(new BigDecimal(waitTime), 2,
|
||||
RoundingMode.HALF_UP);
|
||||
BigDecimal outPksSpeed = new BigDecimal(dOutPks * 1000).divide(new BigDecimal(waitTime), 2,RoundingMode.HALF_UP);
|
||||
// logger.debug("outdata:>"+"("+ifOutUcastPkts_n+"-"+ifOutUcastPkts_o+")+("+ifOutNucastPkts_n+"-"+ifOutNucastPkts_o+")="+((ifOutUcastPkts_n
|
||||
// - ifOutUcastPkts_o)+(ifOutNucastPkts_n - ifOutNucastPkts_o))+" /
|
||||
// timss"+waitTime+" values "+ (new
|
||||
@@ -1227,7 +1224,7 @@ public class SwitchDetectionAction extends BaseAction {
|
||||
logger.debug("端口数据计算抛弃数据:输入包速度与输入字节速度计算式:(" + inPksSpeed_a + " * " + minPacketSize + " > "
|
||||
+ ifinoctetsspeed_a + ")");
|
||||
logger.debug("端口数据计算抛弃数据-------");
|
||||
inPksSpeed_a = null;
|
||||
inPksSpeed_a = 0.0;
|
||||
}
|
||||
|
||||
Double outPksSpeed_a = outPksSpeed.doubleValue(); // --单位pps
|
||||
@@ -1237,7 +1234,7 @@ public class SwitchDetectionAction extends BaseAction {
|
||||
logger.debug("端口数据计算抛弃数据:输出包速度与输入字节速度计算式:(" + outPksSpeed_a + " * " + minPacketSize + " > "
|
||||
+ ifoutoctetsspeed_a + ")");
|
||||
logger.debug("端口数据计算抛弃数据-------");
|
||||
outPksSpeed_a = null;
|
||||
outPksSpeed_a = 0.0;
|
||||
}
|
||||
|
||||
double maxSpeed = (portInfo.getIfHighSpeed() == null || portInfo.getIfHighSpeed().longValue() == 0)
|
||||
@@ -1251,7 +1248,7 @@ public class SwitchDetectionAction extends BaseAction {
|
||||
logger.debug("端口数据计算抛弃数据:时间:(" + news.getLastLongTime() + "-" + old.getLastLongTime() + ")");
|
||||
logger.debug("端口数据计算抛弃数据:输入字节速度和带宽:(" + ifinoctetsspeed_a + " vs " + maxSpeed + ")");
|
||||
logger.debug("端口数据计算抛弃数据-------");
|
||||
portInfo.setIfInOctetsSpeed(null);
|
||||
portInfo.setIfInOctetsSpeed(0.0);
|
||||
}
|
||||
// System.out.println(" date "+portInfo.getIfDescr()+"
|
||||
// "+portInfo.getIfInOctetsSpeed() +" "+ifinoctetsspeed_a);
|
||||
@@ -1264,7 +1261,7 @@ public class SwitchDetectionAction extends BaseAction {
|
||||
logger.debug("端口数据计算抛弃数据:时间:(" + news.getLastLongTime() + "-" + old.getLastLongTime() + ")");
|
||||
logger.debug("端口数据计算抛弃数据:输出字节速度和带宽:(" + ifoutoctetsspeed_a + " vs " + maxSpeed + ")");
|
||||
logger.debug("端口数据计算抛弃数据-------");
|
||||
portInfo.setIfOutOctetsSpeed(null);
|
||||
portInfo.setIfOutOctetsSpeed(0.0);
|
||||
}
|
||||
portInfo.setInpktsspeed(inPksSpeed_a);
|
||||
portInfo.setOutpktsspeed(outPksSpeed_a);
|
||||
|
||||
Reference in New Issue
Block a user