Data Protector Practitioners Forum
cancel

export list of clients

tjungs
Absent Member.

export list of clients

I need to extract a list of all the clients with the Dataprotector installed, or a list of clients I can do restore from (just the hostname)

Basically I want a scheduled job to output this to a file every day.

I've looked at CLI reference, but I need some expert help here.

Is this a report, or which of the omni commands can I run to achieve this?

Best regards
Torben
11 REPLIES
Eblyn Solis Acclaimed Contributor..
Acclaimed Contributor..

Re: export list of clients

Hi ,

maybe this command can help:
#omnicellinfo -cell

Run this on cell manager.

Regards
Please assign a kudo to this post, if you find it useful.
Luc Minnaert Trusted Contributor.
Trusted Contributor.

Re: export list of clients

all that info is stored in an ascii file called cell_info........
and this is incorporated in the backup of the IDB
hence you probably have already a version on backup media anyway
tjungs
Absent Member.

Re: export list of clients

Thanks for the suggestions. omnicellinfo -cell returns way to much information.

the cell_info file is better, but i need to strip away the host and the rest, so only the hostname remains.

Know any tools for this?

Example file:
-host "raddmz002.dkrmed.internal.rmg" -os "microsoft i386 wNT-5.2-S" -da A.06.00 -ma A.06.00 -cc A.06.00
-host "raddmz008.dkrmed.internal.rmg" -os "microsoft i386 wNT-5.2-S" -da A.06.00 -ma A.06.00 -cc A.06.00
-host "raddmz004.dkrmed.internal.rmg" -os "microsoft i386 wNT-5.2-S" -da A.06.00 -ma A.06.00 -cc A.06.00
-host "raddmz009.dkrmed.internal.rmg" -os "microsoft i386 wNT-6.0-S" -mac -da A.06.00 -ma A.06.00 -cc A.06.00

Change to:
raddmz002
raddmz008
raddmz004
raddmz009

Thanks
brokenwh
Absent Member.

Re: export list of clients

by default, where would this file be located?

brokenwh
Absent Member.

Re: export list of clients

by chance is there a script that outputs this information to a csv or txt file?

Bob_Clark
Absent Member.

Re: export list of clients

You may want to try this, although I have never used it myself

 

(Note: type the command directly, do not Copy/Paste from this Forum string)

 

   omnirpt -report cell_info -tab -log [destination file path]

 

You did not specify whether your Cell Manager is uNIX or Windows, but, assuming it is Windows, your [destination file path]  (Do not include the [  ] marks) might be something like    D:\temp\list_of_hosts.txt

 

As you can see this is output as a 'text' file, but wait, there's more.  The '-tab' argument means that the output fields are seperated by 'tab' characters, and, therefore, the output can be put into a Excel spread sheet, where you can exclude any columns that are not useful. Unfortunately, the 'omnirpt' does not get any more granular than this

 

The command can be put into a 'batch' file or a UNIX script in the 'Program Data -> Omniback -> bin folder, and can be run as a pre-exec or post-exec script

Jaystone Trusted Contributor..
Trusted Contributor..

Re: export list of clients

That is a useful cmd. 

What I need is a report that will list out all the clients by name. what I mean is this. I want DP to go find all the servers that are being backed up, find there hostname and dsiplay it, or even better export this to a txt or csv file.

IE=

servername1

servername2  etc....

without all the other info. is there a command for this? as I have been trying to use the onmicellinfo, and the omnirpt to no avail. 

I have a fully windows environment, with just one cell manager.

Jay Reafs
zitbb Trusted Contributor.
Trusted Contributor.

Re: export list of clients

Hi,

copy and paste the following with Admin rights into Powershell ISE on the Windows Cell Manger and click Run. The output is in a file called hpdp_clients.txt in C:\temp :

$HPDP_command = @(omnicellinfo -cell brief)
$HPDP_clients= $HPDP_command -like "   host=*"
$HPDP_clients| foreach {
$HPDP_clients_trimmed = $_.split("`"")
$HPDP_clients_trimmed[1]
} | Out-File -FilePath C:\temp\hpdp_clients.txt

Hope that works for you.

Jaystone Trusted Contributor..
Trusted Contributor..

Re: export list of clients

This was great! Thank you. I apologize for the long delay.

this does pull all the machines I see under the "clients" tab. 

Is there a way to pull all of the VM's that are being backed up as well?

Thanks,

Jay Reafs
zitbb Trusted Contributor.
Trusted Contributor.

Re: export list of clients

Hi,

I don't have any VMs in my environment. So unfortunately I can not help you with that. But the first line of that script just executes an Omni (Data Protector) command and pipes the output into a variable. So take the omni command that is helpful with your VMs and go from there in Powershell.

Highlighted
Gamut Super Contributor.
Super Contributor.

Re: export list of clients

Is there a way to pull all of the VM's that are being backed up as well?

The list of clients you got, are NOT necessarily backed up. It is only a list of clients, not a list of backed up clients.

I just found a possible way, but it is not for the faint of heart. More disclaimer: I do not know the data model in the database of DP; I can only guess. I may have guessed incorrectly...

 

First, get the database password. My solution (on Linux):

awk -F\' '/^PGSUPERPASSWORD=/ {print $2}' /etc/opt/omni/server/idb/idb.config | base64 --decode; echo

Second, connect with the PostgreSQL database of DP. (If your DP runs on Raima, you obviously cannot use psql).

/opt/omni/idb/bin/psql -h localhost -p 7112 -U hpdp hpdpidb

 

Third, query away:

select distinct regexp_replace (options, '^.*vmName=''([^'']+).*$', E'\\1') from dp_session_obj_copies where label = 'VEAgent' and end_time > extract (epoch from (date_trunc ('day', now ()) - interval '24 hours')) order by 1;

 

You can also paste the query in a file (say vmquery.sql) and then run the following as root:

/opt/omni/sbin/omnidbutil -run_script /tmp/vmquery.sql -detail

(The only reason to run it as root, is that the default permissions of omnidbutil do not allow it to be run by mortals.)

 

 

Personnally, I scrape all sessions, all session objects and all session messages and put them in my own DB. I scrape them via omnirpt. This gives you another approach to the problem. If you are on Linux, try this oneliner:

CELLMANAGER=localhost; /opt/omni/bin/omnirpt -report list_sessions -timeframe 24 24 -tab -server "${CELLMANAGER}" | awk -F$'\t' '/^[^#]/ {print $23}' | while read -r SESSION_ID; do /opt/omni/bin/omnirpt -report session_objects -session "${SESSION_ID}" -tab -server "${CELLMANAGER}" | awk -F$'\t' '/^[^#]/ {print $2}'; done | sort | uniq

If you are on Windows, then choose an appropriate scripting alternative. For instance, Power Shell should be able to run the commands, loops, and should be able to filter on tab separated field not starting with a hash mark.