Index: branches/eam_branches/ipp-20120601/tools/regpeek.pl
===================================================================
--- branches/eam_branches/ipp-20120601/tools/regpeek.pl	(revision 33977)
+++ branches/eam_branches/ipp-20120601/tools/regpeek.pl	(revision 34049)
@@ -3,4 +3,8 @@
 use DBI;
 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
+use PS::IPP::Config 1.0.1 qw( :standard );
+
+my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
+my $siteConfig = $ipprc->{_siteConfig};
 
 my $dbname = 'gpc1';
@@ -65,12 +69,19 @@
 
 sub init_gpc_db {
+    ## change to use the siteConfig setting, while readonly probably do not want to use a readonly replicated DB incase it gets behind
     use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock';
-    my $dbserver = 'ippdb01';
-    my $dbuser = 'ippuser';
-    my $dbpass = 'ippuser';
+    #my $dbserver = 'ippdb01';
+    #my $dbuser = 'ippuser';
+    #my $dbpass = 'ippuser';
+    my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');
+    my $dbuser = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBUSER");
+    my $dbpass = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBPASSWORD");
+    die "database configuration not set up" unless defined($dbserver);
+    die "database configuration not set up" unless defined($dbuser);
+    die "database configuration not set up" unless defined($dbpass);
     $db = DBI->connect("DBI:mysql:database=${dbname};host=${dbserver};" .
                        "mysql_socket=" . DB_SOCKET(),
                        ${dbuser},${dbpass},
-{ RaiseError => 1, AutoCommit => 1}
+		       { RaiseError => 1, AutoCommit => 1}
         ) or die "Unable to connect to database $DBI::errstr\n";
 return($db);
