use of com.sequenceiq.node.health.client.model.CdpNodeStatuses in project cloudbreak by hortonworks.
the class NodeStatusCheckerJob method executeNodeStatusCheck.
private void executeNodeStatusCheck(Stack stack) {
boolean nodeStatusCheckEnabled = true;
CdpNodeStatusRequest.Builder requestBuilder = CdpNodeStatusRequest.Builder.builder();
String accountId = Crn.safeFromString(stack.getResourceCrn()).getAccountId();
if (StackType.WORKLOAD.equals(stack.getType())) {
nodeStatusCheckEnabled = entitlementService.datahubNodestatusCheckEnabled(accountId);
}
if (nodeStatusCheckEnabled) {
if (StackType.WORKLOAD.equals(stack.getType())) {
requestBuilder.withMetering(true);
}
CdpNodeStatusRequest request = requestBuilder.withCmMonitoring(true).withSkipObjectMapping(true).build();
CdpNodeStatuses statuses = nodeStatusService.getNodeStatuses(stack, request);
processNodeStatusReport(statuses.getNetworkReport(), NodeStatusProto.NodeStatus::getNetworkDetails, stack, "Network");
processNodeStatusReport(statuses.getServicesReport(), NodeStatusProto.NodeStatus::getServicesDetails, stack, "Services");
processNodeStatusReport(statuses.getSystemMetricsReport(), NodeStatusProto.NodeStatus::getSystemMetrics, stack, "System metrics");
processCmMetricsReport(statuses.getCmMetricsReport(), stack);
}
}
use of com.sequenceiq.node.health.client.model.CdpNodeStatuses in project cloudbreak by hortonworks.
the class NodeStatusJob method checkNodeHealthReports.
private void checkNodeHealthReports(Stack stack, Set<InstanceMetaData> checkableInstances) {
for (InstanceMetaData instanceMetaData : checkableInstances) {
try {
CdpNodeStatuses nodeStatuses = checkedMeasure(() -> freeIpaNodeStatusService.nodeStatusReport(stack, instanceMetaData), LOGGER, "FreeIPA node status job checks ran in {}ms");
LOGGER.debug("Fetching node health reports for instance: {}", instanceMetaData.getInstanceId());
if (nodeStatuses.getNetworkReport().isPresent()) {
logReportResult(instanceMetaData, nodeStatuses.getNetworkReport().get(), "network");
}
if (nodeStatuses.getServicesReport().isPresent()) {
logReportResult(instanceMetaData, nodeStatuses.getServicesReport().get(), "services");
}
if (nodeStatuses.getSystemMetricsReport().isPresent()) {
logReportResult(instanceMetaData, nodeStatuses.getServicesReport().get(), "system metrics");
}
} catch (Exception e) {
LOGGER.info("FreeIpaClientException occurred during node status check: " + e.getMessage(), e);
}
}
}
Aggregations