Friday, April 18, 2008

VERITAS netbackup test client connection

Veritas NetBackup (tm) 6.0 supplies a new command to test connections to clients. This command is the bptestbpcd command. This command is helpful because, unlike ping or nslookup, it tests for connection to a NetBackup Client using client connection options at the NetBackup communication level. Parameter switches allow a user to target a NetBackup Client or a host. Connection using the different Client Connect Options can also be tested. Troubleshooting is made easier by including the -verbose and -debug switches.


TO TEST DEFAULT CLIENT CONNECTIONS USING BPTESTBPCD
1. From a Windows command prompt change into the \veritas\netbackup\bin\admincmd directory, or in a UNIX console window, change into the /usr/openv/netbackup/bin/admincmd directory.
2. Type bptestbpcd /? to list the command parameters.
3. Run the command bptestbpcd -client xxxx (where xxxx is a clientname) to test connection to a client.
4. To view further details, run the command #bptestbpcd -client xxxx -verbose (where xxxx is a clientname).
5. To trace through the connection process, run the command bptestbpcd -client xxxx -debug (where xxxx is a clientname).

Sunday, April 13, 2008

Solaris/AIX Saving routing table before reboot

To capture routes
# ls
add_all_routes capture.sh
root@nstgdb2:/tmp/imran # more capture.sh
#! /bin/sh
netstat -rn |egrep -v "127.0.0.1|-|Routing|Destination" | awk '{ print $1"\t "$2
}'|cut -d"%" -f1 >routes
awk '{ print "route add ", $1,$2 }' routes >add_all_routes
#
To restore routes just run
#sh all_all_routes

VERITAS What is auto:cdsdisk

What is cdsdisk?
c1t0d0s2 auto:cdsdisk data1dg01 data1dg online
ANS: For a disk to be accessible by multiple platforms, the disk must be consistently recognized by the platforms, and all platforms must be capable of performing I/O on the disk. CDS disks contain
specific content at specific locations to identify or control access to the disk on different platforms.
The same content and location are used on all CDS disks, independent of the platform on which the
disks are initialized.


VERITAS Volume Manager (tm) 4.0 revised vxdg init default options ( cds=off ) need to be specified for all non-cdsdisk types when creating a new disk group.

Details:
In VERITAS Volume Manager 4.0, changes were made to the default disk group type and disk type attributes. Prior to Volume Manager 4.0, the default disk type was "simple" it is now "cdsdisk". If a device has a disk type of "cdsdisk", the additional vxdg init attribute is not required ( cds=off ).

Example
-------------
Create a new disk group using a cdsdisk type defined disk:

DEVICE TYPE DISK GROUP STATUS
c0t0d0s2 auto:none - - online invalid
c1t0d1s2 auto:cdsdisk - - online <-- Using this disk for this exercise
c1t0d2s2 auto:sliced - - online
c1t0d3s2 auto:sliced - - online
c1t0d8s2 auto:sliced ctd1 emcdg online
c1t0d10s2 auto:sliced - - online invalid
emcpower8c simple emc8 rootdg online
emcpower9c simple - - online

CDSDISK
# vxdg init testdg c1t0d1s2
The vxdg init command works fine, without the need for the "cds=off" argument as the disk type was cdsdisk.

Revised output:
c1t0d1s2 auto:cdsdisk c1t0d1s2 testdg online

Simple or sliced disk:
Sliced:
# vxdg init testdg2 c1t0d1s2
VxVM vxdg ERROR V-5-1-6478 Device c1t0d1s2 cannot be added to a CDS disk group

Workaround:
Add the cds=off argument:
# vxdg init testdg2 c1t0d1s2 cds=off

Simple:

# vxdg init newemcdg disk01=emcpower9c
VxVM vxdg ERROR V-5-1-6478 Device emcpower9c cannot be added to a CDS disk group

Now add the new attribute cds=off:
# vxdg init newemcdg disk01=emcpower9c cds=off
Revised output:
emcpower9c simple disk01 newemcdg online

Further Information
If the "cds=off" attribute is not specified with the vxdg init command, the /etc/default/vxdg file is searched for a definition of this attribute. If no such definition is found, the value "cds=on" is assumed. Add such a definition to this file if you wish to change the new default back.

Saturday, April 12, 2008

VERITAS to check volume size

root # more volume.txt
db_bkup
usrvol
root # more c.sh
#! /bin/sh
for i in `cat volume.txt`
do
vxprint -ht $i | grep -i fsgen | nawk '{print "volume ",$2,"Total size: " $6/2/1024 " Mb"}'
done
root # sh c.sh
volume db_bkup Total size: 138620 Mb
volume usrvol Total size: 2048 Mb

Veritas Mirror volume notes

# ls -l
total 64
-rw-r--r-- 1 root other 119 Apr 11 01:21 a.sh
-rw-r--r-- 1 root other 151 Apr 11 20:48 b.sh
-rw-r--r-- 1 root other 78 Apr 11 20:48 tmp.out
-rw-r--r-- 1 root other 61 Apr 11 20:34 volume.txt
# cat a.sh
#! /bin/sh
vxdg -g oradg free | nawk '
{
if ($5/2/1024 > 0)
print "... Free chunk on "$1"("$2")"" " $5/2/1024, "MB"
}'
# cat b.sh
#! /bin/sh
for i in `cat volume.txt`
do
echo $i
df -k | grep $i > tmp.out
cat tmp.out | awk '{print "Volume ",$1, "Total size: " $2/1024 " Mb"}'
done
# cat tmp.out
/dev/vx/dsk/oradg/s33_redo2 2097152 1273531 772150 63% /db/stg33/redo2
# cat volume.txt
s33_dbf1
s33_dbf2
s33_dbf3
s33_dbf4
s33_redo1
s33_redo2
#

Friday, April 11, 2008

VERITAS Calculate free disk space on each disk

root$ sh a.sh
... Free chunk on rootmirr(c0t1d0s2) 25226.6 MB
... Free chunk on rtdisk(c0t0d0s2) 5122.05 MB
... Free chunk on rtdisk(c0t0d0s2) 0.250977 MB
... Free chunk on rtdisk(c0t0d0s2) 0.255859 MB
... Free chunk on rtdisk(c0t0d0s2) 2049.67 MB
... Free chunk on rtdisk(c0t0d0s2) 550.151 MB
root$ more a.sh
#! /bin/sh
vxdg -g rootdg free | nawk '
{
if ($5/2/1024 > 0)
print "... Free chunk on "$1"("$2")"" " $5/2/1024, "MB"
}'
root@ebitb2b2 $

Thursday, April 10, 2008

UNIX: How to print column nicely using printf

[user@hostfwnms1-oam tmp]# cat b.sh printf "%-26s %-19s %-8s %-8s %-s %-s\n" HOSTNAME IP PING SNMPWALK 0-ok 1-fail for i in `cat n...