#!/bin/bash
#!/usr/bin/ksh
#
#---------------------------------------------------------------------------------
# Program : veritas_info
# Function : Performs veritas license check - several veritas version support
# Author : xxx xxx
# History : 11.09.2007 - alchy - new
#
#---------------------------------------------------------------------------------
LIST="/here/is/the/server/list"
echo "Output for list ${LIST} @ " `hostname`
for host in `cat ${LIST} | awk -F":" '{ print $1 }'`
do
VERITAS=`ssh $host "df -kl | grep dev | grep vx | wc -l"`
if [ ${VERITAS} ] # can we connect?
then
echo -n "host: $host vx_fs: ${VERITAS} "
if [ "${VERITAS}" -gt 0 ]; then
if [ `ssh $host 'ls /opt/VRTSvlic/bin/vxlicrep 2> /dev/null'` ]
then
echo "vxlicrep" > /tmp/veritas_${host}
ssh $host '/opt/VRTSvlic/bin/vxlicrep' >> /tmp/veritas_${host}
# PERMANENT
cat /tmp/veritas_${host} | grep "License Type" | grep "PERMANENT" > /dev/null
if [ $? -eq 0 ]
then
echo -n "license_permanent "
fi
# DEMO
cat /tmp/veritas_${host} | grep "License Type" | grep "DEMO" > /dev/null
if [ $? -eq 0 ]
then
echo -n "license_limit ("
cat /tmp/veritas_${host} | grep "Demo End Date" | while read license
do
END_DATE=`echo $license | awk -F" " '{ print " end: "$5 " " $6 " " $7 " " $9 }'`
echo -n " " ${END_DATE}
done
echo -n " )"
fi
elif [ `ssh $host 'ls /usr/sbin/vxserial 2> /dev/null'` ]; then
echo "vxserial" > /tmp/veritas_${host}
ssh $host "/usr/sbin/vxserial -p" >> /tmp/veritas_${host}
# DEMO
cat /tmp/veritas_${host} | grep "Expiration date" | grep "No expiration date" > /dev/null
if [ $? -eq 0 ]
then
echo -n "license_permanent "
else
# EXPIRATION
echo -n "license_limit ("
cat /tmp/veritas_${host} | grep "Expiration date" | while read license
do
END_DATE=`echo $license | awk -F" " '{ print " end: "$5 " " $6 " " $7 " " $9 }'`
echo -n " " ${END_DATE}
done
echo -n " )"
fi
elif [ `ssh $host 'ls /usr/sbin/vxlicense 2> /dev/null'` ]; then
echo "vxlicense" > /tmp/veritas_${host}
ssh $host "/usr/sbin/vxlicense -p" >> /tmp/veritas_${host}
# DEMO
cat /tmp/veritas_${host} | grep "Expiration date" | grep "No expiration date" > /dev/null
if [ $? -eq 0 ]
then
echo -n "license_permanent "
else
# EXPIRATION
echo -n "license_limit ("
cat /tmp/veritas_${host} | grep "Expiration date" | while read license
do
END_DATE=`echo $license | awk -F" " '{ print " end: "$5 " " $6 " " $7 " " $9 }'`
echo -n " " ${END_DATE}
done
echo -n " )"
fi
else
echo "No relevant method for finding the license information found!"
fi
else
echo -n "no_veritas_found"
fi
echo
fi
done
[ add comment ] ( 11 views ) | [ 0 trackbacks ] | permalink