]> andersk Git - moira.git/commitdiff
Report the new equipment codes for some classes of hosts, as requested
authorzacheiss <zacheiss>
Wed, 20 Mar 2002 04:02:09 +0000 (04:02 +0000)
committerzacheiss <zacheiss>
Wed, 20 Mar 2002 04:02:09 +0000 (04:02 +0000)
by TNS folks.

gen/ip-billing.gen

index ad95d41ed630cefbdac9f207f71ec35429372620..279f6e9e06d32c45b2abbbd8166c476a16ebd374 100755 (executable)
@@ -96,12 +96,70 @@ while (($saddr, $name, $contact, $accountnumber, $modtime) =
     $count++;
 }
 
-# +NETWK-0
+# +NETWK-DORM
 $sth = $dbh->prepare("SELECT m.address, m.location, m.name, m.contact, " .
                     "m.account_number, m.created, m.modtime FROM " .
                     "machine m, subnet s WHERE m.status = 1 " .
                     "AND m.snet_id = s.snet_id AND " .
-                    "(s.status = 4 OR s.status = 5 OR s.status = 6) " .
+                    "s.status = 5 AND m.address != 'unassigned' " .
+                    "ORDER BY m.address")
+    || exit $MR_DBMS_ERR;
+
+$sth->execute || exit $MR_DBMS_ERR;
+
+while (($address, $location, $name, $contact, $accountnumber, $created, $modtime) = 
+       $sth->fetchrow_array) { 
+    $row = "$address\t$location\t$name\t$contact\t$accountnumber\t+NETWK-DORM\t$created\t$modtime\n";
+    $row =~ s/\0//g;
+    print DAT $row;
+    $count++;
+}
+
+# +NETWK-FSILG
+$sth = $dbh->prepare("SELECT m.address, m.location, m.name, m.contact, " .
+                     "m.account_number, m.created, m.modtime FROM " .
+                     "machine m, subnet s WHERE m.status = 1 " .
+                     "AND m.snet_id = s.snet_id AND " .
+                     "s.status = 8 AND m.address != 'unassigned' " .
+                     "ORDER BY m.address")
+    || exit $MR_DBMS_ERR;
+
+$sth->execute || exit $MR_DBMS_ERR;
+
+while (($address, $location, $name, $contact, $accountnumber, $created, $modtime) = 
+       $sth->fetchrow_array) { 
+    $row = "$address\t$location\t$name\t$contact\t$accountnumber\t+NETWK-FSILG\t$created\t$modtime\n";
+    $row =~ s/\0//g;
+    print DAT $row;
+    $count++;
+}
+
+# +NETWK-OCS
+$sth = $dbh->prepare("SELECT m.address, m.location, m.name, m.contact, " .
+                    "m.account_number, m.created, m.modtime FROM " .
+                    "machine m, subnet s WHERE m.status = 1 " .
+                    "AND m.snet_id = s.snet_id AND " .
+                    "s.status = 6 AND s.name LIKE '%-DHREG' " .
+                    "AND m.address != 'unassigned' ORDER BY m.address")
+    || exit $MR_DBMS_ERR;
+
+$sth->execute || exit $MR_DBMS_ERR;
+
+while (($address, $location, $name, $contact, $accountnumber, $created, $modtime) =
+       $sth->fetchrow_array) {
+    $row = "$address\t$location\t$name\t$contact\t$accountnumber\t+NETWK-OCS\t$created\t$modtime\n";
+    $row =~ s/\0//g;
+    print DAT $row;
+    $count++;
+}
+
+# +NETWK-0
+$sth = $dbh->prepare("SELECT m.address, m.location, m.name, m.contact, " .
+                    "m.account_number, m.created, m.modtime FROM " .
+                    "machine m, subnet s WHERE m.status = 1 " .
+                    "AND m.snet_id = s.snet_id AND " .  
+                    "(s.status = 4 OR s.status = 6) AND " .
+                    "s.name NOT LIKE '%-DHREG' " .
                     "AND m.address != 'unassigned' ORDER BY m.address") 
     || exit $MR_DBMS_ERR;
 
This page took 0.041516 seconds and 5 git commands to generate.