use of com.netflix.simianarmy.conformity.Conformity in project SimianArmy by Netflix.
the class BasicConformityEmailBuilder method getEntryTable.
@Override
protected String getEntryTable(String emailAddress) {
StringBuilder table = new StringBuilder();
table.append(getHtmlTableHeader(getTableColumns()));
for (Cluster cluster : emailToClusters.get(emailAddress)) {
for (Conformity conformity : cluster.getConformties()) {
if (!conformity.getFailedComponents().isEmpty()) {
table.append(getClusterRow(cluster, conformity));
}
}
}
table.append("</table>");
return table.toString();
}
use of com.netflix.simianarmy.conformity.Conformity in project SimianArmy by Netflix.
the class CrossZoneLoadBalancing method check.
@Override
public Conformity check(Cluster cluster) {
Collection<String> failedComponents = Lists.newArrayList();
for (AutoScalingGroup asg : cluster.getAutoScalingGroups()) {
try {
for (String lbName : getLoadBalancerNamesForAsg(cluster.getRegion(), asg.getName())) {
if (!isCrossZoneLoadBalancingEnabled(cluster.getRegion(), lbName)) {
LOGGER.info(String.format("ELB %s in %s does not have cross-zone load balancing enabled", lbName, cluster.getRegion()));
failedComponents.add(lbName);
}
}
} catch (MonkeyRestClient.DataReadException e) {
LOGGER.error(String.format("Transient error reading ELB for %s in %s - skipping this check", asg.getName(), cluster.getRegion()), e);
}
}
return new Conformity(getName(), failedComponents);
}
use of com.netflix.simianarmy.conformity.Conformity in project SimianArmy by Netflix.
the class InstanceIsHealthyInEureka method check.
@Override
public Conformity check(Cluster cluster) {
Collection<String> failedComponents = Lists.newArrayList();
for (AutoScalingGroup asg : cluster.getAutoScalingGroups()) {
// ignore suspended ASGs
if (asg.isSuspended()) {
LOGGER.info(String.format("ASG %s is suspended, ignore.", asg.getName()));
continue;
}
for (String instance : asg.getInstances()) {
if (!conformityEurekaClient.isHealthy(cluster.getRegion(), instance)) {
LOGGER.info(String.format("Instance %s is not healthy in Eureka.", instance));
failedComponents.add(instance);
}
}
}
return new Conformity(getName(), failedComponents);
}
use of com.netflix.simianarmy.conformity.Conformity in project SimianArmy by Netflix.
the class InstanceTooOld method check.
@Override
public Conformity check(Cluster cluster) {
List<String> instanceIds = Lists.newArrayList();
for (AutoScalingGroup asg : cluster.getAutoScalingGroups()) {
instanceIds.addAll(asg.getInstances());
}
Map<String, Long> instanceIdToLaunchTime = getInstanceLaunchTimes(cluster.getRegion(), instanceIds.toArray(new String[instanceIds.size()]));
Collection<String> failedComponents = Lists.newArrayList();
long creationTimeThreshold = DateTime.now().minusDays(instanceAgeThreshold).getMillis();
for (Map.Entry<String, Long> entry : instanceIdToLaunchTime.entrySet()) {
String instanceId = entry.getKey();
if (creationTimeThreshold > entry.getValue()) {
LOGGER.info(String.format("Instance %s was created more than %d days ago", instanceId, instanceAgeThreshold));
failedComponents.add(instanceId);
}
}
return new Conformity(getName(), failedComponents);
}
use of com.netflix.simianarmy.conformity.Conformity in project SimianArmy by Netflix.
the class SameZonesInElbAndAsg method check.
@Override
public Conformity check(Cluster cluster) {
List<String> asgNames = Lists.newArrayList();
for (AutoScalingGroup asg : cluster.getAutoScalingGroups()) {
asgNames.add(asg.getName());
}
Collection<String> failedComponents = Lists.newArrayList();
for (AutoScalingGroup asg : cluster.getAutoScalingGroups()) {
List<String> asgZones = getAvailabilityZonesForAsg(cluster.getRegion(), asg.getName());
for (String lbName : getLoadBalancerNamesForAsg(cluster.getRegion(), asg.getName())) {
List<String> lbZones = getAvailabilityZonesForLoadBalancer(cluster.getRegion(), lbName);
if (!haveSameZones(asgZones, lbZones)) {
LOGGER.info(String.format("ASG %s and ELB %s do not have the same availability zones", asgZones, lbZones));
failedComponents.add(lbName);
}
}
}
return new Conformity(getName(), failedComponents);
}
Aggregations