BB Unix Network Monitor - Message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: {bb} Update Made To bb-vxcheck.sh



On Wed, 2005-09-28 at 14:59, chris.ivey@verizon.com wrote:
> Brothers,
>         After posting the question to the list and not getting any answers 
> to my question that were satisfactory (no worries, though....), I took it 
> upon myself to update bb-vxcheck.sh and would like to share that update 
> with the world.  Here is the situation:
> 
> Problem: vxdisk check portion of the script was not working
> Diagnosis: vxdisk check requires a disk group be provided before running 
> the command (vxdisk -g {group} check {disk}
> Solution:  In my environment, I opted to copy the vx commands to 
> $BBHOME/ext/bin and change the permissions... no worries since nobody 
> outside my direct group has access to the server.  The only thing I did 
> was hardcode my pathing into the script.  I would like to be able to use 
> the globals defined in $BBHOME/etc/bbsyslocal.  Anwyays, here are the 
> changes:
> 
> Original:
> 
>   VX_DISK_LIST=` $AWK '{print $3}' $VXDISK_TMP |
>                  $UNIQ |
>                  $GREP -v "-" |
>                  $GREP -v "DISK" `
> 
>   CATCH_COMMAND=` for VX_DISK in $VX_DISK_LIST
>                   do
>                       $VXDISK_CHECK $VX_DISK
>                   done `
> 
> ...
> 
>   CATCH_COMMAND2=` for VX_DISK in $VX_DISK_LIST
>                   do
>                       $VXDISK_CHECK $VX_DISK
>                   done | $GREP -v Okay`
> 
> Revised:
> 
>   VX_DISK_DG_LIST=` $AWK '{print $4","$3}' $VXDISK_TMP |
>                     $UNIQ |
>                     $GREP -v "-" |
>                     $GREP -v "DISK" |
>                     $GREP -v "GROUP" `
> 
>   CATCH_COMMAND=` for LINE in $VX_DISK_DG_LIST
>                   do
>                       echo $LINE | awk -F"," '{print $1,$2}' | while read 
> G D
>                       do
>                          /opt/BB/bbc/ext/bin/vxdisk -g $G check $D
>                       done
>                   done `
> ...
> 
>   CATCH_COMMAND2=` for LINE in $VX_DISK_DG_LIST
>                   do
>                       echo $LINE | awk -F"," '{print $1,$2}' | while read 
> G D
>                       do
>                          /opt/BB/bbc/ext/bin/vxdisk -g $G check $D
>                       done
>                   done | $GREP -v Okay`
> 
> I know that Craig Cook maintains this script.  Craig, I hope you like what 
> you see and can integrate it into the deadcat version.  If you have any 
> questions about it, feel free to email me directly at this address. 
> Thanks!

This is just a matter of personal preference, but I'd recommend
moving anything that's implementation specific to the top of the
script (appropriately commented, of course).

Normally, the variables from the BB environment will be available
to your script. If you follow the method in the "ext-proto" example,
this is checked and loaded if required. So, I'd do something like:

  ##  Set this to the full path to your "vxdisk" command.
  ##  For the normal location, this will be the following:
  ##  VXDISK_PATH="/usr/bin/vxdisk"
  ##  Or, if you use a copy of the command for BB:
  VXDISK_PATH="${BBHOME}/ext/bin/vxdisk"

After which, you can call it with:

  do
     $VXDISK_PATH -g $G check $D
  done

Finally, because it can be difficult to discern, I feel that I
should assure you that your efforts will be appreciated.

Cheers. Phil.



-- 
Like the ski resort of girls looking for husbands and husbands
looking for girls the situation is not as symmetrical as it might
seem. (Alan McKay)

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.


Home | Main Index | Thread Index