enh h3c hardware cache (#1049)

This commit is contained in:
Colin Gagnaire 2018-07-12 12:40:21 +02:00 committed by GitHub
parent 4c3e1dce93
commit bd5e3567dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -192,7 +192,7 @@ sub check_cache {
my $has_cache_file = $self->{statefile_cache}->read(statefile => 'cache_h3c_entity_' . $self->{hostname} . '_' . $self->{snmp_port});
my $timestamp_cache = $self->{statefile_cache}->get(name => 'last_timestamp');
if ($has_cache_file == 0 ||
!defined($timestamp_cache) || ((time() - $timestamp_cache) > (($self->{option_results}->{reload_cache_time}) * 60))) {
!defined($timestamp_cache) || ((time() - $timestamp_cache) > (($self->{option_results}->{reload_cache_time}) * 60)) && $self->{option_results}->{reload_cache_time} != '-1') {
push @{$self->{request}}, { oid => $oid_entPhysicalEntry, start => $oid_entPhysicalDescr, end => $oid_entPhysicalName };
$self->{write_cache} = 1;
}
@ -315,7 +315,8 @@ Example: --critical='temperature,.*,45'
=item B<--reload-cache-time>
Time in seconds before reloading cache file (default: 180).
Time in seconds before reloading cache file (Default: 180).
Use '-1' to disable cache reload.
=back