use POSIX ":sys_wait_h";
use strict;
use warnings;
+use lib '../include';
+use nms;
my $cgi = CGI->new;
my $switch = $cgi->param('id');
my $width = $cgi->param('width');
require './mygraph.pl';
my $start = [Time::HiRes::gettimeofday];
-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();
# Fetch the name
my $ref = $dbh->selectrow_hashref('SELECT sysname FROM switches WHERE switch=?', undef, $switch);