You are on page 1of 2

#!

/bin/ksh
# set -x
. /nsr/scripts/.profile
. /root/.profile

echo "Backup clients with savepnpc as backup command have a dependency on the
groups they belong to. Currently we have five clients that use savepnpc. Below is
the list of those clients and the groups they should belong to. If their backups
are run as part of any other group, then those backups are NOT valid. If you are
configuring any new clients with savepnpc, then please inform Praveen Tummala to
update the list.

1.) client mv3lenco01prv-dmz.smrc.sidra.org should belong to groups


MV3_FS_NWCL_018_D, MV3_FS_NWCL_018_M, and MV3_FS_NWCL_018_Y
2.) client mv3lmlnm01prv-dmz.smrc.sidra.org should belong to groups
MV3_FS_NWCL_018_D, MV3_FS_NWCL_018_M, and MV3_FS_NWCL_018_Y
3.) client mv3lmlnm01tev-dmz.smrc.sidra.org should belong to groups
MV3_FS_NWCL_018_D, MV3_FS_NWCL_018_M, and MV3_FS_NWCL_018_Y
4.) client mv3lmlnm01trv-dmz.smrc.sidra.org should belong to groups
MV3_FS_NWCL_018_D, MV3_FS_NWCL_018_M, and MV3_FS_NWCL_018_Y
5.) client mv3wexaa01prvc2-bkp.smrc.sidra.org (Enterprise Vault client) should
belong to groups MV3_FS_NWCL_020_D, MV3_FS_NWCL_020_M, and MV3_FS_NWCL_020_Y

This script is now checking whether savepnpc clients are indeed assigned to the
groups that they should belong to. If there are any descrepencies, then please
investigate why those descrepencies happened and fix. Contact Praveen Tummala if
you have any questions.
"
for i in mv3lenco01prv-dmz.smrc.sidra.org mv3lmlnm01prv-dmz.smrc.sidra.org
mv3lmlnm01tev-dmz.smrc.sidra.org mv3lmlnm01trv-dmz.smrc.sidra.org
do

EXPECTED_GROUP1="MV3_FS_NWCL_018_D;"
EXPECTED_GROUP2="MV3_FS_NWCL_018_M;"
EXPECTED_GROUP3="MV3_FS_NWCL_018_Y;"

ASSIGNED_GROUP1=`echo -e "show group\n print type:NSR client; name:$i" |nsradmin -s


mv3wbksv01prv -i - |grep group |sort -u |awk '{print $2}' |head -1`
ASSIGNED_GROUP2=`echo -e "show group\n print type:NSR client; name:$i" |nsradmin -s
mv3wbksv01prv -i - |grep group |sort -u |awk '{print $2}' |head -2| tail -1`
ASSIGNED_GROUP3=`echo -e "show group\n print type:NSR client; name:$i" |nsradmin -s
mv3wbksv01prv -i - |grep group |sort -u |awk '{print $2}' |tail -1`

if [ $EXPECTED_GROUP1 = $ASSIGNED_GROUP1 ] && [ $EXPECTED_GROUP2 = $ASSIGNED_GROUP2


] && [ $EXPECTED_GROUP3 = $ASSIGNED_GROUP3 ]
then
echo -e "Checking $i -----> No descrepencies found in the group assignment
\n"
else
echo -e "Checking $i -----> Descrepencies found in the group assignment.
Please investigate. \n"
fi

done

for i in mv3wexaa01prvc2-bkp.smrc.sidra.org
do
EXPECTED_GROUP1="MV3_FS_NWCL_020_D;"
EXPECTED_GROUP2="MV3_FS_NWCL_020_M;"
EXPECTED_GROUP3="MV3_FS_NWCL_020_Y;"

ASSIGNED_GROUP1=`echo -e "show group\n print type:NSR client; name:$i" |nsradmin -s


mv3wbksv01prv -i - |grep group |sort -u |awk '{print $2}' |head -1`
ASSIGNED_GROUP2=`echo -e "show group\n print type:NSR client; name:$i" |nsradmin -s
mv3wbksv01prv -i - |grep group |sort -u |awk '{print $2}' |head -2| tail -1`
ASSIGNED_GROUP3=`echo -e "show group\n print type:NSR client; name:$i" |nsradmin -s
mv3wbksv01prv -i - |grep group |sort -u |awk '{print $2}' |tail -1`

if [ $EXPECTED_GROUP1 = $ASSIGNED_GROUP1 ] && [ $EXPECTED_GROUP2 = $ASSIGNED_GROUP2


] && [ $EXPECTED_GROUP3 = $ASSIGNED_GROUP3 ]
then
echo "Checking $i -----> No descrepencies found in the group assignment"
else
echo "Checking $i -----> Descrepencies found in the group assignment.
Please investigate."
fi

done

echo " "


echo "Good Bye..."

You might also like