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,
}
},
{ label => 'restarts-count', nlabel => 'kubernetes.container.restarts.count', set => {
{ label => 'restarts-count', nlabel => 'containers.restarts.count', set => {
key_values => [ { name => 'restarts' }, { name => 'perf' } ],
output_template => 'Restarts count : %d',
perfdatas => [

View File

@ -28,46 +28,46 @@ use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold)
sub custom_status_perfdata {
my ($self, %options) = @_;
$self->{output}->perfdata_add(
label => 'desired',
nlabel => 'kubernetes.daemonset.nodes.desired.count',
nlabel => 'daemonset.nodes.desired.count',
value => $self->{result_values}->{desired},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
);
$self->{output}->perfdata_add(
label => 'current',
nlabel => 'kubernetes.daemonset.nodes.current.count',
nlabel => 'daemonset.nodes.current.count',
value => $self->{result_values}->{current},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
);
$self->{output}->perfdata_add(
label => 'available',
nlabel => 'kubernetes.daemonset.nodes.available.count',
nlabel => 'daemonset.nodes.available.count',
value => $self->{result_values}->{available},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
);
$self->{output}->perfdata_add(
label => 'unavailable',
nlabel => 'kubernetes.daemonset.nodes.unavailable.count',
nlabel => 'daemonset.nodes.unavailable.count',
value => $self->{result_values}->{unavailable},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
);
$self->{output}->perfdata_add(
label => 'up_to_date',
nlabel => 'kubernetes.daemonset.nodes.uptodate.count',
nlabel => 'daemonset.nodes.uptodate.count',
value => $self->{result_values}->{up_to_date},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
);
$self->{output}->perfdata_add(
label => 'ready',
nlabel => 'kubernetes.daemonset.nodes.ready.count',
nlabel => 'daemonset.nodes.ready.count',
value => $self->{result_values}->{ready},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
);
$self->{output}->perfdata_add(
label => 'misscheduled',
nlabel => 'kubernetes.daemonset.nodes.misscheduled.count',
nlabel => 'daemonset.nodes.misscheduled.count',
value => $self->{result_values}->{misscheduled},
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(
label => 'desired',
nlabel => 'kubernetes.deployment.replicas.desired.count',
nlabel => 'deployment.replicas.desired.count',
value => $self->{result_values}->{desired},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
);
$self->{output}->perfdata_add(
label => 'current',
nlabel => 'kubernetes.deployment.replicas.current.count',
nlabel => 'deployment.replicas.current.count',
value => $self->{result_values}->{current},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
);
$self->{output}->perfdata_add(
label => 'available',
nlabel => 'kubernetes.deployment.replicas.available.count',
nlabel => 'deployment.replicas.available.count',
value => $self->{result_values}->{available},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
);
$self->{output}->perfdata_add(
label => 'unavailable',
nlabel => 'kubernetes.deployment.replicas.unavailable.count',
nlabel => 'deployment.replicas.unavailable.count',
value => $self->{result_values}->{unavailable},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
);
$self->{output}->perfdata_add(
label => 'up_to_date',
nlabel => 'kubernetes.deployment.replicas.uptodate.count',
nlabel => 'deployment.replicas.uptodate.count',
value => $self->{result_values}->{up_to_date},
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} = [
{ label => 'active', nlabel => 'kubernetes.namespace.active.count', set => {
{ label => 'active', nlabel => 'namespaces.active.count', set => {
key_values => [ { name => 'active' } ],
output_template => 'Active : %d',
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' } ],
output_template => 'Terminating : %d',
perfdatas => [

View File

@ -58,7 +58,7 @@ sub custom_usage_perfdata {
$self->{output}->perfdata_add(
label => $label,
nlabel => 'kubernetes.pods.allocated.count',
nlabel => 'pods.allocated.count',
value => $value_perf,
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),