will not write into cache file if snmpwalk fails

git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@10176 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
Sylvestre Ho 2010-03-10 09:45:40 +00:00
parent 4a1f7633f6
commit 48a53e0260

View File

@ -240,6 +240,7 @@ else {
if ($mustCreateFile) {
$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"};
@ -252,6 +253,7 @@ if ($mustCreateFile) {
print FILE $interfaceIndex.";".$result->{$key}."\n";
}
close(FILE);
}
}