projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bindings/erlang: Added copyright and license header.
[collectd.git]
/
contrib
/
snmp-probe-host.px
diff --git
a/contrib/snmp-probe-host.px
b/contrib/snmp-probe-host.px
index
bb9f329
..
1d8f975
100755
(executable)
--- a/
contrib/snmp-probe-host.px
+++ b/
contrib/snmp-probe-host.px
@@
-61,10
+61,13
@@
sub probe_one
}
@oids = split (/"\s*"/, $conf->{'values'});
}
@oids = split (/"\s*"/, $conf->{'values'});
- if (
($conf->{'table'} =~ m/^(true|yes|on)$/i) && ($conf->{'instance'})
)
+ if (
$conf->{'table'} =~ m/^(true|yes|on)$/i
)
{
$cmd = 'GETNEXT';
{
$cmd = 'GETNEXT';
- push (@oids, $conf->{'instance'});
+ if (defined ($conf->{'instance'}))
+ {
+ push (@oids, $conf->{'instance'});
+ }
}
require Data::Dumper;
}
require Data::Dumper;
@@
-96,6
+99,14
@@
sub probe_one
{
return;
}
{
return;
}
+ if (!defined ($status))
+ {
+ return;
+ }
+ if ("$status" eq 'NOSUCHOBJECT')
+ {
+ return;
+ }
}
else
{
}
else
{
@@
-213,11
+224,6
@@
sub probe_all
$version--;
} # while ($version > 0)
$version--;
} # while ($version > 0)
- if (!@valid_data)
- {
- return;
- }
-
print <<EOF;
<Host "$host">
Address "$address"
print <<EOF;
<Host "$host">
Address "$address"
@@
-228,6
+234,14
@@
EOF
{
print " Collect \"$_\"\n";
}
{
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>
print <<EOF;
Interval 60
</Host>