aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@frank.tg14.gathering.org>2014-04-17 22:19:42 +0200
committerroot <root@frank.tg14.gathering.org>2014-04-17 22:19:42 +0200
commit3f1a385add6aad80cb7ad1237b643f1cd44d9915 (patch)
tree5fe128d4fa037fdc1e2263338b5d80f2c33b3f3a
parent91a8ed879fd0e4249dbafc7577d11f335af7808d (diff)
Support LIKE in single-shot run.
-rwxr-xr-xclients/snmpfetch.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/clients/snmpfetch.pl b/clients/snmpfetch.pl
index 4064b1c..968ace8 100755
--- a/clients/snmpfetch.pl
+++ b/clients/snmpfetch.pl
@@ -22,7 +22,7 @@ my $instant = defined($ARGV[0]);
my $qualification;
if ($instant) {
- $qualification = "sysname=?";
+ $qualification = "sysname LIKE ?";
} else {
$qualification = <<"EOF";
(last_updated IS NULL OR now() - last_updated > poll_frequency)
@@ -68,7 +68,7 @@ sub poll_loop {
if ($instant) {
$sysname = shift @ARGV;
return if (!defined($sysname));
- $qswitch->execute($sysname)
+ $qswitch->execute('%'.$sysname.'%')
or die "Couldn't get switch";
} else {
# Find a switch to grab