~vcs-imports/mysql-mmm/2.0

« back to all changes in this revision

Viewing changes to lib/Monitor/Agents.pm

  • Committer: mail at pascalhofmann
  • Date: 2009-05-20 13:06:24 UTC
  • Revision ID: vcs-imports@canonical.com-20090520130624-uzrm6naivl5udkli
mmm2:
- Show unreachable agents in "mmm_control status" output.
- Flag unreachable agents on startup to prevent assignment of roles when monitor is set active.
- Improved logging
- Documentation update

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
 
127
127
sub get_status_info($) {
128
128
        my $self        = shift;
 
129
        my $detailed= shift || 0;
129
130
        my $res         = '';
 
131
        my $agent_res = '';
130
132
 
131
133
        keys (%$self); # reset iterator
132
134
        foreach my $host (sort(keys(%$self))) {
133
135
                my $agent = $self->{$host};
134
136
                next unless $agent;
135
 
                $res .= sprintf("  %s(%s) %s/%s. Roles: %s\n", $host, $agent->ip, $agent->mode, $agent->state, join(', ', sort(@{$agent->roles})));
 
137
                $agent_res      .= "# Warning: agent on host $host is not reachable\n" if ($agent->agent_down());
 
138
                $res            .= sprintf("  %s(%s) %s/%s. Roles: %s\n", $host, $agent->ip, $agent->mode, $agent->state, join(', ', sort(@{$agent->roles})));
136
139
        }
 
140
        $res = $agent_res . $res if ($detailed);
137
141
        return $res;
138
142
}
139
143