Search in sources :

Example 11 with NodeHealth

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();
}
Also used : ClusterInfo(com.emc.vipr.model.sys.ClusterInfo) DateTime(org.joda.time.DateTime) NodeHealth(com.emc.vipr.model.sys.healthmonitor.NodeHealth)

Example 12 with NodeHealth

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);
}
Also used : NodeStats(com.emc.vipr.model.sys.healthmonitor.NodeStats) JsonObject(com.google.gson.JsonObject) NodeHealth(com.emc.vipr.model.sys.healthmonitor.NodeHealth)

Example 13 with NodeHealth

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");
    }
}
Also used : MinorityNodeRecoveryJob(jobs.MinorityNodeRecoveryJob) ViPRSystemClient(com.emc.vipr.client.ViPRSystemClient) ClusterInfo(com.emc.vipr.model.sys.ClusterInfo) RecoveryPrecheckStatus(com.emc.vipr.model.sys.recovery.RecoveryPrecheckStatus) RecoveryStatus(com.emc.vipr.model.sys.recovery.RecoveryStatus) NodeHealth(com.emc.vipr.model.sys.healthmonitor.NodeHealth) Restrictions(controllers.deadbolt.Restrictions)

Example 14 with NodeHealth

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;
}
Also used : ViPRSystemClient(com.emc.vipr.client.ViPRSystemClient) LogMessageProcessor(com.emc.vipr.client.system.LogMessageProcessor) LogMessage(com.emc.vipr.model.sys.logging.LogMessage) NodeHealth(com.emc.vipr.model.sys.healthmonitor.NodeHealth)

Example 15 with NodeHealth

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;
}
Also used : NodeHealth(com.emc.vipr.model.sys.healthmonitor.NodeHealth)

Aggregations

NodeHealth (com.emc.vipr.model.sys.healthmonitor.NodeHealth)15 ViPRSystemClient (com.emc.vipr.client.ViPRSystemClient)3 NodeStats (com.emc.vipr.model.sys.healthmonitor.NodeStats)3 ClusterInfo (com.emc.vipr.model.sys.ClusterInfo)2 ServiceHealth (com.emc.vipr.model.sys.healthmonitor.ServiceHealth)2 Restrictions (controllers.deadbolt.Restrictions)2 NodesDataTable (models.datatable.NodesDataTable)2 Test (org.junit.Test)2 DualInetAddress (com.emc.storageos.coordinator.client.service.impl.DualInetAddress)1 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)1 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)1 NodeInfo (com.emc.storageos.systemservices.impl.resource.util.NodeInfo)1 LogMessageProcessor (com.emc.vipr.client.system.LogMessageProcessor)1 HealthRestRep (com.emc.vipr.model.sys.healthmonitor.HealthRestRep)1 LogMessage (com.emc.vipr.model.sys.logging.LogMessage)1 RecoveryPrecheckStatus (com.emc.vipr.model.sys.recovery.RecoveryPrecheckStatus)1 RecoveryStatus (com.emc.vipr.model.sys.recovery.RecoveryStatus)1 JsonObject (com.google.gson.JsonObject)1 ArrayList (java.util.ArrayList)1 MinorityNodeRecoveryJob (jobs.MinorityNodeRecoveryJob)1