Netbackup Appliance API calls not working
Hi all,
I am trying to run powershell script (based on API) to monitor Netbackup Appliance without success. Using the same script on the ordinary Netbackup was ok. So, what could be the difference between the Netbackup Appliance and Netbackup?
Script to gather information about running services (https://github.com/VeritasOS/netbackup-api-code-samples/blob/master/recipes/powershell/admin/get_services.ps1)
The error output from Netbackup Appliance:
PS C:\Users\Administrator\Desktop> ./get_services.ps1 -MasterServer <hostname> -UserName <user_name> -Password <password> -Client <hostname>
Sending a POST request to login to the NetBackup webservices...
Login successful.
Sending a GET request to get host UUID ..
Invoke-WebRequest : Vzdálený server vrátil chybu: (401) Neověřeno.
At C:\Users\cz.jcieslar\Desktop\get_services.ps1:111 char:14
+ $response = Invoke-WebRequest `
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Unable to get host UUID.
At C:\Users\Administrator\Desktop\get_services.ps1:119 char:3
+ throw "Unable to get host UUID.`n"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Unable to get host UUID.
:String) [], RuntimeException
+ FullyQualifiedErrorId : Unable to get host UUID.
It seems according to error (401),that our user has not enough priviliges to be able to gain UUID of the Appliance. However the login was successful, so the API token was generated without problem.
Do you have any idea how to increase user priviliges on the Netbackup Appliance? Do you have any experience with API powershell calls on the Netbackup Appliance?
I am looking forward for any suggestions!
I think that admin user does not have access to web UI. And as webUI is 100% API calls, I imagine that the user can not do what you want.
Create another user from the clich, give him the right permissions from the webui and test your scripts