]> git.sesse.net Git - nms/blobdiff - web/tempfetch.pl
Use nms::db_connect() everywhere.
[nms] / web / tempfetch.pl
index eed5417fdfbf8a712d49cac6f3becedf617397ee..3a5c84dfbc49bcb92da7e386099c0063b05eb16a 100644 (file)
@@ -5,6 +5,8 @@ use DBI;
 use Net::Telnet;
 use POSIX;
 use Time::HiRes;
+use lib '../include';
+use nms;
 use strict;
 use warnings;
 #require 'SNMP_Session.pm';
@@ -14,8 +16,7 @@ my $password = 'removed';
 my $timeout = 25;
 my $location = 'skipet';
 
-my $dbh = DBI->connect("dbi:Pg:dbname=snmpfetch;host=violet.tg05.gathering.org", "snmpfetch", "removed")
-       or die "Couldn't connect to database";
+my $dbh = nms::db_connect();
 $dbh->{AutoCommit} = 0;
 
 my $qswitch = $dbh->prepare(<<"EOF")