aboutsummaryrefslogtreecommitdiffstats
path: root/collectors/dhcptail.pl
diff options
context:
space:
mode:
authorOle Mathias Aa. Heggem <msbone1995@gmail.com>2018-03-21 13:27:46 +0100
committerGitHub <noreply@github.com>2018-03-21 13:27:46 +0100
commit2b3beb9f93fc6486169e47f96995a97dd64baf2a (patch)
tree7151c023924254d863387f484829b503759359ea /collectors/dhcptail.pl
parent8f1eeeabe7b33d224ed9a8e19cc16825c144a0f6 (diff)
parent5abf053bac220b49539104bfa63805fd0829ca45 (diff)
Merge branch 'master' into network-firstclass
Diffstat (limited to 'collectors/dhcptail.pl')
-rwxr-xr-xcollectors/dhcptail.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/collectors/dhcptail.pl b/collectors/dhcptail.pl
index 857bf5e..5fd8cf0 100755
--- a/collectors/dhcptail.pl
+++ b/collectors/dhcptail.pl
@@ -7,7 +7,7 @@ use strict;
use Data::Dumper;
use warnings;
-my $year = 2016;
+my $year = 2018;
my %months = (
Jan => 1,
@@ -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 ORDER BY sysname LIMIT 1),?,?,?)");
+$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),?,?,?)");
$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: $!";