bindings/erlang: Added copyright and license header.
[collectd.git] / contrib / snmp-probe-host.px
index 9130ece..1d8f975 100755 (executable)
@@ -99,6 +99,14 @@ sub probe_one
       {
         return;
       }
+      if (!defined ($status))
+      {
+        return;
+      }
+      if ("$status" eq 'NOSUCHOBJECT')
+      {
+        return;
+      }
     }
     else
     {
@@ -216,11 +224,6 @@ sub probe_all
     $version--;
   } # while ($version > 0)
 
-  if (!@valid_data)
-  {
-    return;
-  }
-
   print <<EOF;
   <Host "$host">
     Address "$address"
@@ -231,6 +234,14 @@ EOF
   {
     print "    Collect \"$_\"\n";
   }
+  if (!@valid_data)
+  {
+    print <<EOF;
+# WARNING: Autoconfiguration failed.
+# TODO: Add one or more `Collect' statements here:
+#   Collect "foo"
+EOF
+  }
   print <<EOF;
     Interval 60
   </Host>