tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* perl code showfdmn
@ 2002-06-21 12:40 Binkley Robert - rbinkl
  0 siblings, 0 replies; only message in thread
From: Binkley Robert - rbinkl @ 2002-06-21 12:40 UTC (permalink / raw)


>  
> Subject:	perl code showfdmn
> 
> root@sandbox:/u01/scripts => perl get_domain.pl
> Domain          Mount Point     Disk
> ---------------------------------------------
> root_domain     /root            /dev/disk/dsk5a
> usr_domain      /usr             /dev/disk/dsk5g
> var_domain      /var             /dev/disk/dsk5h
> u01_domain      /u01             /dev/disk/dsk1c
> u01_domain      /u01             /dev/disk/dsk6c
> u01_domain      /u01             /dev/disk/dsk4c
> ##########################################################################
> #####
> 
> #!/usr/bin/perl
> print "Domain\t\tMount Point\tDisk\n";
> print "-" x "45" . "\n";
> 
> foreach (`df -k`)
> 
> {
>   if ( $_ !~ /Filesystem/ )
>   {
>     ($line)=(split())[0,5];
>     ($domain,$fs)=split(/#/,$line);
> 
>     if ( $domain eq "/proc" )
>     {
>       next;
>     }
> 
>     foreach (`showfdmn $domain`)
>     {
>       if ( /.*?(\/dev.*)$/ )
> 
>       {
> 
>          $line=sprintf("%-15s /%-15s %-13s",$domain,$fs,$1);
> 
>          print "$line\n";
>       }
>     }
>   }
> }
> ##########################################################################
> ##################################
> root@sandbox:/u01/scripts => perl get_rev.pl
> Domain          Mount Point     Disk
> ---------------------------------------------
> root_domain     /root            /dev/disk/dsk5a
> root_domain     /root            /dev/disk/dsk5a
> 
>   Vol   512-Blks        Free  % Used  Cmode  Rblks  Wblks  Vol Name
>    1L    4209408     3218544     24%     on    256    256  /dev/disk/dsk5a
> usr_domain      /usr             /dev/disk/dsk5g
> usr_domain      /usr             /dev/disk/dsk5g
> 
>   Vol   512-Blks        Free  % Used  Cmode  Rblks  Wblks  Vol Name
>    1L    9578752     4580960     52%     on    256    256  /dev/disk/dsk5g
> var_domain      /var             /dev/disk/dsk5h
> var_domain      /var             /dev/disk/dsk5h
> 
>   Vol   512-Blks        Free  % Used  Cmode  Rblks  Wblks  Vol Name
>    1L    1665504     1574048      5%     on    256    256  /dev/disk/dsk5h
> u01_domain      /u01             /dev/disk/dsk1c
> u01_domain      /u01             /dev/disk/dsk6c
> u01_domain      /u01             /dev/disk/dsk4c
> u01_domain      /u01             /dev/disk/dsk1c
> u01_domain      /u01             /dev/disk/dsk6c
> u01_domain      /u01             /dev/disk/dsk4c
> 
>   Vol   512-Blks        Free  % Used  Cmode  Rblks  Wblks  Vol Name
>    1L   17773520    14360096     19%     on    256    256  /dev/disk/dsk1c
>    2    17773520    14435760     19%     on    256    256  /dev/disk/dsk6c
>    4    17773520    14414032     19%     on    256    256  /dev/disk/dsk4c
>       ----------  ----------  ------
>         53320560    43209888     19%
> 
> get_rev.pl
> 
> #!/usr/bin/perl
> print "Domain\t\tMount Point\tDisk\n";
> print "-" x "45" . "\n";
> 
> foreach (`df -k`)
> 
> {
>   if ( $_ !~ /Filesystem/ )
>   {
>     ($line)=(split())[0,5];
>     ($domain,$fs)=split(/#/,$line);
> 
>     if ( $domain eq "/proc" )
>     {
>       next;
>     }
> 
>  foreach (`showfdmn $domain`)
>     {
>       if ( /.*?(\/dev.*)$/ )
>       {
>          $line=sprintf("%-15s /%-15s %-13s",$domain,$fs,$1);
>          print "$line\n";
>       }
>     }
> 
>     my @MyArray = `showfdmn $domain`;
>     my $MyCnt = 3;
>     do {
>        shift(@MyArray);
>       }while(--$MyCnt);
>     foreach ( @MyArray )
>     {
>       if ( /.*?(\/dev.*)$/ )
>       {
>          $line=sprintf("%-15s /%-15s %-13s",$domain,$fs,$1);
>          print "$line\n";
>       }
>     }
>    printf "%-s", join('',@MyArray);  # this should print after each domain
>  }
> }


********************************************************************

The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged.
If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly
prohibited.
If you have received this communication in error,
please re-send this communication to the sender and
delete the original message or any copy of it from your
computer system. Thank You.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-06-21 12:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-21 12:40 perl code showfdmn Binkley Robert - rbinkl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox