Index: /tags/ipp-20110622/tools/diskspace/merge_counts_and_sizes.pl
===================================================================
--- /tags/ipp-20110622/tools/diskspace/merge_counts_and_sizes.pl	(revision 32625)
+++ /tags/ipp-20110622/tools/diskspace/merge_counts_and_sizes.pl	(revision 32626)
@@ -29,12 +29,15 @@
     chomp;
     unless ($_ =~ /^#/) {
-	($stage_product,$size_in_gb) = split /\s+/;
+	($stage_product,$size_in_gb,$count) = split /\s+/;
 	($stage,$product) = split /_/, $stage_product;
 
 	$size{$stage}{$product} = $size_in_gb;
+	$diskcount{$stage}{$product} = $count;
 	$total += $size_in_gb;
     }
 }
 close(S);
+
+$diskcount{"EXTERNAL"}{"UNKNOWN"} = 1;
 
 my $count_file = "neb:///ipp_diskspace/${datestring}/run_im_counts.dat";
@@ -92,4 +95,5 @@
 	    if ($N{$stage}{$product} > 0) {
 		$VpN{$stage}{$state} += $map{$stage}{$product}{$state} * $size{$stage}{$product} / $N{$stage}{$product};
+		$DVpN{$stage}{$state} += $map{$stage}{$product}{$state} * $size{$stage}{$product} / $diskcount{$stage}{$product};
 	    }
 #	    print STDERR ">>$stage $product $state $map{$stage}{$product}{$state} $N{$stage}{$product} $count{$stage}{$state} $size{$stage}{$product} $VpN{$stage}{$state}\n";	    
@@ -156,9 +160,10 @@
 	}
 	$labels{$label} += $V;
-	printf("%-8s %-18s %-10s %14.4f %12.6f %9d\n",
-		$stage,$state,$label,$V,$VpN{$stage}{$state},$count{$stage}{$state});
+	$alt_labels{$label} += $DVpN{$stage}{$state} * $count{$stage}{$state};
+	printf("%-8s %-18s %-10s\t%14.4f %12.6f\t%14.6f %12.6f\t%9d\n",
+		$stage,$state,$label,$V,$VpN{$stage}{$state},$DVpN{$stage}{$state} * $count{$stage}{$state},$DVpN{$stage}{$state},$count{$stage}{$state});
 	if (exists($opt{N})) {
-	    printf($out_fh "%-8s %-18s %-10s %14.4f %12.6f %9d\n",
-		   $stage,$state,$label,$V,$VpN{$stage}{$state},$count{$stage}{$state});
+	    printf($out_fh "%-8s %-18s %-10s\t%14.4f %12.6f\t%14.6f %12.6f\t%9d\n",
+		   $stage,$state,$label,$V,$VpN{$stage}{$state},$DVpN{$stage}{$state} * $count{$stage}{$state},$DVpN{$stage}{$state},$count{$stage}{$state});
 	}
     }
@@ -167,14 +172,15 @@
 foreach $l (keys %labels) {
     $sum += $labels{$l};
-    print STDERR "\t$l  \t$labels{$l}\n";
+    $alt_sum += $alt_labels{$l};
+    print STDERR "\t$l  \t$labels{$l}\t$alt_labels{$l}\n";
     if (exists($opt{N})) {
-	print $out_fh "\t$l  \t$labels{$l}\n";
+	print $out_fh "\t$l  \t$labels{$l}\t$alt_labels{$l}\n";
     }
 }
-print STDERR "\tTOTAL    \t$sum\n";
+print STDERR "\tTOTAL    \t$sum\t$alt_sum\n";
 print STDERR "\tEXP_TOT  \t$total\n";
 
 if (exists($opt{N})) {
-    print $out_fh "\tTOTAL    \t$sum\n";
+    print $out_fh "\tTOTAL    \t$sum\t$alt_sum\n";
     print $out_fh "\tEXP_TOT  \t$total\n";
     close($out_fh);
Index: /tags/ipp-20110622/tools/diskspace/nebulous_data.pl
===================================================================
--- /tags/ipp-20110622/tools/diskspace/nebulous_data.pl	(revision 32625)
+++ /tags/ipp-20110622/tools/diskspace/nebulous_data.pl	(revision 32626)
@@ -63,5 +63,5 @@
 my $total_volume = 0;
 my $used_volume  = 0;
-open(DF,"df -B 1 /data/${neb}/ |") || die "Cannot run df\n";
+open(DF,"df -B 1 /export/${neb}/ |") || die "Cannot run df\n";
 while(<DF>) {
     chomp;
@@ -113,7 +113,8 @@
     }
 }
-my $external_volume = $used_volume - $total_volume;
-print $out_fh "EXTERNAL UNKNOWN 1 $external_volume\n";
-
+if ($used_volume > 0) {
+    my $external_volume = $used_volume - $total_volume;
+    print $out_fh "EXTERNAL UNKNOWN 1 $external_volume\n";
+}
 close($out_fh);
 
Index: /tags/ipp-20110622/tools/diskspace/nebulous_wiki.pl
===================================================================
--- /tags/ipp-20110622/tools/diskspace/nebulous_wiki.pl	(revision 32625)
+++ /tags/ipp-20110622/tools/diskspace/nebulous_wiki.pl	(revision 32626)
@@ -7,12 +7,16 @@
 
 $opt{S} = 0;
-getopts('S',\%opt);
+getopts('SD:',\%opt);
 
-my $dt = DateTime->now;
-
-my @lt = gmtime;
-my $dt_data = DateTime->now;
-$dt->subtract( days => $lt[6]);
-my $datestring = $dt->ymd;
+my $datestring;
+if (exists($opt{D})) {
+    $datestring = $opt{D};
+}
+else {
+    my @lt = gmtime;
+    my $dt = DateTime->now;
+    $dt->subtract( days => $lt[6] );
+    $datestring = $dt->ymd;
+}
 
 @files = sort ( split /\n/, `neb-ls -p neb:///ipp_diskspace/${datestring}/%neb_usage.dat`);
@@ -32,4 +36,5 @@
 	$sum{$volume} += $size;
 	$sizes{$what}   += $size;
+	$counts{$what}  += $count;
     }
     close(F);
@@ -65,4 +70,5 @@
 	print "\n";
     }
+    my $dt = DateTime->now;
     $date = $dt->ymd;
     print "${presep}${date}${sep}";
@@ -88,5 +94,6 @@
     foreach $w (sort (keys %sizes)) {
 	$val = $sizes{$w} / 1024 / 1024 / 1024;
-	print $out_fh "$w $val\n";
+	$v2  = $counts{$w};
+	print $out_fh "$w $val $v2\n";
     }
     close($out_fh);
