#! /bin/ksh ## ############################################################################### ## Script Name: chk_files_usercmds ## Where : in $FEDIR/scripts where FEDIR=/apps/nns_com/fea ## ############################################################################### ## Purpose: Checks sgia (or some other Unix machine) ## every 30 secs (or so) to see processes (commands) using the ## typical NNS SGI file systems -- /usr/people, /apps, /data, etc. -- ## 'local' to the processor. ## ## An input parameter specifies the sleep time between inquiries. ## If not provided, the default is 30 seconds. ############################################################################### ## Called by: $HOME/.auxchestrc or, eventually, ## feamain -> feautils.menu -> hostvu.menu script ## in $FEDIR/scripts ## ############################################################################### ## Call format: winterm -hold -t chk_files_usercmds -n chk_filusercmds \ ## -e "rsh sgia $FEDIR/scripts/chk_files_usercmds 30" ## ############################################################################### ## Written by: B.Montandon O05 3Dec98 ## Updated by: " O05 2Feb99 Added script name to top ## date-line of display ## ############################################################################### # set -x if test "$1" = "" then DELAYSECS=30 else DELAYSECS=$1 fi FILSYSLIST=`df -l | tail +2l | awk '{print $7}'` while : do echo " **************************************************************************** ... `hostname` ......... `date` ................ *LOCAL* FileSystems and their associated processes & commands (from [ps -fp \`fuser -cuq \`]) checking every $DELAYSECS seconds via $0 " for filsys in $FILSYSLIST do echo " $filsys : " # fuser -cu $filsys # fuser -cu $filsys 2>&1 | fold -s -w70 # ps -fp `fuser -cuq $filsys 2> /dev/null` 2> /dev/null | fold -s -w70 ps -o"ruser,pid,ppid,stime,time,etime,pcpu,cpu,vsz,args" \ -p `fuser -cuq $filsys 2> /dev/null` 2> /dev/null | fold -s -w70 # sleep 1 echo " ........................................................................." done sleep $DELAYSECS done