]> git.sesse.net Git - nms/blobdiff - web/stempmap.pl
Use nms::db_connect() everywhere.
[nms] / web / stempmap.pl
index b2df70b688461ae7f841a669fdcf2793a182df35..fcfd32cd4695755770f37ef32ff92f98862cf015 100755 (executable)
@@ -5,6 +5,8 @@
 use CGI;
 use GD;
 use DBI;
+use lib '../include';
+use nms;
 use strict;
 use warnings;
 
@@ -14,8 +16,7 @@ my $img = GD::Image->new('snmp-bg.png');
 #my $img = GD::Image->new(100,100);
 my $cgi = CGI->new;
 
-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();
 
 my $sgetpoll = $dbh->prepare('select switch,(select temp from temppoll where switches.switch=temppoll.switch AND temp != 0 order by id desc limit 1) AS temp,placement from switches natural join placements');