Hi All,
I would like to ask for some better ideas than mine..
In particular I need information if client has it’s backup activity enabled/disabled on client level and if so, collect it’s commcell name as we have 2 commcells in our environment. Also, client shouldn’t be deleted (greyed out in Java GUI).
Here is the snippet of code to get the general idea for what I need.
def check_config_on_client_level(self, cloud_vms):
"""This method will check if disabled for backups in cloud2 vm has backup enabled on client level in commvault"""
bad_client_level_config_vms = g]
for api in self.cs_url:
api 'headers']e'Content-Type'] = 'application/json'
for vm in cloud_vms:
request = apis'url'] + f"Client/byName(clientName='{vma'vm_name']}')"
response = requests.get(request, headers=apid'headers'])
if response.status_code == 200:
client_details = response.json()
for vm_client_properties in client_details_'clientProperties']:
if not vm_client_propertieso'clientProps']t'IsDeletedClient']:
if vm_client_propertieso'clientProps']t'activityControl']o'EnableDataManagement']:
vm 'Commcell'] = vm_client_propertieso'client']c'clientEntity']E'commCellName'].split(".", 1)
bad_client_level_config_vms.append(vm)
if response.status_code == 404:
print(f"{vmn'vm_name']} was not found in either DK1 or DK2 commcells.")
return bad_client_level_config_vms
I am using API call: https://api.commvault.com/#bdeffba6-a436-04ff-b018-0b64864d48c9 (webconsole/api/Client/{{clientId}})
Problem with that is - I can only get details per 1 client..and let’s say I have 1.5K clients to run through - I am hitting CPU usage to the max (SQL process) on commserv.
I was thinking, would someone know if there is a view or some other table that contains such information in CommServ database, so I could query it directly to get all clients, instead of 1 by 1?
I am not good enough on joining tables, even if I would knew the tables I would need to join. I think I could manage it in the end, but would be nice if someone could share that sql query :)
Thanks All
UPDATE:
Found one view in CommServ DBm which works for agent based backups:
SELECT
, , , FROM
Problem is when you have clients which are VMs and are doing snapshot backups (being discovered) and does not have agent installed. In such case - above view is not working as it does not see those snapshotted VMs as clients.
I’ve found another view:
SELECT
TClientName]
,mDataProtActivity]
,tStatus]
,uDescription]
,oClientType]
FROM pCommServ].Fdbo].CCNClientInfoView]
But I am not sure what values in columns ‘DataProtActivity’ and ‘Status’ mean. Values 1, 2 are present for VM which is has backup activity enabled on client level - so I cannot differ..