#!/bin/ksh -p # # vx_list: Sun Enterprise Server check - BB external script test # # version 1.0 # version 1.1 - properly uses $CAT instead of cat # version 1.2 - properly uses $MACHINE instead of `uname -n` in bb-hosts check # version 1.3 - properly uses $THIS_HOST instead of $MACHINE due to fqdn using comma in name - thanks Craig Cook # version 1.4 - updated the grep -v syntax to accomodate users who use "-" in the disk or group name # version 1.5 - uses new variables (VX_DISK_LIST, DMP_DEV_LIST) from bbsys.local # - checks for disabled in disk list # version 1.6 - properly finds failed disks now # # BIG BROTHER / XXXXXXXXXXXXXXXX status # # Written by Paul A. Luzzi # on March 22, 2000 # ######################################## # NOTE # This has been tested with BB 1.2b, 1.4h2, 1.5, 1.5a # # Tested on : # Sun Ultra 60, E220R/420R, E250/450, E3000/3500, E4500 ######################################## ######################################## # INSTALLATION # step 1 - update the EXT section of the runbb.sh script to include this # ... ######################################## ################################## # CONFIGURE IT HERE ################################## ################################## # Start of script ################################## if test ! "$BBHOME" then echo "template: BBHOME is not set" exit 1 fi if test ! -d "$BBHOME" then echo "template: BBHOME is invalid" exit 1 fi if test ! "$BBTMP" # GET DEFINITIONS IF NEEDED then echo "template: The BB environment is not set" exit 1 fi ##### ##### Start of custom section added by Paul A. Luzzi ##### ##### ##### Get Status proc - used to get all responses ##### get_status() { ##### ##### Setup any and all variables before beginning. ##### ##### ##### Modified extensively on 03-22-2000 by Paul A. Luzzi ##### for use with Big Brother ##### ##### Purpose is to report back to a central server, all "standard" ##### detailed information about network, disk, volume, cpu, memory ##### which is not reported thru regular "easy" checks. ##### ##### Any problem areas should be highlighted in : ##### bold, italics, and red font. ##### ##### ##### Setup some variables for use later ##### COLOR="green" ##### ##### Veritas disk information "vxdisk list" ##### echo "


" echo "============== Disks under Veritas Control ==============" echo "============== Reporting all, only checking configured ==============" echo "--- (vxdisk list) ---" echo "
" echo "
" CATCH_COMMAND=` $VXDISK list | $GREP -v "-" ` CATCH_COMMAND1=` $VXDISK list ` CATCH_COMMAND2=` echo $CATCH_COMMAND | $EGREP "error|invalid|disabled" ` CATCH_COMMAND3=` $VXDISK list | $EGREP "failed" ` if [ ! -z "$CATCH_COMMAND3" ] then COLOR="red" echo "Problem with vxdisk list. Some disks show failed status !!!\n" fi if [ -z "$CATCH_COMMAND2" ] then echo "$CATCH_COMMAND1" else COLOR="red" echo "Problem with vxdisk list. Some disks not fully online or disabled !!!\n" echo "$CATCH_COMMAND" fi echo "
" ##### ##### Make sure to export COLOR so that it gets back to "central" ##### export COLOR ##### ##### End of get_status proc ##### } ##### ##### Main body ##### touch /tmp/$THIS_HOST.vx_list $GREP $THIS_HOST $BBHOSTS | $GREP "vx_list" | while read line do if [ ! -z "$line" ] then echo "

" > /tmp/$THIS_HOST.vx_list echo "Veritas disk list on $THIS_HOST " >> /tmp/$THIS_HOST.vx_list echo "Captured : `$DATE` " >> /tmp/$THIS_HOST.vx_list get_status >> /tmp/$THIS_HOST.vx_list $BB $BBDISP "status $THIS_HOST.vx_list $COLOR `$DATE` `$CAT /tmp/$THIS_HOST.vx_list` " else COLOR="clear" $BB $BBDISP "status $THIS_HOST.vx_list $COLOR `$DATE` `$CAT /tmp/$THIS_HOST.vx_list` " fi done ##### ##### End of custom section added by Paul A. Luzzi ##### ############################################## # end of script ##############################################