fix arista memory output (#1048)
This commit is contained in:
parent
97672a5339
commit
4c3e1dce93
|
@ -31,6 +31,31 @@ sub default_storage_type {
|
||||||
return '^(hrStorageRam|hrStorageFlashMemory)';
|
return '^(hrStorageRam|hrStorageFlashMemory)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub set_counters {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
$self->{maps_counters_type} = [
|
||||||
|
{ name => 'storage', type => 1, cb_prefix_output => 'prefix_storage_output', message_multiple => 'All memory spaces are ok' },
|
||||||
|
];
|
||||||
|
|
||||||
|
$self->{maps_counters}->{storage} = [
|
||||||
|
{ label => 'usage', set => {
|
||||||
|
key_values => [ { name => 'display' }, { name => 'used' }, { name => 'size' }, { name => 'allocation_units' } ],
|
||||||
|
closure_custom_calc => $self->can('custom_usage_calc'),
|
||||||
|
closure_custom_output => $self->can('custom_usage_output'),
|
||||||
|
closure_custom_perfdata => $self->can('custom_usage_perfdata'),
|
||||||
|
closure_custom_threshold_check => $self->can('custom_usage_threshold'),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
sub prefix_storage_output {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
return "Memory space '" . $options{instance_value}->{display} . "' ";
|
||||||
|
}
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
|
Loading…
Reference in New Issue