]> git.sesse.net Git - nms/blobdiff - clients/snmpfetch.pl
Begin moving passwords etc. into a common module.
[nms] / clients / snmpfetch.pl
index fa50f60f487e5769344b4e8ca0d088ff3ab6a773..b02f02112ecad3f4632d4778dc8ec867b4ea4f68 100755 (executable)
@@ -8,11 +8,13 @@ use strict;
 use warnings;
 require 'SNMP_Session.pm';
 
+use lib '../include';
+use nms;
+
 my $password = 'removed';
 my $timeout = 15;
 
-my $dbh = DBI->connect("dbi:Pg:dbname=nms;host=localhost", "nms", "nms")
-       or die "Couldn't connect to database";
+my $dbh = nms::db_connect();
 $dbh->{AutoCommit} = 0;
 
 # normal mode: fetch switches from the database