From 005c0728c40aafce1b94db1df33263046ce7c082 Mon Sep 17 00:00:00 2001 From: Julien Mathis Date: Tue, 2 Nov 2010 14:41:15 +0000 Subject: [PATCH] git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@11012 6bcd3966-0018-0410-8128-fd23d134de7e --- src/check_centreon_snmp_traffic | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/check_centreon_snmp_traffic b/src/check_centreon_snmp_traffic index 8a13f3250..4816f5d84 100644 --- a/src/check_centreon_snmp_traffic +++ b/src/check_centreon_snmp_traffic @@ -317,6 +317,24 @@ if ($opt_64bits) { # Get desctiption table if ($opt_s) { + if (!-e $cacheFile) { + $result = $session->get_table(Baseoid => $OID_DESC); + if (defined($result)) { + unless (open(FILE,">".$cacheFile)){ + print "Check mod for temporary file : ".$cacheFile."...\n"; + exit $ERRORS{"UNKNOWN"}; + } + my $currentTime = time(); + print FILE $currentTime."\n"; + foreach my $key (oid_lex_sort(keys %$result)) { + my @oid_list = split (/\./,$key); + my $interfaceIndex = pop (@oid_list); + print FILE $interfaceIndex.";".$result->{$key}."\n"; + } + close(FILE); + } + } + if (!-e $cacheFile) { printf("ERROR: Could not open " . $cacheFile); exit $ERRORS{'UNKNOWN'};