#! /usr/bin/perl
use DBI;
use POSIX;
+use lib '../include';
+use nms;
use strict;
use warnings;
my $date = $year . "-" . $months{$1} . "-" . $2 . " " . $3;
if (!defined($dbh) || !$dbh->ping) {
- $dbh = DBI->connect("dbi:Pg:dbname=snmpfetch;host=violet.tg05.gathering.org", "snmpfetch", "removed")
- or die "Couldn't connect to database";
+ $dbh = nms::db_connect();
$q = $dbh->prepare("UPDATE dhcp SET last_ack=? WHERE inet ? << network AND ( last_ack < ? OR last_ack IS NULL )")
or die "Couldn't prepare query";
}