Scripting is a personal thing — everyone has their own style.
So I’ll give you the commands I would use, and I’m sure you can adjust them to fit your needs.
Since I like to log every step — often with more info than I actually need — I always create a temporary folder and write the output of every command there.
At the end, I archive the folder into a .tar.gz file and move it to a logs directory.
- create a list of vmware active poilicies.
create list of policy, active, type and filter or clients (you will need jq command)
/usr/openv/netbackup/bin/admincmd/bppllist -json | jq -r '.policies[]
| select(.pinfo.active == 0 and .pinfo.PolicyTypeText == "VMware")
| "\(.class_name) \(.pinfo.active) \(.pinfo.PolicyTypeText) \(.include[])"'
cat the output and print only the first column
awk '{print $1}'
- for every policyname run the command davidmoline give you. it is the only way to create the vmware list of what will be included in the backup.
nbdicscover -includedonly -noxmloutput -policy <VMwarePolicy>
- run the bpimagelist command to get the list of successfull vms for the last $x hours. Comparing the two list will give you the failed VMs.
bpimagelist -pt VMware -hoursago $x |grep IMAGE |awk '{print $2}' |sort -u
I personally ran the same using bpdbjobs and was able to get both the successful and unsuccessful VMs.
However, it requires some logic to determine whether a failed backup was retried and eventually succeeded.
sdate=`date +%m/%d/%Y -d "1 day ago"`
datex=`echo ${sdate} 08:00`
bpdbjobs -all_columns -t ${datex} |awk -F"," '{if ( $22 == "40" ) print $0}' > ${temp}/backup_list.txt
cat ${temp}/backup_list.txt |awk -F"," '{if ( $2 == 0 && $3 == 3 && $4 == 0 ) print $0}'|awk -F"," '{print $5","$6","$7}' > ${temp}/success.txt
cat ${temp}/backup_list.txt |awk -F"," '{if ( $2 == 0 && $3 == 3 && $4 != 0 ) print $0}'|awk -F"," '{print $5","$6","$7}' > ${temp}/unsuccess.txt
- To check if all VMs are included in backup policies, you can use bpVMutil.
This command generates a list of all VMs (with many details) from all vCenters and saves it to /tmp.
You can then compare this list with the output of nbdicscover to identify which VMs are not selected for backup.
bpVMutil 0 NOCACHE 0
cat the output and |grep DN
I have a customer with 10 vCenters and more than 1500 VMs. All commands complete within acceptable timeframes.
I had to resolve network connectivity issues to eliminate downtimes.
For some policies, I restrict vCenter usage through the policy’s advanced properties.
If you are experiencing time constraints, you can use the bpimage or bpdbjobs commands to get a list of VMs that had backups run, and then compare that with the output of bpVMutil.
The advantage of the bpVMutil command is that the VM list is refreshed every time it runs.
If you use a static VM list (for example, from RVTools), it may miss newly added VMs.
If you have mixed policies and use filters along with static VM names, then it’s best to use bpimage or bpdbjobs.
I believe I haven’t forgotten anything. I would like to hear your thoughts.
Off topic,
what happened to the VIP and other badges?