From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Binkley Robert - rbinkl Newsgroups: gmane.os.tru64.managers Subject: perl code showfdmn Date: Fri, 21 Jun 2002 07:40:58 -0500 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: main.gmane.org 1024662957 2759 127.0.0.1 (21 Jun 2002 12:35:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 21 Jun 2002 12:35:57 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.33 #1 (Debian)) id 17LNds-0000iO-00 for ; Fri, 21 Jun 2002 14:35:57 +0200 Original-Received: (qmail 19606 invoked by uid 5); 21 Jun 2002 12:36:01 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 19598 invoked from network); 21 Jun 2002 12:36:01 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (134.167.3.119) by 0 with SMTP; 21 Jun 2002 12:36:01 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.1 #39060) with ESMTP id <0GY200CBM3007U@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 21 Jun 2002 08:36:00 -0400 (EDT) Original-Received: from aerynsun.acxiom.com (aerynsun.acxiom.com [65.64.17.121]) by emroute1.cind.ornl.gov (PMDF V6.1 #39060) with ESMTP id <0GY2005672ZS45@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 21 Jun 2002 08:35:52 -0400 (EDT) Original-Received: from conmsc02.conway.acxiom.com (unverified) by aerynsun.acxiom.com (Content Technologies SMTPRS 4.2.10) with ESMTP id for ; Fri, 21 Jun 2002 07:35:50 -0500 Original-Received: by conmsc02.conway.acxiom.com with Internet Mail Service (5.5.2655.55) id ; Fri, 21 Jun 2002 07:32:49 -0500 Content-return: allowed Original-To: tru64-unix-managers@ornl.gov X-Mailer: Internet Mail Service (5.5.2655.55) Xref: main.gmane.org gmane.os.tru64.managers:646 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:646 > > 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.