From: Max B. <ma...@wa...> - 2007-05-02 16:38:41
|
Hi Jimmy, You are missing a line to grab the config file. Off the top of my head I think it's something like config("/usr/local/netdisco/netdisco.conf"); Look at the top of 'netdisco' and run `perldoc Netdisco.pm` for full syntax. -m On Wed, May 02, 2007 at 10:06:12AM +0200, Jimmy Hansson wrote: > Hi! > > I´m trying to make a script for reading a number of ip-adresses in the > device_port table, > but when I try to connect to the database with an sql-query all I get is > this error message: > > dbh() - db_Pg not found in config info. > > What am I missing? Or have I misunderstood something? My code looks like > this: > > #! /usr/bin/perl > # > # Usage: > # Fetch IP-adresses from routers that the script > # show_mac_ip needs to be run on (for reading MAC-adresses to netdisco) > # > > use warnings; > use lib "/usr/share/perl/5.8.7"; > use netdisco qw/:all/; > > $data = sql_rows('device_port',['ip'],{'up' => 'up'}); > print $data; > > So far I haven´t constructed the complete sql-question (This is just for > testing) > It should be: SELECT ip FROM device_port WHERE up ="up" AND vlan IS NOT NULL > > Regards /Jimmy > > _________________________________________________________________ > Trött på att pendla? - Sök jobb där du bor! http://jobb.msn.monster.se/ > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Netdisco mailing list > net...@li... > https://lists.sourceforge.net/lists/listinfo/netdisco-users |