Search in sources :

Example 1 with MonitoringAuthConfig

use of com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringAuthConfig in project cloudbreak by hortonworks.

the class TelemetryDecorator method setupMonitoring.

private void setupMonitoring(Map<String, SaltPillarProperties> servicePillar, boolean cdpSaasEnabled, Stack stack, Telemetry telemetry, char[] passwordInput) {
    if (telemetry.isMonitoringFeatureEnabled()) {
        LOGGER.debug("Filling monitoring configs.");
        MonitoringAuthConfig cmAuthConfig = null;
        if (stack.getCluster() != null && stack.getCluster().getCloudbreakClusterManagerMonitoringUser() != null && stack.getCluster().getCloudbreakClusterManagerMonitoringPassword() != null) {
            String cmMonitoringUser = stack.getCluster().getCloudbreakClusterManagerMonitoringUser();
            char[] cmMonitoringPassword = stack.getCluster().getCloudbreakClusterManagerMonitoringPassword().toCharArray();
            cmAuthConfig = new MonitoringAuthConfig(cmMonitoringUser, cmMonitoringPassword);
        }
        MonitoringConfigView monitoringConfigView = monitoringConfigService.createMonitoringConfig(telemetry.getMonitoring(), MonitoringClusterType.CLOUDERA_MANAGER, cmAuthConfig, passwordInput, cdpSaasEnabled);
        if (monitoringConfigView.isEnabled()) {
            Map<String, Object> monitoringConfig = monitoringConfigView.toMap();
            servicePillar.put("monitoring", new SaltPillarProperties("/monitoring/init.sls", singletonMap("monitoring", monitoringConfig)));
        }
    } else {
        LOGGER.debug("CDP Saas is not enabled, do not use monitoring features");
    }
}
Also used : MonitoringAuthConfig(com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringAuthConfig) MonitoringConfigView(com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfigView) SaltPillarProperties(com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)

Example 2 with MonitoringAuthConfig

use of com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringAuthConfig in project cloudbreak by hortonworks.

the class TelemetryDecorator method setupMonitoring.

private void setupMonitoring(Map<String, SaltPillarProperties> servicePillar, Stack stack, TelemetryClusterDetails clusterDetails) {
    if (stack.getCluster() != null && stack.getCluster().getCloudbreakClusterManagerMonitoringUser() != null && stack.getCluster().getCloudbreakClusterManagerMonitoringPassword() != null) {
        String monitoringUser = stack.getCluster().getCloudbreakClusterManagerMonitoringUser();
        char[] monitoringPassword = stack.getCluster().getCloudbreakClusterManagerMonitoringPassword().toCharArray();
        MonitoringAuthConfig authConfig = new MonitoringAuthConfig(monitoringUser, monitoringPassword);
        MonitoringConfigView monitoringConfigView = monitoringConfigService.createMonitoringConfig(MonitoringClusterType.CLOUDERA_MANAGER, authConfig);
        if (monitoringConfigView.isEnabled()) {
            Map<String, Object> monitoringConfig = monitoringConfigView.toMap();
            servicePillar.put("monitoring", new SaltPillarProperties("/monitoring/init.sls", singletonMap("monitoring", monitoringConfig)));
        }
    }
}
Also used : MonitoringAuthConfig(com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringAuthConfig) MonitoringConfigView(com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfigView) SaltPillarProperties(com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)

Aggregations

SaltPillarProperties (com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)2 MonitoringAuthConfig (com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringAuthConfig)2 MonitoringConfigView (com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfigView)2