与agent交互方式更改,生产者,消费者更改,监控模板策略微调,拓扑管理新增接口,资源组新增查重接口。
This commit is contained in:
+10
@@ -53,6 +53,16 @@ public class RmEpsTopologyManagementController extends BaseController
|
||||
List<RmEpsTopologyManagement> list = rmEpsTopologyManagementService.selectRmEpsTopologyManagementList(rmEpsTopologyManagement);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 查询拓扑管理图形
|
||||
*/
|
||||
@RequiresPermissions("system:management:list")
|
||||
@PostMapping("/getListChart")
|
||||
public AjaxResult getListChart(@RequestBody RmEpsTopologyManagement rmEpsTopologyManagement)
|
||||
{
|
||||
List<RmEpsTopologyManagement> list = rmEpsTopologyManagementService.selectRmEpsTopologyManagementList(rmEpsTopologyManagement);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出拓扑管理列表
|
||||
|
||||
+11
@@ -112,4 +112,15 @@ public class RmResourceGroupController extends BaseController
|
||||
{
|
||||
return R.ok(rmResourceGroupService.selectRmResourceGroupById(id));
|
||||
}
|
||||
/**
|
||||
* 获取资源分组详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:group:query")
|
||||
@PostMapping(value = "/exitsResourceById")
|
||||
public AjaxResult exitsResourceById(@RequestBody RmResourceGroup rmResourceGroup)
|
||||
{
|
||||
// 根据资源id查询该资源是否已经在资源组中
|
||||
String exits = rmResourceGroupService.exitsResourceById(rmResourceGroup);
|
||||
return success(exits);
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -73,4 +73,6 @@ public class RmEpsTopologyManagement extends BaseEntity
|
||||
private String updaterName;
|
||||
/** 交换机ip */
|
||||
private String switchIpAddress;
|
||||
/** 资源名称 */
|
||||
private String resourceName;
|
||||
}
|
||||
|
||||
@@ -60,5 +60,7 @@ public class RmResourceGroup extends BaseEntity
|
||||
private String monitorItems;
|
||||
/** 自动发现项 */
|
||||
private String discoveryRules;
|
||||
/** 资源id */
|
||||
private String resourceIds;
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -68,6 +68,9 @@ public class RmResourceRegistration extends BaseEntity
|
||||
/** SNMP采集地址 */
|
||||
@Excel(name = "SNMP采集地址")
|
||||
private String snmpCollectAddr;
|
||||
/** SNMP采集端口 */
|
||||
@Excel(name = "SNMP采集端口")
|
||||
private String snmpCollectPort;
|
||||
|
||||
/** 安全级别(1.authPriv、2.authNoPriv,3.noAuthNoPriv) */
|
||||
@Excel(name = "安全级别",readConverterExp = "1=authPriv,2=authNoPriv,3=noAuthNoPriv")
|
||||
|
||||
+2
@@ -66,4 +66,6 @@ public interface RmResourceGroupMapper
|
||||
* @return
|
||||
*/
|
||||
public RmResourceGroup selectMonitorMsgAndGroupMsg(Long id);
|
||||
|
||||
int exitsResourceById(RmResourceGroup rmResourceGroup);
|
||||
}
|
||||
|
||||
+2
@@ -62,4 +62,6 @@ public interface IRmResourceGroupService
|
||||
public int deleteRmResourceGroupById(Long id);
|
||||
|
||||
List<RmResourceRegistration> getRegisterList(RmResourceGroup rmResourceGroup);
|
||||
|
||||
String exitsResourceById(RmResourceGroup rmResourceGroup);
|
||||
}
|
||||
|
||||
+14
@@ -124,4 +124,18 @@ public class RmResourceGroupServiceImpl implements IRmResourceGroupService
|
||||
return rmResourceRegistrationList;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String exitsResourceById(RmResourceGroup rmResourceGroup) {
|
||||
String ids = rmResourceGroup.getResourceIds();
|
||||
StringBuilder resultStr = new StringBuilder();
|
||||
String[] idArray = ids.split(",");
|
||||
for (String s : idArray) {
|
||||
int rows = rmResourceGroupMapper.exitsResourceById(rmResourceGroup);
|
||||
if(rows > 0){
|
||||
resultStr.append(s);
|
||||
}
|
||||
}
|
||||
return resultStr.toString();
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -221,7 +221,6 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio
|
||||
private void sendRegistrationMessage(RmResourceRegistration registration) {
|
||||
String messageType = "1".equals(registration.getRegistrationStatus()) ? MsgEnum.注册.getValue() : MsgEnum.断开.getValue();
|
||||
ResourceVo resourceVo = createResourceVo(registration);
|
||||
|
||||
MessageVo messageVo = new MessageVo();
|
||||
messageVo.setClientId(registration.getHardwareSn());
|
||||
messageVo.setDataType(messageType);
|
||||
@@ -240,13 +239,14 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio
|
||||
resourceVo.setClientPort(Integer.valueOf(registration.getResourcePort()));
|
||||
|
||||
if (!"1".equals(registration.getResourceType())) {
|
||||
Map<String, String> switchMap = new HashMap<>();
|
||||
switchMap.put("community", registration.getTeamName());
|
||||
switchMap.put("ip", registration.getIpAddress());
|
||||
switchMap.put("port", registration.getResourcePort());
|
||||
resourceVo.setSwitchBoard(JSONObject.toJSONString(switchMap));
|
||||
if("1".equals(registration.getSnmpDetect())){
|
||||
Map<String, String> switchMap = new HashMap<>();
|
||||
switchMap.put("community", registration.getTeamName());
|
||||
switchMap.put("ip", registration.getSnmpCollectAddr());
|
||||
switchMap.put("port", registration.getSnmpCollectPort());
|
||||
resourceVo.setSwitchBoard(JSONObject.toJSONString(switchMap));
|
||||
}
|
||||
}
|
||||
|
||||
return resourceVo;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user