12-27-2011 09:39 PM
Hi All,
I'm looking for a report that will show all of the deactivated NetBackup policies, and the date that they were deactivated. I'm not seeing a date field. Is there any way to get that info?
Please provide a command to get the deactivate policy list and date.
Thanks in advance.!
12-28-2011 01:09 AM
It cannot be done in one command :
You could do this :
This command will give you the policy states ... we see here the policy test_nick is not active ...
root@womble admincmd $ bppllist -allpolicies -verbose -L |egrep "Policy Name|Active"
12-28-2011 05:16 AM
It wont help you right now but if your concern is to track you policy activation / deactivation then OpsCenter (NOM) has a specific alert policy for this.
Any policy changes send an alert
Alternatively you could set up a script / scheduled task to list out your policies each day so that at least you keep a record of them, just add date variable to the text file name :
bppllist -allpolicies -U>policy_list.txt
Hope this helps
12-28-2011 07:43 AM
When I activate a policy I put the date and time in the "Go into effect at" so I know when I created the policy.
And when I deactivate a policy I put the date and time I tuned it of into that field - then if I do not need it again after a month I know I can remove it.
12-28-2011 09:51 PM
Thanks for all... will try out....
12-30-2011 10:42 AM
I'm not a wizard of scripting, but I was able to cobble something together from things I found on the internet. I have this in one file, called "check_offline_clients.sh"
find /usr/openv/netbackup/db/client/ | grep OA_ | grep -v OA_0 | nawk '{sub(/\/usr\/openv\/netbackup\/db\/client\//," ");print}' | nawk '{sub(/\/OA_/," ");print}' | while read clt date; do now=`date +%s`;export now; if [ $now -le $date ]; then ntime=`/usr/openv/netbackup/bin/bpdbm -ctime $date`; echo $clt is offline until $ntime '\n'; fi; done
And it gets called by this script, "nb_check_offline.sh":
#!/bin/sh
#Set variables
BACKUPADMS='your email addresses'
CLIENTFILE='/tmp/nb_offline_clients.txt'
#execute command to list all offlined clients
/opt/local/ourstuff/check_offline_clients.sh > $CLIENTFILE
#If tempfile containes data, send the list of offline clients to the temp email file, else report no offline clients
if [ `ls -l $CLIENTFILE | awk '{print $5}'` -eq 0 ]
then
echo "No clients defined as OFFLINE to the NBU master server." > /tmp/NBU_offline_email.txt
else
echo "The following clients are defined as OFFLINE in the NBU Master Server's properties: \n" > /tmp/NBU_offline_email.txt
more $CLIENTFILE >> /tmp/NBU_offline_email.txt
fi
echo "\n \n" >> /tmp/NBU_offline_email.txt
echo "----> Script Location: /opt/local/capella/nb_check_offline.sh" >> /tmp/NBU_offline_email.txt
cat /tmp/NBU_offline_email.txt | mailx -s "NetBackup Offlined Clients" ${BACKUPADMS}
rm $CLIENTFILE
04-01-2012 10:05 AM
Hi Ron,
Whether this script provide the date on which the poliy got de-activated ?