Hi Stefan,

Thank you very much for your reply!
I discovered that looking for a "Configured for failover to server 
<SERVERNAME>" from a q session doesn't work either. When you create a new 
client, the q session will always show "Not configured for failover". Only 
after the first replication, this changes to "Configured for failover to server 
<SERVERNAME>". So this made it a lot more difficult. I decided to create a 
read-only admin account and advised the Windows guys to use the admin client to 
determine on which server a client exists in repl_mode=send. In fact you can 
use the admin client without the need to install it locally, by using the 
dsmadmc.exe, along with 3 other files.
It's not the most elegant solution, but at least it works. Personally I think 
IBM should build something into the client itself to find the right server to 
back up to.

Kind regards,
Eric van Loon
Air France/KLM Storage & Backup

-----Original Message-----
From: ADSM: Dist Stor Manager <ADSM-L@VM.MARIST.EDU> On Behalf Of Stefan 
Folkerts
Sent: woensdag 11 augustus 2021 10:11
To: ADSM-L@VM.MARIST.EDU
Subject: Re: Finding the right server when using replication (Windows)

Hi Eric, I am by no means a programmer but I have done some work with 
powershell. I would while loop thru the servers and use something like 
transcribe (powershell command) to capture and log the output of the dsmc 
command to a temp file on disk after each dsmc attempt and then use 
select-string (
https://www.thomasmaurer.ch/2011/03/powershell-search-for-string-or-grep-for-powershell/)
to search for the string you want to check on, and start the correct function 
based on the outcome. I'm 100% sure it can be done without these writes and 
reads but for these kinds of things I figure it won't make that much of a 
difference.

Regards,
  Stefan

On Tue, Jul 27, 2021 at 4:41 PM Loon, Eric van (ITOP NS) - KLM < 
eric-van.l...@klm.com> wrote:

> Hi everybody,
>
> We recently switched to a new server design based on node replication. 
> My Windows users always used scripts which went through all TSM/SP 
> servers to find the right one by just trying to connect to them, one 
> by one. As soon as the dsmc q sess command returned return code 0, it 
> found the right server. This always worked, until we switched to node 
> replication. Now all of a sudden, there are two servers which return 
> rc=0, but only one of them can be used for backups, the primary replication 
> server.
> I have been struggling to find a way how to determine which server is 
> the primary and which is the replica server. I noted that if you 
> connect to the correct server, the last line of the query session 
> output is "Configured for failover to server <SERVERNAME>". If you 
> connect to the replica, the last line is "Not configured for failover".
> Now I need to find a way (preferably though PowerShell) to read this 
> last line and generate a rc=0 if it contains "Configured for failover to 
> server"
> and a higher return code if it contains "Not configured for failover". 
> Has anybody with Windows scripting knowledge has any idea how to do this?
> Thanks for any help in advance!
>
> Kind regards,
> Eric van Loon
> Air France/KLM Storage & Backup
> ********************************************************
> For information, services and offers, please visit our web site:
> http://www.klm.com. This e-mail and any attachment may contain 
> confidential and privileged material intended for the addressee only. 
> If you are not the addressee, you are notified that no part of the 
> e-mail or any attachment may be disclosed, copied or distributed, and 
> that any other action related to this e-mail or attachment is strictly 
> prohibited, and may be unlawful. If you have received this e-mail by 
> error, please notify the sender immediately by return e-mail, and delete this 
> message.
>
> Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or 
> its employees shall not be liable for the incorrect or incomplete 
> transmission of this e-mail or any attachments, nor responsible for any delay 
> in receipt.
> Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal 
> Dutch
> Airlines) is registered in Amstelveen, The Netherlands, with 
> registered number 33014286
> ********************************************************
>
********************************************************
For information, services and offers, please visit our web site: 
http://www.klm.com. This e-mail and any attachment may contain confidential and 
privileged material intended for the addressee only. If you are not the 
addressee, you are notified that no part of the e-mail or any attachment may be 
disclosed, copied or distributed, and that any other action related to this 
e-mail or attachment is strictly prohibited, and may be unlawful. If you have 
received this e-mail by error, please notify the sender immediately by return 
e-mail, and delete this message.

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its 
employees shall not be liable for the incorrect or incomplete transmission of 
this e-mail or any attachments, nor responsible for any delay in receipt.
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch 
Airlines) is registered in Amstelveen, The Netherlands, with registered number 
33014286
********************************************************

Reply via email to