cancel
Showing results for 
Search instead for 
Did you mean: 

CLI Command to list Host ID

kumar3
Level 4
Certified

Hello Experts,

I need to know the CLI command which is equivalent to following option from NetBackup admin console.

Security Management -> Host Management -> Netbackup Host ID

Want to list certificate expiry date and host ID for given host from master server.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

tcsimerson
Level 3
Employee

Try using the command "nbcertcmd -listAllDomainCertificates" from the primary server.  This actually makes a web API call in the background.  You'll need to log into the web server using the command "bpnbat -Login -LoginType WEB".  You'll be prompted for the Authentication Broker (your primary server FQDN), the Authentication Port (just press enter for default), Authentication type (enter unixpwd assuming your primary is running on Linux), and finally a user login and password.

Tom Simerson

View solution in original post

10 REPLIES 10

L_BR
Level 5

You can use:

/usr/openv/netbackup/bin/admincmd/nbhostmgmt -list -short

It gets a bit messy with multiple mapped names.

kumar3
Level 4
Certified

Thanks for the reply, this command gives one result with host_id, but still missing the certificate expiry date. I tried to option -json also but seems its not there.

kumar3
Level 4
Certified

I need command similar to following but that should work from master server and give result for all clients at once, or any client if passed as an argument in the command.

/usr/openv/netbackup/bin/nbcertcmd -listcertdetails

Hi @kumar3 

Try this command - I think it gives what you want for all clients (not a specific one):
nbcertcmd -listcertificate | jq 

You will probably need to use bpnbat to login before running (it will let you know if you do).

The output from listcertificate is a mess without the jq (json processor to make it readable). The certificate expiry is included, but is displayed as a ctime value (which is simple enough to convert to a date).

Cheers
David

Hi @kumar3 

You can also use the nbhostmgmt command to show all or specific host details (-list & -list -host <host>). The output from this command is human readable but does not include the certificate issue/expiry dates (nor does the Host Management section in the GUI for that matter). The nbcertcmd is the only option to provide both the hostID and the certificate dates. 

A quick update on the output from the nbcertcmd -listcertificate output - the times shown for notBefore and notAfter is the ctime multiplied by 1000. So drop the last 3 zeros, before converting. 

David

I am still not able to find any command which can give certificate expiry of any client from master server. Is there such command available in NetBackup, if yes, plz provid.

Hi @kumar3 

Can you explain what is missing form the "nbcertcmd -listcertificate | jq" command? This rovides the details you requested. 

David

Hi, I need to run this command on each client to get the details. But I am looking for command which works on master server but provide certificate expiry date for clients.

tcsimerson
Level 3
Employee

Try using the command "nbcertcmd -listAllDomainCertificates" from the primary server.  This actually makes a web API call in the background.  You'll need to log into the web server using the command "bpnbat -Login -LoginType WEB".  You'll be prompted for the Authentication Broker (your primary server FQDN), the Authentication Port (just press enter for default), Authentication type (enter unixpwd assuming your primary is running on Linux), and finally a user login and password.

Tom Simerson

kumar3
Level 4
Certified
Thx, this is the one I was looking for