aboutsummaryrefslogtreecommitdiffstats
path: root/collectors/dhcptail.pl
diff options
context:
space:
mode:
authorroot <root@colazero.tele.tg18.gathering.org>2018-03-26 13:04:05 +0200
committerroot <root@colazero.tele.tg18.gathering.org>2018-03-26 13:04:05 +0200
commitbe54730288b9925003e88788e65f11199cc8292b (patch)
treef5a96e9b34fa43fb1fc36cc6923c346d75ed9f5f /collectors/dhcptail.pl
parentd6a5794527b555dca86be61c757d24bb86930dd3 (diff)
Mange dager med rot på TG18
Diffstat (limited to 'collectors/dhcptail.pl')
-rwxr-xr-xcollectors/dhcptail.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/collectors/dhcptail.pl b/collectors/dhcptail.pl
index 5fd8cf0..5f117b9 100755
--- a/collectors/dhcptail.pl
+++ b/collectors/dhcptail.pl
@@ -27,7 +27,7 @@ my %months = (
my $realtime = 0;
my ($dbh, $q,$check);
$dbh = nms::db_connect();
-$q = $dbh->prepare("INSERT INTO dhcp (dhcp_server,switch,time,ip,mac) VALUES($nms::config::dhcp_id,(SELECT switch FROM switches WHERE ?::inet << subnet4 and deleted = false ORDER BY sysname LIMIT 1),?,?,?)");
+$q = $dbh->prepare("INSERT INTO dhcp (dhcp_server,network,time,ip,mac) VALUES($nms::config::dhcp_id,(SELECT network FROM networks WHERE ?::inet << subnet4 ORDER BY name LIMIT 1),?,?,?)");
$check = $dbh->prepare("SELECT max(time)::timestamp - ?::timestamp < '0s'::interval as doit FROM dhcp where dhcp_server = $nms::config::dhcp_id;");
open(SYSLOG, "tail -n 9999999 -F /var/log/messages |") or die "Unable to tail syslog: $!";