+my $clusters = YAML::LoadFile("src/${source}");
+my $servers = {};
+
+# Initialise cluster details
+while (my($name,$cluster) = each %$clusters)
+{
+ if ($cluster->{servers})
+ {
+ $cluster->{bandwidth} = 0;
+
+ while (my($name,$server) = each %{$cluster->{servers}})
+ {
+ $server->{cluster} = $cluster;
+ $cluster->{bandwidth} = $cluster->{bandwidth} + $server->{bandwidth};
+
+ $servers->{$name} = $server;
+ }
+ }
+ else
+ {
+ $servers->{$name} = {
+ cluster => $cluster,
+ pingdom => $cluster->{pingdom},
+ bandwidth => $cluster->{bandwidth}
+ };
+
+ $cluster->{servers} = {
+ $name => $servers->{$name}
+ };
+ }
+
+ $cluster->{name} = $name;
+
+ if ($ENV{PINGDOM_USERNAME} && $ENV{PINGDOM_PASSWORD})
+ {
+ $cluster->{status} = "down";
+ }
+ else
+ {
+ $cluster->{status} = "up";
+ }
+}