From 3f1a385add6aad80cb7ad1237b643f1cd44d9915 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 Apr 2014 22:19:42 +0200 Subject: Support LIKE in single-shot run. --- clients/snmpfetch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clients/snmpfetch.pl') 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 -- cgit v1.2.3