(plugin) storage::ibm::storwize::ssh - metric v2 (#4649)

This commit is contained in:
qgarnier 2023-11-02 17:56:15 +01:00 committed by GitHub
parent a33b359a40
commit 1f85378b5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 10 deletions

View File

@ -66,7 +66,6 @@ sub check {
);
}
$self->{output}->perfdata_add(
label => "sstat",
nlabel => 'hardware.systemstats.current.count',
instances => $_->{stat_name},
value => $_->{stat_current},

View File

@ -28,7 +28,7 @@ use DateTime;
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class;
$options{options}->add_options(arguments => {
@ -101,8 +101,9 @@ sub run {
severity => $exit,
short_msg => sprintf("%d problem detected (use verbose for more details)", $num_errors)
);
$self->{output}->perfdata_add(
label => 'problems',
nlabel => 'eventlogs.problems.count',
value => $num_errors,
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),

View File

@ -78,7 +78,7 @@ sub ssh_execute {
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1);
bless $self, $class;
$options{options}->add_options(arguments => {});

View File

@ -35,10 +35,10 @@ sub custom_status_output {
sub custom_usage_perfdata {
my ($self, %options) = @_;
my $label = 'used';
my $label = 'pool.space.usage.bytes';
my $value_perf = $self->{result_values}->{used};
if (defined($self->{instance_mode}->{option_results}->{free})) {
$label = 'free';
$label = 'pool.space.free.bytes';
$value_perf = $self->{result_values}->{free};
}
@ -49,12 +49,14 @@ sub custom_usage_perfdata {
}
$self->{output}->perfdata_add(
label => $label, unit => 'B',
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
nlabel => $label,
unit => 'B',
instances => $self->{result_values}->{display},
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),
min => 0, max => $self->{result_values}->{total}
min => 0,
max => $self->{result_values}->{total}
);
}
@ -141,7 +143,7 @@ sub set_counters {
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class;
$options{options}->add_options(arguments => {