use of com.emc.vipr.model.sys.healthmonitor.NodeHealth in project coprhd-controller by CoprHD.
the class SystemHealth method logs.
public static void logs() {
List<NodeHealth> nodeHealthList = MonitorUtils.getNodeHealth();
ClusterInfo clusterInfo = AdminDashboardUtils.getClusterInfo();
renderArgs.put("severities", SEVERITIES);
if (DisasterRecoveryUtils.isActiveSite()) {
renderArgs.put("orderTypes", ORDER_TYPES);
}
Set<String> controlServiceNames = getControlServiceNames(nodeHealthList, clusterInfo);
renderArgs.put("controlServices", controlServiceNames);
Set<String> allServiceNames = getAllServiceNames(nodeHealthList);
renderArgs.put("allServices", allServiceNames);
List<NodeHealth> controlNodes = getControlNodes(nodeHealthList, clusterInfo);
renderArgs.put("controlNodes", controlNodes);
DateTime defaultStartTime = new DateTime().minusMinutes(15);
// Remove some logs from the default list
Set<String> defaultServiceNames = Sets.newHashSet(allServiceNames);
defaultServiceNames.remove(SystemLogUtils.MESSAGES_LOG);
defaultServiceNames.remove(SystemLogUtils.NGINX_ACCESS_LOG);
defaultServiceNames.remove(SystemLogUtils.NGINX_ERROR_LOG);
renderArgs.put("allDiagnosticOptions", getDiagnosticOptions());
renderArgs.put("defaultDiagnosticOptions", getDefaultDiagnosticOptions().values());
loadSystemLogArgument(PARAM_NODE_ID, null);
loadSystemLogArgument(PARAM_SERVICE, defaultServiceNames, String[].class);
loadSystemLogArgument(PARAM_SEVERITY, DEFAULT_SEVERITY);
loadSystemLogArgument(PARAM_SEARCH_MESSAGE, null);
loadSystemLogArgument(PARAM_START_TIME, defaultStartTime.getMillis(), Long.class);
Common.copyRenderArgsToAngular();
render();
}
use of com.emc.vipr.model.sys.healthmonitor.NodeHealth in project coprhd-controller by CoprHD.
the class SystemHealth method renderNodeDetailsJson.
public static void renderNodeDetailsJson(String nodeId) {
NodeStats nodeStats = MonitorUtils.getNodeStats(nodeId);
NodeHealth nodeHealth = MonitorUtils.getNodeHealth(nodeId);
Map<String, Object> healthDetails = Maps.newHashMap();
if (nodeStats != null && nodeHealth != null) {
healthDetails = healthDetails(nodeStats, nodeHealth);
}
renderJSON(healthDetails);
}
use of com.emc.vipr.model.sys.healthmonitor.NodeHealth in project coprhd-controller by CoprHD.
the class SystemHealth method minorityNodeRecovery.
@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void minorityNodeRecovery() {
new MinorityNodeRecoveryJob(getSysClient()).in(3);
ViPRSystemClient client = BourneUtil.getSysClient();
List<NodeHealth> nodeHealthList = MonitorUtils.getNodeHealth();
ClusterInfo clusterInfo = AdminDashboardUtils.getClusterInfo();
if (PlatformUtils.isVMwareVapp()) {
RecoveryPrecheckStatus recoveryPrecheckStatus = client.control().getRecoveryPrecheckStatus();
String recoveringMsg = Messages.get("nodeRecovery.recovering.status", recoveryPrecheckStatus.getRecoverables().toString());
renderArgs.put("recoveringMsg", recoveringMsg);
}
RecoveryStatus recoveryStatus = client.control().getRecoveryStatus();
renderArgs.put("nodeHealthList", nodeHealthList);
renderArgs.put("clusterInfo", clusterInfo);
renderArgs.put("recoveryStatus", recoveryStatus);
if (PlatformUtils.isVMwareVapp()) {
render("@nodeRecoveryVapp");
} else {
render("@nodeRecovery");
}
}
use of com.emc.vipr.model.sys.healthmonitor.NodeHealth in project coprhd-controller by CoprHD.
the class TaskUtils method getTaskLogs.
public static List<LogMessage> getTaskLogs(TaskResourceRep task) {
if (task == null) {
return null;
}
ViPRSystemClient systemClient = BourneUtil.getSysClient();
List<String> nodeIds = Lists.newArrayList();
List<NodeHealth> nodeHealthList = systemClient.health().getHealth().getNodeHealthList();
if (nodeHealthList != null) {
for (NodeHealth nodeHealth : nodeHealthList) {
if (nodeHealth != null) {
nodeIds.add(nodeHealth.getNodeId());
}
}
}
String start = null;
if (task.getStartTime() != null) {
start = Long.toString(task.getStartTime().getTimeInMillis());
}
String end = null;
if (task.getEndTime() != null) {
end = Long.toString(task.getEndTime().getTimeInMillis());
}
String regex = "(?i).*" + task.getOpId() + ".*";
final List<LogMessage> logMessages = Lists.newArrayList();
LogMessageProcessor processor = new LogMessageProcessor() {
@Override
public void processItem(LogMessage logMessage) throws Exception {
logMessages.add(logMessage);
}
};
systemClient.logs().getAsItems(processor, nodeIds, null, LOG_NAMES, LOG_SEVERITY, start, end, regex, LOGS_MAX_COUNT);
return logMessages;
}
use of com.emc.vipr.model.sys.healthmonitor.NodeHealth in project coprhd-controller by CoprHD.
the class SupportPackageCreator method getSelectedNodeIds.
private Map<String, String> getSelectedNodeIds() {
Map<String, String> activeNodeIds = Maps.newTreeMap();
for (NodeHealth activeNode : MonitorUtils.getNodeHealth(api())) {
if (!StringUtils.containsIgnoreCase(activeNode.getStatus(), "unavailable") || Play.mode.isDev()) {
activeNodeIds.put(activeNode.getNodeId(), activeNode.getNodeName());
}
}
Map<String, String> selectedNodeIds = Maps.newTreeMap();
if ((nodeIds == null) || nodeIds.isEmpty()) {
selectedNodeIds.putAll(activeNodeIds);
} else {
for (String node : nodeIds) {
if (activeNodeIds.containsKey(node))
selectedNodeIds.put(node, activeNodeIds.get(node));
}
}
return selectedNodeIds;
}
Aggregations