]> git.sesse.net Git - nms/blobdiff - web/dhcpkart.pl
Add logging to mbd.
[nms] / web / dhcpkart.pl
index 2558fb99542fd118b98509758eb2904cdd43143e..e14e0c5a8bbfa356cf7811fee777f7023400d093 100755 (executable)
@@ -2,20 +2,21 @@
 use CGI;
 use GD;
 use DBI;
+use lib '../include';
+use nms;
 my $cgi = CGI->new;
 
 my $greentimeout = 900;
 my $maxtimeout = $greentimeout*9;
 
-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();
 
 GD::Image->trueColor(1);
-$img = GD::Image->new('snmp-bg.png');
+$img = GD::Image->new('bg07.png');
 
 my $blk = $img->colorResolve(0, 0, 0);
 
-$img->string(gdMediumBoldFont,0,0,"TG05 - DHCP-lease status",$blk);
+$img->string(gdMediumBoldFont,0,0,"TG07 - DHCP-lease status",$blk);
 $img->string(gdSmallFont,0,20,"Last recieved DHCP-request",$blk);
 
 # first  1/5: green (<30 min)
@@ -69,7 +70,7 @@ $dbh->disconnect;
 
 if (!defined($ARGV[0])) {
        print $cgi->header(-type=>'image/png',
-                          -refresh=>'10; http://nms.tg05.gathering.org/dhcpkart.pl');
+                          -refresh=>'10; http://nms.tg07.gathering.org/dhcpkart.pl');
 }
 print $img->png;