From 2922782c2f6f2803d9e7bb6de29d6eddf346005e Mon Sep 17 00:00:00 2001 From: Julien Mathis Date: Thu, 25 Nov 2010 15:52:28 +0000 Subject: [PATCH] add error when SNMP does not respond to plugin. git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@11112 6bcd3966-0018-0410-8128-fd23d134de7e --- centreon-plugins/src/check_centreon_snmp_traffic | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/centreon-plugins/src/check_centreon_snmp_traffic b/centreon-plugins/src/check_centreon_snmp_traffic index 4cdb7c87f..6ef65be44 100644 --- a/centreon-plugins/src/check_centreon_snmp_traffic +++ b/centreon-plugins/src/check_centreon_snmp_traffic @@ -254,6 +254,11 @@ if ($mustCreateFile) { print FILE $interfaceIndex.";".$result->{$key}."\n"; } close(FILE); + } else { + if (!$result) { + printf("ERROR: Cannot get SNMP info : %s", $session->error); + exit $ERRORS{'UNKNOWN'}; + } } }