IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 6, 2010, 4:44:37 PM (16 years ago)
Author:
rhenders
Message:

Nebulous cluster space plot added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czartool/Nebulous.pm

    r28845 r28862  
    9393    $self->{_totalHosts} = 0;
    9494    $self->{_hostsOverNinetyEightPC} = 0;
     95    my $readable;
     96    my $writable;
    9597    foreach $line (@cmdOut) {
    9698
     
    113115            if ($4 >= 98) {$self->{_hostsOverNinetyEightPC}++;}
    114116
    115 #            print $1 . " " . $self->convertKbToTb($2+$3) . " " . $self->convertKbToTb($2) . " " . $self->convertKbToTb($3) . " $4PC \n" ;
    116             $self->{_czarDb}->updateHost($1, $self->convertKbToTb($2+$3), $self->convertKbToTb($3), $self->convertKbToTb($2));
     117            $self->getReadableWritableStatus($1, \$readable, \$writable);
     118
     119            $self->{_czarDb}->updateHost($1,
     120                    $self->convertKbToTb($2+$3),
     121                    $self->convertKbToTb($3),
     122                    $self->convertKbToTb($2),
     123                    $readable, $writable);
    117124        }
    118125    }
     
    123130            $self->{_totalUsed},
    124131            $self->{_hostsOverNinetyEightPC});
     132}
    125133
     134###########################################################################
     135#
     136# Runs neb-host and readable/writable status for this host
     137#
     138###########################################################################
     139sub getReadableWritableStatus {
     140    my ($self, $host, $readable, $writable) = @_;
     141
     142    ${$readable} = 0;
     143    ${$writable} = 0;
     144
     145    my @cmdOut = `neb-host`;
     146    my $line;
     147    foreach $line (@cmdOut) {
     148
     149        chomp($line);
     150        if ($line =~ m/$host\s+[0-9.A-Za-z]+\s+([01]+)\s+([01]+)\s+([01]+)\s+.*/i) {
     151
     152            # if mounted...
     153            if ($1) {
     154
     155                ${$readable} = $3;
     156                ${$writable} = $2;
     157            }
     158        }
     159    }
    126160}
    1271611;
Note: See TracChangeset for help on using the changeset viewer.