4 # The following exit codes are defined and MUST BE CONSISTENT with the
5 # error codes the library uses:
6 $MR_DBMS_ERR = 47836421;
7 $MR_OCONFIG = 47836460;
9 $outfile = '/moira/dcm/ip-billing.out';
13 $dbh = DBI->connect("dbi:Oracle:moira", "moira", "moira")
16 $sth = $dbh->prepare("SELECT m.address, m.location, m.account_number, " .
17 "m.name, m.contact FROM machine m, subnet s WHERE " .
18 "m.status = 1 and m.snet_id = s.snet_id " .
19 "AND s.status = 1") || exit $MR_DBMS_ERR;
21 $sth->execute || exit $MR_DBMS_ERR;
24 open(OUT, ">$outfile") || exit $MR_OCONFIG;
26 while (($address, $location, $accountnumber, $hostname, $contact) =
27 $sth->fetchrow_array) {
28 $row= "$address\t$location\t$accountnumber\t$hostname\t$contact\n";