use of com.netflix.simianarmy.conformity.AutoScalingGroup in project SimianArmy by Netflix.
the class InstanceHasHealthCheckUrl method check.
@Override
public Conformity check(Cluster cluster) {
Collection<String> failedComponents = Lists.newArrayList();
for (AutoScalingGroup asg : cluster.getAutoScalingGroups()) {
if (asg.isSuspended()) {
continue;
}
for (String instance : asg.getInstances()) {
if (!conformityEurekaClient.hasHealthCheckUrl(cluster.getRegion(), instance)) {
LOGGER.info(String.format("Instance %s does not have health check url in discovery.", instance));
failedComponents.add(instance);
}
}
}
return new Conformity(getName(), failedComponents);
}
use of com.netflix.simianarmy.conformity.AutoScalingGroup in project SimianArmy by Netflix.
the class InstanceHasStatusUrl method check.
@Override
public Conformity check(Cluster cluster) {
Collection<String> failedComponents = Lists.newArrayList();
for (AutoScalingGroup asg : cluster.getAutoScalingGroups()) {
if (asg.isSuspended()) {
continue;
}
for (String instance : asg.getInstances()) {
if (!conformityEurekaClient.hasStatusUrl(cluster.getRegion(), instance)) {
LOGGER.info(String.format("Instance %s does not have a status page url in discovery.", instance));
failedComponents.add(instance);
}
}
}
return new Conformity(getName(), failedComponents);
}
use of com.netflix.simianarmy.conformity.AutoScalingGroup in project SimianArmy by Netflix.
the class InstanceInSecurityGroup method check.
@Override
public Conformity check(Cluster cluster) {
List<String> instanceIds = Lists.newArrayList();
for (AutoScalingGroup asg : cluster.getAutoScalingGroups()) {
instanceIds.addAll(asg.getInstances());
}
Collection<String> failedComponents = Lists.newArrayList();
if (instanceIds.size() != 0) {
Map<String, List<String>> instanceIdToSecurityGroup = getInstanceSecurityGroups(cluster.getRegion(), instanceIds.toArray(new String[instanceIds.size()]));
for (Map.Entry<String, List<String>> entry : instanceIdToSecurityGroup.entrySet()) {
String instanceId = entry.getKey();
if (!checkSecurityGroups(entry.getValue())) {
LOGGER.info(String.format("Instance %s does not have all required security groups", instanceId));
failedComponents.add(instanceId);
}
}
}
return new Conformity(getName(), failedComponents);
}
use of com.netflix.simianarmy.conformity.AutoScalingGroup in project SimianArmy by Netflix.
the class InstanceInVPC method check.
@Override
public Conformity check(Cluster cluster) {
Collection<String> failedComponents = Lists.newArrayList();
//check all instances
Set<String> failedInstances = checkInstancesInVPC(cluster.getRegion(), cluster.getSoloInstances());
failedComponents.addAll(failedInstances);
//check asg instances
for (AutoScalingGroup asg : cluster.getAutoScalingGroups()) {
if (asg.isSuspended()) {
continue;
}
Set<String> asgFailedInstances = checkInstancesInVPC(cluster.getRegion(), asg.getInstances());
failedComponents.addAll(asgFailedInstances);
}
return new Conformity(getName(), failedComponents);
}
use of com.netflix.simianarmy.conformity.AutoScalingGroup 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);
}
Aggregations