use of com.integrien.alive.common.adapter3.Relationships in project Server_Management_Plugin_vRealize by Huawei.
the class ESightAdapter method useResourceKey.
private void useResourceKey(DiscoveryResult discoveryResult, ResourceKey resourceKey) {
if (isNewResource(resourceKey)) {
discoveryResult.addResource(new ResourceConfig(resourceKey));
}
// Check if resource is part of monitored set, otherwise continue
ResourceConfig resourceConfig = getMonitoringResource(resourceKey);
if (resourceConfig == null) {
return;
}
// Add metrics
addMetricData(resourceConfig, metricsByResource.get(resourceKey));
// Add relationships
Relationships rel = new Relationships();
rel.setRelationships(resourceKey, relationshipsByResource.get(resourceKey), Collections.singleton(getAdapterKind()));
discoveryResult.addRelationships(rel);
}
use of com.integrien.alive.common.adapter3.Relationships in project Server_Management_Plugin_vRealize by Huawei.
the class ESightAdapter method configEsight.
private void configEsight(String hostIp) {
ResourceKey resourceKey = new ResourceKey(hostIp, Constant.KIND_HOST_INSTANCE, getAdapterKind());
long timestamp = System.currentTimeMillis();
List<MetricData> metricDataList = new ArrayList<>();
// 设置eSight服务器的状态为离线状态
metricDataList.add(new MetricData(new MetricKey(false, Constant.ATTR_HEALTHSTATE), timestamp, ConvertUtils.convertHealthState(-1)));
metricsByResource.put(resourceKey, metricDataList);
DiscoveryResult discoveryResult = collectResult.getDiscoveryResult(true);
if (isNewResource(resourceKey)) {
discoveryResult.addResource(new ResourceConfig(resourceKey));
}
// Check if resource is part of monitored set, otherwise continue
ResourceConfig resourceConfig = getMonitoringResource(resourceKey);
if (resourceConfig == null) {
return;
}
// Add metrics
addMetricData(resourceConfig, metricsByResource.get(resourceKey));
// Add relationships
Relationships rel = new Relationships();
rel.setRelationships(resourceKey, relationshipsByResource.get(resourceKey), Collections.singleton(getAdapterKind()));
discoveryResult.addRelationships(rel);
return;
}
Aggregations