From bd5e3567dc946ef9c193b3ea40e65a60a50c8409 Mon Sep 17 00:00:00 2001 From: Colin Gagnaire Date: Thu, 12 Jul 2018 12:40:21 +0200 Subject: [PATCH] enh h3c hardware cache (#1049) --- network/h3c/snmp/mode/hardware.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/network/h3c/snmp/mode/hardware.pm b/network/h3c/snmp/mode/hardware.pm index 83d2c8544..d40e9087c 100644 --- a/network/h3c/snmp/mode/hardware.pm +++ b/network/h3c/snmp/mode/hardware.pm @@ -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