adjust prometheus kubernetes perfdata

This commit is contained in:
Colin Gagnaire 2019-06-07 14:26:29 +02:00
parent 35469b2ba0
commit a5fd7fb3a7
5 changed files with 17 additions and 17 deletions

View File

@ -68,7 +68,7 @@ sub set_counters {
closure_custom_threshold_check => \&catalog_status_threshold, closure_custom_threshold_check => \&catalog_status_threshold,
} }
}, },
{ label => 'restarts-count', nlabel => 'kubernetes.container.restarts.count', set => { { label => 'restarts-count', nlabel => 'containers.restarts.count', set => {
key_values => [ { name => 'restarts' }, { name => 'perf' } ], key_values => [ { name => 'restarts' }, { name => 'perf' } ],
output_template => 'Restarts count : %d', output_template => 'Restarts count : %d',
perfdatas => [ perfdatas => [

View File

@ -28,46 +28,46 @@ use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold)
sub custom_status_perfdata { sub custom_status_perfdata {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'desired', label => 'desired',
nlabel => 'kubernetes.daemonset.nodes.desired.count', nlabel => 'daemonset.nodes.desired.count',
value => $self->{result_values}->{desired}, value => $self->{result_values}->{desired},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
); );
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'current', label => 'current',
nlabel => 'kubernetes.daemonset.nodes.current.count', nlabel => 'daemonset.nodes.current.count',
value => $self->{result_values}->{current}, value => $self->{result_values}->{current},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
); );
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'available', label => 'available',
nlabel => 'kubernetes.daemonset.nodes.available.count', nlabel => 'daemonset.nodes.available.count',
value => $self->{result_values}->{available}, value => $self->{result_values}->{available},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
); );
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'unavailable', label => 'unavailable',
nlabel => 'kubernetes.daemonset.nodes.unavailable.count', nlabel => 'daemonset.nodes.unavailable.count',
value => $self->{result_values}->{unavailable}, value => $self->{result_values}->{unavailable},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
); );
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'up_to_date', label => 'up_to_date',
nlabel => 'kubernetes.daemonset.nodes.uptodate.count', nlabel => 'daemonset.nodes.uptodate.count',
value => $self->{result_values}->{up_to_date}, value => $self->{result_values}->{up_to_date},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
); );
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'ready', label => 'ready',
nlabel => 'kubernetes.daemonset.nodes.ready.count', nlabel => 'daemonset.nodes.ready.count',
value => $self->{result_values}->{ready}, value => $self->{result_values}->{ready},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
); );
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'misscheduled', label => 'misscheduled',
nlabel => 'kubernetes.daemonset.nodes.misscheduled.count', nlabel => 'daemonset.nodes.misscheduled.count',
value => $self->{result_values}->{misscheduled}, value => $self->{result_values}->{misscheduled},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
); );

View File

@ -31,31 +31,31 @@ sub custom_status_perfdata {
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'desired', label => 'desired',
nlabel => 'kubernetes.deployment.replicas.desired.count', nlabel => 'deployment.replicas.desired.count',
value => $self->{result_values}->{desired}, value => $self->{result_values}->{desired},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
); );
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'current', label => 'current',
nlabel => 'kubernetes.deployment.replicas.current.count', nlabel => 'deployment.replicas.current.count',
value => $self->{result_values}->{current}, value => $self->{result_values}->{current},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
); );
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'available', label => 'available',
nlabel => 'kubernetes.deployment.replicas.available.count', nlabel => 'deployment.replicas.available.count',
value => $self->{result_values}->{available}, value => $self->{result_values}->{available},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
); );
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'unavailable', label => 'unavailable',
nlabel => 'kubernetes.deployment.replicas.unavailable.count', nlabel => 'deployment.replicas.unavailable.count',
value => $self->{result_values}->{unavailable}, value => $self->{result_values}->{unavailable},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
); );
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'up_to_date', label => 'up_to_date',
nlabel => 'kubernetes.deployment.replicas.uptodate.count', nlabel => 'deployment.replicas.uptodate.count',
value => $self->{result_values}->{up_to_date}, value => $self->{result_values}->{up_to_date},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
); );

View File

@ -51,7 +51,7 @@ sub set_counters {
]; ];
$self->{maps_counters}->{global} = [ $self->{maps_counters}->{global} = [
{ label => 'active', nlabel => 'kubernetes.namespace.active.count', set => { { label => 'active', nlabel => 'namespaces.active.count', set => {
key_values => [ { name => 'active' } ], key_values => [ { name => 'active' } ],
output_template => 'Active : %d', output_template => 'Active : %d',
perfdatas => [ perfdatas => [
@ -60,7 +60,7 @@ sub set_counters {
], ],
} }
}, },
{ label => 'terminating', nlabel => 'kubernetes.namespace.terminating.count', set => { { label => 'terminating', nlabel => 'namespaces.terminating.count', set => {
key_values => [ { name => 'terminating' } ], key_values => [ { name => 'terminating' } ],
output_template => 'Terminating : %d', output_template => 'Terminating : %d',
perfdatas => [ perfdatas => [

View File

@ -58,7 +58,7 @@ sub custom_usage_perfdata {
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => $label, label => $label,
nlabel => 'kubernetes.pods.allocated.count', nlabel => 'pods.allocated.count',
value => $value_perf, value => $value_perf,
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}, %total_options), warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}, %total_options),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}, %total_options), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}, %total_options),