np-setup error
Le Dang Khoa <kenji_le-/[email protected]> Sun, 8 May 2005 11:53:37 -0700 (PDT)
| Newsgroups | gmane.network.net-policy.user |
|---|---|
| Message-ID | <[email protected]> |
--0-1856571099-1115578417=:65524
Content-Type: text/plain; charset=us-ascii
Hello, I have a very confusing np-setup error :
First, I created 'netpolicy' database and updated information for np-setup:
#vi /usr/local/bin/np-setup
%opts = ( 't' => "postgres",
'u' => "sqluser",
'p' => "sqlpass",
'D' => 'netpolicy',
'H' => '172.16.196.196',
'd' => 0,
'F' => 0,
'a' => 'SHA',
'x' => 'AES',
'n' => 0);
And then, ran it:
# /usr/local/bin/np-setup -u sqluser -p sqlpass -M
DBI connect('host=172.16.196.196','sqluser',...) failed: FATAL: database "sqluser" does not exist
at /usr/local/bin/np-setup line 49
Connect to postgres failed: FATAL: database "sqluser" does not exist
So, I went to line 49 in np-setup and saw this:
( $dbh =
DBI->connect("DBI:$perl_db:host=$opts{H}",$opts{'u'},$opts{'p'}))
or die "\tConnect to $opts{'t'} failed: $DBI::errstr\n";
I modified:
( $dbh =
DBI->connect("DBI:$perl_db:host=$opts{H}",$opts{'D'},$opts{'u'}))
or die "\tConnect to $opts{'t'} failed: $DBI::errstr\n";
And run np-setup again:
# /usr/local/bin/np-setup -u sqluser -p sqlpass -M
DBI connect('host=172.16.196.196','netpolicy',...) failed: FATAL: user "netpolicy" does not exist
at /usr/local/bin/np-setup line 49
Connect to postgres failed: FATAL: user "netpolicy" does not exist
Weird! Afterall, I created 'sqluser' database (as a trick) and ran np-setup again. Here is the error message:
...
DBD::Pg::db do failed: execute called with an unbound placeholder at /usr/local/bin/np- setup line 529.
DBD::Pg::db do failed: ERROR: permission denied for language c
This is line 529 in np-setup:
$dbhAdmin->do("insert into refs(name, value)
values('usmUserCloneFrom OID',
'select distinct setup_oid(\\'.1.3.6.1.6.3.15.1.2.2.1.3\\', usmuserengineid, initusername)
from $monitorD.usmUserTable as usrtbl,
clients,
usmClientInfo as cinfo
where usrtbl.clientid = clients.id and
cinfo.clientid = clients.id and
clients.hostid = ?')");
I'm so confused about this. Please give me some help!
Best regards,
Kenji Le
Global Cybersoft Vietnam
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--0-1856571099-1115578417=:65524
Content-Type: text/html; charset=us-ascii
<DIV><FONT size=2>
<P>Hello, I have a very confusing np-setup error :</P>
<P>First, I created 'netpolicy' database and updated information for np-setup:</P>
<P>#vi /usr/local/bin/np-setup</P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<P>%opts = ( 't' => "postgres",</P>
<P>'u' => "sqluser",</P>
<P>'p' => "sqlpass",</P>
<P>'D' => 'netpolicy',</P>
<P>'H' => '172.16.196.196',</P>
<P>'d' => 0,</P>
<P>'F' => 0,</P>
<P>'a' => 'SHA',</P>
<P>'x' => 'AES',</P>
<P>'n' => 0);</P></BLOCKQUOTE>
<P>And then, ran it:</P>
<P># /usr/local/bin/np-setup -u sqluser -p sqlpass -M</P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<P>DBI connect('host=172.16.196.196','sqluser',...) failed: FATAL: database "sqluser" does not exist</P>
<P>at /usr/local/bin/np-setup line 49</P>
<P>Connect to postgres failed: FATAL: database "sqluser" does not exist</P></BLOCKQUOTE>
<P>So, I went to line 49 in np-setup and saw this:</P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<P>( $dbh =</P>
<P>DBI->connect("DBI:$perl_db:host=$opts{H}",$opts{'u'},$opts{'p'}))</P>
<P>or die "\tConnect to $opts{'t'} failed: $DBI::errstr\n";</P></BLOCKQUOTE>
<P>I modified:</P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<P>( $dbh =</P>
<P>DBI->connect("DBI:$perl_db:host=$opts{H}",$opts{'D'},$opts{'u'}))</P>
<P>or die "\tConnect to $opts{'t'} failed: $DBI::errstr\n";</P></BLOCKQUOTE>
<P>And run np-setup again:</P>
<P># /usr/local/bin/np-setup -u sqluser -p sqlpass -M</P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<P>DBI connect('host=172.16.196.196','netpolicy',...) failed: FATAL: user "netpolicy" does not exist</P>
<P>at /usr/local/bin/np-setup line 49</P>
<P>Connect to postgres failed: FATAL: user "netpolicy" does not exist</P></BLOCKQUOTE>
<P>Weird! Afterall, I created 'sqluser' database (as a trick) and ran np-setup again. Here is the error message:</P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<P>... </P>
<P>DBD::Pg::db do failed: execute called with an unbound placeholder at /usr/local/bin/np- setup line 529.</P>
<P>DBD::Pg::db do failed: ERROR: permission denied for language c</P></BLOCKQUOTE>
<P>This is line 529 in np-setup:</P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<P>$dbhAdmin->do("insert into refs(name, value)</P>
<P>values('usmUserCloneFrom OID',</P>
<P>'select distinct setup_oid(\\'.1.3.6.1.6.3.15.1.2.2.1.3\\', usmuserengineid, initusername)</P>
<P>from $monitorD.usmUserTable as usrtbl,</P>
<P>clients,</P>
<P>usmClientInfo as cinfo</P>
<P>where usrtbl.clientid = clients.id and</P>
<P>cinfo.clientid = clients.id and</P>
<P>clients.hostid = ?')");</P></BLOCKQUOTE>
<P>I'm so confused about this. Please give me some help!</P>
<P>Best regards,</P>
<P>Kenji Le</P>
<P>Global Cybersoft Vietnam</P></FONT></DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com
--0-1856571099-1115578417=:65524--
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20