7 # WARNING: CHANGE THIS! :-P
27 /(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+(\d+)\s+(\d+:\d+:\d+).*DHCPACK on (\d+\.\d+\.\d+\.\d+)/ or next;
28 my $date = $year . "-" . $months{$1} . "-" . $2 . " " . $3;
30 if (!defined($dbh) || !$dbh->ping) {
31 $dbh = DBI->connect("dbi:Pg:dbname=snmpfetch;host=violet.tg05.gathering.org", "snmpfetch", "removed")
32 or die "Couldn't connect to database";
33 $q = $dbh->prepare("UPDATE dhcp SET last_ack=? WHERE inet ? << network AND ( last_ack < ? OR last_ack IS NULL )")
34 or die "Couldn't prepare query";
37 print STDERR "$date $4\n";
38 $q->execute($date, $4, $date)
39 or die "Couldn't push $1 into database";