#!/bin/ksh ## ## SCRIPT: dfk_main ## ## Where: in $FEDIR/scripts where $FEDIR=/apps/nns_com/fea ## ########################################################################## ## PURPOSE: Shows the disk usage (in 1K blocks) in main FEA/MCADD ## file systems on a 'main' SGI server, 'engprd00' (formerly ## 'sgia'). ## ########################################################################## ## CALLED BY: feamain OR xfea script OR tkfea in $FEDIR/scripts ## and by 'spacetools' in $FEDIR/scripts ########################################################################## ## MAINTENANCE HISTORY: ## Written by: B. Montandon 25Nov96 C61 ## Updated by: B. Montandon 8May97 C61 Better .rhosts handling. ## Updated by: B. Montandon 22Jun99 O06 Touched up display/print format. ## Updated by: B. Montandon 27Jun99 O06 Clarified Device/Server col head, ## added $0 to output, and ## commented 'clearnns' & echo statements. ## Updated by: B. Montandon 2Aug99 O06 Add SERVERID variable and clarify ## that inquiry is run on $SERVERID. ## Updated by: B. Montandon 13Oct99 Set $FEDIR if null (for use in toolchest). ########################################################################## if test "$FEDIR" = "" then FEDIR=/apps/nns_com/fea export FEDIR fi ########################################################################## ## SET HOSTNAME VARS. ########################################################################## HOSTID=`hostname` # SERVERID="sgia" SERVERID="engprd00" ########################################################################## ## SOME OLD STUFF -- FOR OUTPUT IN WINTERM/XWSH OF nnsFEAmenu. ########################################################################## ## . $FEDIR/scripts/clearnns ## ## echo "\ ## ......................................................................... ## ${HIbold}Disk usage in major FEA/MCADD file systems known to Server $SERVERID ## " ## /sbin/sleep 4 ## *** Press Enter to continue.${HIreset}" ## read NNS_JUNK ########################################################################## ########################################################################## ## SET OUTPUT FILENAME, local if possible. ########################################################################## . $FEDIR/scripts/set_localoutlist ########################################################################## ## SET REPORT HEADING. ########################################################################## DATETIME=`date` echo "\ ...........................$DATETIME...................... DISK USAGE (esp. %used) IN FILE-SYSTEMS KNOWN TO SERVER *** $SERVERID *** -- including major FEA/MCADD file systems on the NNS SGI system: - /data, - /usrpeople containing home directories /usr/people/USERID, - /engprod containing /apps. ------------------------------------------------------------------------------- FileSystem Name & below that name Kbytes ${SERVERID}-Device-partition (xfs) OR Server:Directory (nfs) %used Type allocated Used Avail. ----------------------------------- ----- ---- --------- -------- --------- " > $OUTLIST ########################################################################## ## MAKE .rhosts FILE FOR THE USER, if needed. ########################################################################## . $FEDIR/scripts/mak_rhosts ########################################################################## ## GENERATE REPORT CONTENTS. ########################################################################## # set -x rsh $SERVERID /usr/sbin/df -k | sed '1d' | /usr/bin/sort +6 -7 | /usr/bin/awk \ '{printf ("%-35s %4s %7s %9s %9s %9s\n%-25s \n\n", $7, $6, $2, $3, $4, $5, $1)}' >> $OUTLIST # '{printf ("%-35s %4s %7s %9s %9s %9s\n %-25s \n\n", $7, $6, $2, $3, $4, $5, $1)}' >> $OUTLIST # /usr/bin/awk '{print $7 " " $6 " " $2 " " $3 " " $4 " " $5 " " $1 }' >> $OUTLIST # set - ########################################################################## ## REMOVE .rhosts FILE FOR THE USER. (Commented; not used.) ########################################################################## # . $FEDIR/scripts/mv_rhosts ########################################################################## ## ADD REPORT 'TRAILER'. ########################################################################## echo "\ ......................................................................... The output above is from nnsFEAmenu option 'fs', actually script $0 which was run from host $HOSTID . Uses a command sequence like: rsh $SERVERID df -k | sort +6 -7 | awk '{printf (\" a format \", \$7, \$6, \$2, \$3, \$4, \$5, \$1) }' which sorts by FileSystem Name. ......................................................................... " >> $OUTLIST ########################################################################## ## SHOW REPORT. ########################################################################## $FEDIR/scripts/shofil $OUTLIST