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

host.root-#->more cklast

#!/bin/ksh
#
awk -F: '{print $1}' /etc/passwd |while read NAME
do
  print - "\nChecking ${NAME}"
  last -R ${NAME} |head -n 1  
done

-------------------------------------------------
host.root-#->more ckhosts

#!/bin/ksh
#
/bin/grep -v ^# /etc/hosts | /bin/awk '{print $2}' |while read Name
do
  if [[ -z `/etc/ping ${Name} -n 4` ]]
  then
    print - "${Name} is dead!"
  else
    print - "${Name} is alive..."
  fi
done

-------------------------------------------------

host.root-#->more ckfree 

#!/bin/ksh
typeset -i COUNTER TOTAL
COUNTER=0
for DATA in `vgdisplay | grep "Free PE" | awk ' { print $3 } '`
        do
        COUNTER=0
        while [ $DATA -ne $COUNTER ]
                do
                TOTAL=$TOTAL+1
                COUNTER=$COUNTER+1
        done
        COUNTER=0
done
echo "ToTAL Megabytes->" `expr $TOTAL \* 4048`

-------------------------------------------------

host.root-#->more ckdisks

#!/bin/ksh
#
DATE=`date`
LOG=/tmp/dskcfg.`uname -n`
# HOST=`uname -n`

print - "${DATE}" > ${LOG}
print - "`uname -a` \n" >> ${LOG}

print - "\n### Diskinfo for `uname -n`" >> ${LOG}
/etc/ioscan -fn -C disk |grep "/dev/rdsk" |awk '{print $2}' |while read DEV

do
  diskinfo $DEV
done >> ${LOG}

print - "\n### LVM Configuration " >> ${LOG}
vgdisplay |grep "Name" |awk '{print $3}' |while read VOL 
 
do
  ls -1 $VOL |while read VDRV
  do
    lvdisplay -v $VOL/$VDRV |grep -v "^  "
  done
done >> ${LOG}
 
print - "### LVM Group size and free " >> ${LOG}
vgdisplay -v |grep -E '^VG Name|^PE Size|^Free PE' >> ${LOG}

# mailx -s "Disk Configuration for ${HOST}" user@host.com < ${LOG}


     (thanx bear!)

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

EMAIL TO: john@wagoneers.com Copyright © 1997 John Meister All rights reserved.