cancel
Showing results for 
Search instead for 
Did you mean: 

Please provide a command to get the deactivate policy list and date

RaymT___
Level 4

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.!

6 REPLIES 6

mph999
Level 6
Employee Accredited

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"

 

Policy Name:       CatBack_Disk
Active:            yes
Policy Name:       CatBack_Tape
Active:            yes
Policy Name:       catarc
Active:            no
Policy Name:       flump_full
Active:            yes
Policy Name:       mhwin2008_full
Active:            yes
Policy Name:       test_nick
Active:            no
Policy Name:       womble_SLP
Active:            yes
Policy Name:       womble_basic_disk
Active:            yes
Policy Name:       womble_robot_0
Active:            yes
Policy Name:       womble_robot_1
Active:            yes
 
Looking at this technote, we see that in NetBackup 7.0.1 and above, there is the audit feature :
 
http://www.symantec.com/docs/TECH139600
 
Running this command ...  I see the details of the policy being deactivated.
 
nbauditreport -fmt DETAIL
 
DESCRIPTION: Policy 'test_nick' was deactivated
USER: root@womble
TIMESTAMP: 12/28/11 09:28:35
CATEGORY: POLICY
ACTION: MODIFY
REASON:
DETAILS:
    ATTRIBUTE                OLD VALUE                 NEW VALUE
  1 Policy State             Active                    Inactive
  2 Policy Generation        15                        16
 
 
DESCRIPTION: Attributes of Policy 'test_nick' were modified
USER: root@womble
TIMESTAMP: 12/28/11 09:27:07
CATEGORY: POLICY
ACTION: MODIFY
REASON:
DETAILS:
    ATTRIBUTE                OLD VALUE                 NEW VALUE
  1 Data Mover Type          Unknown                   Media-Server-Copy
  2 Policy Generation        14                        15
 
 
Regards,
 
Martin

Mark_Solutions
Level 6
Partner Accredited Certified

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

J_H_Is_gone
Level 6

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.

RaymT___
Level 4

Thanks for all... will try out....

RonCaplinger
Level 6

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

Amarnath_Sathis
Level 5

Hi Ron,

 

Whether this script provide the date on which the poliy got de-activated ?