aboutsummaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
Diffstat (limited to 'collectors')
-rwxr-xr-xcollectors/dhcptail.pl4
-rwxr-xr-xcollectors/ping.pl2
-rwxr-xr-xcollectors/snmpfetchng.pl2
3 files changed, 4 insertions, 4 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: $!";
diff --git a/collectors/ping.pl b/collectors/ping.pl
index 952932a..82c5c42 100755
--- a/collectors/ping.pl
+++ b/collectors/ping.pl
@@ -18,7 +18,7 @@ $dbh->{RaiseError} = 1;
my $influx = nms::influx_connect();
-my $q = $dbh->prepare("SELECT switch,sysname,host(mgmt_v4_addr) as ip,host(mgmt_v6_addr) as secondary_ip FROM switches WHERE mgmt_v4_addr is not null or mgmt_v6_addr is not null ORDER BY random();");
+my $q = $dbh->prepare("SELECT switch,sysname,host(mgmt_v4_addr) as ip,host(mgmt_v6_addr) as secondary_ip FROM switches WHERE switches.deleted = false and (mgmt_v4_addr is not null or mgmt_v6_addr is not null) ORDER BY random();");
my $lq = $dbh->prepare("SELECT linknet,addr1,addr2 FROM linknets WHERE addr1 is not null and addr2 is not null;");
my $last = time();
diff --git a/collectors/snmpfetchng.pl b/collectors/snmpfetchng.pl
index 0ace8c4..9c06f4a 100755
--- a/collectors/snmpfetchng.pl
+++ b/collectors/snmpfetchng.pl
@@ -26,7 +26,7 @@ my $influx = nms::influx_connect();
my $qualification = <<"EOF";
(last_updated IS NULL OR now() - last_updated > poll_frequency)
AND (locked='f' OR now() - last_updated > '15 minutes'::interval)
-AND (mgmt_v4_addr is not null or mgmt_v6_addr is not null)
+AND (mgmt_v4_addr is not null or mgmt_v6_addr is not null) AND deleted = false
EOF
# Borrowed from snmpfetch.pl