fix some indents
This commit is contained in:
parent
58a70c0c2c
commit
4eb7912fff
|
@ -30,10 +30,9 @@ sub new {
|
|||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||
bless $self, $class;
|
||||
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"warning:s" => { name => 'warning', default => '' },
|
||||
"critical:s" => { name => 'critical', default => '' },
|
||||
$options{options}->add_options(arguments => {
|
||||
'warning:s' => { name => 'warning', default => '' },
|
||||
'critical:s' => { name => 'critical', default => '' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -30,10 +30,9 @@ sub new {
|
|||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||
bless $self, $class;
|
||||
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"warning:s" => { name => 'warning' },
|
||||
"critical:s" => { name => 'critical' },
|
||||
$options{options}->add_options(arguments => {
|
||||
'warning:s' => { name => 'warning' },
|
||||
'critical:s' => { name => 'critical' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -63,7 +63,8 @@ sub custom_metric_perfdata {
|
|||
my $extra_label = '';
|
||||
$extra_label = '_' . lc($self->{result_values}->{display}) if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
||||
|
||||
$self->{output}->perfdata_add(label => lc($self->{result_values}->{metric}) . "_" . lc($self->{result_values}->{stat}) . $extra_label,
|
||||
$self->{output}->perfdata_add(
|
||||
label => lc($self->{result_values}->{metric}) . "_" . lc($self->{result_values}->{stat}) . $extra_label,
|
||||
unit => defined($self->{instance_mode}->{option_results}->{per_sec}) ? 'B/s' : 'B',
|
||||
value => sprintf("%.2f", defined($self->{instance_mode}->{option_results}->{per_sec}) ? $self->{result_values}->{value_per_sec} : $self->{result_values}->{value}),
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . lc($self->{result_values}->{metric}) . "-" . lc($self->{result_values}->{stat})),
|
||||
|
@ -94,7 +95,8 @@ sub set_counters {
|
|||
|
||||
foreach my $statistic ('minimum', 'maximum', 'average', 'sum') {
|
||||
foreach my $metric ('ReplicationBytes') {
|
||||
my $entry = { label => lc($metric) . '-' . lc($statistic), set => {
|
||||
my $entry = {
|
||||
label => lc($metric) . '-' . lc($statistic), set => {
|
||||
key_values => [ { name => $metric . '_' . $statistic }, { name => 'display' }, { name => 'stat' }, { name => 'timeframe' } ],
|
||||
closure_custom_calc => $self->can('custom_metric_calc'),
|
||||
closure_custom_calc_extra_options => { metric => $metric, stat => $statistic },
|
||||
|
@ -106,7 +108,8 @@ sub set_counters {
|
|||
push @{$self->{maps_counters}->{metric}}, $entry;
|
||||
}
|
||||
foreach my $metric ('ReplicationLag') {
|
||||
my $entry = { label => lc($metric) . '-' . lc($statistic), set => {
|
||||
my $entry = {
|
||||
label => lc($metric) . '-' . lc($statistic), set => {
|
||||
key_values => [ { name => $metric . '_' . $statistic }, { name => 'display' }, { name => 'stat' }, { name => 'timeframe' } ],
|
||||
output_template => $metric . ': %.2f s',
|
||||
perfdatas => [
|
||||
|
@ -126,10 +129,10 @@ sub new {
|
|||
bless $self, $class;
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
"name:s@" => { name => 'name' },
|
||||
"node-id:s" => { name => 'node_id' },
|
||||
"filter-metric:s" => { name => 'filter_metric' },
|
||||
"per-sec" => { name => 'per_sec' },
|
||||
'name:s@' => { name => 'name' },
|
||||
'node-id:s' => { name => 'node_id' },
|
||||
'filter-metric:s' => { name => 'filter_metric' },
|
||||
'per-sec' => { name => 'per_sec' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
Loading…
Reference in New Issue