Connect Direct

Client Interface (cli)


Stop/Start Client Interface (cli)

Start des Client Interface (cli)
direct

Verlassen des Client Interface (cli)
quit;

Starten des Client Interface (cli) aus Scripten

ndmcli -x << EOF
sel proc;
quit;
EOF

Starten des Client Interface (cli) mittels Dateien

ndmcli < [file]

Starten des Client Interface (cli) über PIPE

echo ”sel stat pnum=??? det;” | ndmcli

Prozeß Infos

Anstehende Prozesse listen
sel proc;

detailierte Infos für speziellen Prozess

sel proc pnumber=??? detail=yes;
sel proc pnumber=??? detail=no;

Prozeß Status

Status von gelaufenen Prozessen listen:

sel stat pnum=??? detail=yes;
sel stat detail=no startt=(02/08/2004);
sel stat detail=no startt=(01/05/04,3:00) stopt=(01/05/04,3:30);
sel stat detail=no startt=(,17:30);

Status eines Prozesses ändern

change proc pnum=??? release;

C:D / Prozesse stoppen

Killen von Prozessen

flush process pnum=$1 pname=$2 force=yes;
delete process pnum=$1 pname=$2;

C:D stoppen

stoped force;


C:D starten

Für das starten des ConnectDirect liegt unter dem script directory ../cdtools ein shell script:
# startcd


Fehlercodes anzeigen

Der Befehl /usr//local//bin/msg ist ein shell script weches das ConnectDirect commando ndmmsg (siehe manual pages) benutzt um weitergehende Informationen bzgl. eines ausgegebenen Fehlercodes auszugeben.
# msg [Fehlercode]

alternativ kann der originale Befehl benutzt werden:
ndmmsg -f /opt/cdunix/ndm/cfg/msgfile.cfg [Fehlercode]


Verzeichnisse

Configuration:

Netzwerk:netmap.cfg; User:userfile.cfg
Die Verzeichnis liegen unter [ConnecDirect]/cdunix/ndm/cfg/[NODE]

Logfiles:

Die Log files sind unter [ConnecDirect]/cdunix/work/[NODE] zu finden.

netmap.cfg
hier werden die Knoten eingetragen mit denen eine Verbindung aufgebaut werden soll
Beispiel:

ccf-consulting.net:\
:conn.retry.stwait=00.00.30:\
:conn.retry.stattempts=3:\
:conn.retry.ltwait=00.10.00:\
:conn.retry.ltattempts=6:\
:tcp.max.time.to.wait=60:\
:runstep.max.time.to.wait=0:\
:contact.name=Reinhold Flecke CCF:\
:contact.phone=+49 700 93000093:\
:descrip=:\
:-Sess.total=1:\
:-Sess.pnode.max=1:\
:-Sess.snode.max=1:\
:-Sess.default=1:\
:comm.info=ccf-consulting.net;1364:\
:comm.transport=tcp:\
:comm.bufsize=4096:\
:pacing.send.delay=0:\
:pacing.send.count=0:

userfile.cfg
hier legt man die User fest gegebenenfalls auch ein chroot? für in/out directories
Beispiel:
rflecke@ccf-consulting.net:\
:local.id=cdirect:\
:pstmt.upload=y:\
:pstmt.upload_dir=/ccf/global/upload:\
:pstmt.download=y:\
:pstmt.download_dir=/ccf/global/download:\
:pstmt.run_dir=/ccf/global/jobs:\
:pstmt.submit_dir=:\
:descrip=:

NODE umbenennen (bzw. komlettes C:D von anderer Maschine übernehmen)

Folgende files/directories müssen angepasst werden.
Umbenennen oder neuanlegen des Verzeichnisses
[ConnecDirect]/cdunix/work/[nodename]
Der neue nodename muß in den folgenden files angepaßt werden:
[ConnecDirect]/cdunix/ndm/cfg/[nodename]/initparm.cfg
[ConnecDirect]/cdunix/ndm/cfg/[nodename]/netmap.cfg
[ConnecDirect]/cdunix/ndm/cfg/[nodename]/userfile.cfg
[ConnecDirect]/cdunix/ndm/cfg/cliapi/ndmapi.cfg

Spezialfall „Loadbalancer“ node01/02

Bei deser Konfiguration werden z.B node01/node02 von außen über einen Loadbalancer angesprochen (ccf-consulting.net). Beide nodes benötigen die gleichen Einträge in der netmap.cfg, userfile.cfg und die gleichen keys für Secure+.
  • einrichten auf von ))ConnectDirect(( und Secure+ auf node01
  • tar des Verzeichnisses /opt/cdirect/cdunix/ndm/secure+/nodes des node1
  • sichern des Verzeichnisses /opt/cdirect/cdunix/ndm/secure+/nodes auf dem server node02
  • entpacken des tar Archives unter /opt/cdirect/cdunix/ndm/secure+/nodes auf dem server node02
  • anschließend beide ))ConnectDirect(( instancen neu gestartet werden

Secure+ Admin Tool für ))ConnectDirect((

Knoten müssen mit der netmap.cfg synchronisiert werden:
Achtung!!! API ist sehr sehr langsam

Secure+ Programmaufruf

Die Software wird aufgerufen mit:
[[ConnecDirect]/cdunix/ndm/bin/spadmin.sh

Konfiguration

Die Knoten müssen auf allen Knoten auf denen Secure+ installiert ist, dort auch bekannt gegeben werden. Der netmap.cfg file wird ausgewählt und die neu hinzugekommenen Knoten eingebunden.
  • Datei
    • Sync with Netmap
      • ...

Anschließend werden die Knoten den Anforderungen angepasst. Markieren des Knoten und Update vornehmen.
  • Edit
    • Update Record
      • ...

Einrichtung einer sicheren Verbindung:


Secure+ Admin Dokumentation folgt
...page...

Connect:Direct UNIX Examples

From UNIX to UNIX

This process copies a file from Unix to Unix then submits a run task on snode to execute the Unix command cp:
test1 process snode=Unix
step1 copy from (file=/home/user/testunix pnode)
to (file=/home/user/deleteme)
subok run task snode
sysopts="cp /home/user/testcp /home/usernew/testcp"
pend ;

This process copies a file from Unix to Unix using symbolic variables to build the destination file name:
Test2 process snode=Unix
&d1 = /home/user
&d2 = testfile
&d3 = &d1/&d2
step1 copy from (file=/home/user/testunix pnode)
to (file=&d3 disp=rpl snode)
pend;

From UNIX to WINDOWS

This process copies a file from Unix to Windows then executes a run task to submit a .bat file on Windows:
test1 process snode=Windows
step1 copy from (file=/home/user/testunix pnode)
to (file=c:\temp\deleteme.txt disp=new)
if1 if (step1 eq 0) then
run1 run task snode (pgm=windowsNT/95)
sysopts="pgm(c:\temp\test.bat)"
eif
pend ;

This process copies a file from Unix to Windows the executes a run task to delete a Windows file:
test2 process snode=Windows
step1 copy from (file=/home/user/testunix pnode)
to (file=c:\temp\testfile.txt disp=rpl snode)
step2 if (step1 < 4) then
run task snode (pgm=windowsNT/95)
sysopts="cmd(del c:\temp\deleteme.txt)"
eif
pend;

This process copies a file from Unix to Windows and includes the current date within the destination file name:
test3 process snode=Windows
step1 copy from (file=/home/user/testunix pnode)
to (file=datei_`date +%y%m%d`.txt snode disp=rpl)
pend ;

This process copies a file from Unix to Windows then executes a run task
to submit a script on Unix:
test4 process snode=Windows
step1 copy from (file=/home/user/testunix pnode)
to (file=c:\temp\deleteme.txt disp=rpl)
if1 if (step1 eq 0) then
subok run task pnode
sysopts="/home/user/cdunix/ndm/src/okay"
else
subfailed run task pnode
sysopts="/home/user/cdunix/ndm/src/failed"
eif
pend ;

This process copies a file from Unix to Windows then executes a run task to submit a .bat file on Windows using UNC name for the network drive:
test5 process snode=Windows
step1 copy from (file=/home/user/testunix pnode)
to (file=c:\temp\deleteme.txt disp=rpl)
if1 if (step1 eq 0) then
run1 run task snode (pgm=windowsNT/95)
sysopts="pgm(\\\Wserver\temp\test.bat)"
eif
pend ;

From UNIX to OS/390

This process copies a file from Unix to OS/390:
test1 process snode=Os390
step1 copy from (file=/home/user/testunix pnode)
to (file=TEST.FILE.COPY disp=new
dcb=(dsorg=ps,lrecl=30,recfm=fb,blksize=3000))
pend ;

This process pulls a file from OS/390 to Unix then executes a run task to delete the OS/390 file:
test2 process snode=Os390
step1 copy from (file=TEST.FILE snode)
ckpt=no
to (dsn=/home/user/testunix disp=rpl
sysopts=":datatype=text:xlate=yes:"
pnode)
step2 if (step1 < 4) then
run task snode (PGM=DMRTDYN)
sysopts="C'ALLOC DSN=TEST.FILE,DISP=(OLD,DELETE)',
F'-1',
C'UNALLOC DSN=TEST.FILE' "
eif
pend;

This process copies a file from Unix to OS/390 specifying a translation table different from the default one:
test3 process snode=Os390
step1 copy from (file=/home/user/testunix pnode
sysopts=":xlate.tbl=/home/user/testtrans.xlt:")
to (file=TEST.FILE.COPY disp=new)
pend ;

This process executes a run task that invokes DMRTSUB program to submit a job on OS/390 passing a parameter:
test4 process snode=Os390
step1 run task (PGM=DMRTSUB)
sysopts="'DSN=TEST.LIB(JCL1),DISP=SHR',
'file1 TEST.FILE1'"
snode
pend ;
This process submit a process on OS390 passing two symbolic parameters:
test5 process snode=Os390
step1 submit file=TEST.LIB(TESTPROC)
&FILEIN=/home/user/testunix
&FILEOUT=TEST.FILE
subnode=snode
pend ;

From UNIX to OS/400

This process copies a file from Unix to OS/400:
test1 process snode=Os400
step1 copy from (file = /home/user/testunix pnode)
to (file = lib1/filetest disp = new
sysopts="TYPE(MBR) RCDLEN(80)")
pend;

This process executes a run task on OS/400 to call a program:
test2 process snode=Os400
step1 run task (PGM=AS400)
sysopts="CMD(CALL PGM(library/program)
PARM(parameter))"
snode
pend;

This process executes a run task on OS/400 to delete a member of a file:
test3 process snode=Os400
step1 run task snode (pgm = AS400)
sysopts="RMVM FILE(LIB/FILE) MBR(TESTUNIX)"
pend;

From UNIX to VMS

This process copies a file from Unix to Vms, then pulls a file from Vms to Unix and executes a run task to delete the VMS file:
test1 process snode=Vms
step1 copy from (file=/home/user/testunix
sysopts=":datatype=text:xlate=no:"
pnode)
ckpt=1k
to (dsn=DISK$SUP:[TECH1]TEST.DAT
disp=rpl
snode)
step2 copy from (file=DISK$SUP:[TECH1] TEST.DAT snode)
ckpt=no
to (dsn=/home/user/testunix disp=rpl
sysopts=":datatype=text:xlate=no:"
pnode)
step3 if (step2 < 4) then
run task snode (PGM=VMS)
sysopts="cmd='delete DISK$SUP:[TECH1] TEST.DAT;'"
eif
pend;

From UNIX to TANDEM

This process copies a file from Unix to Tandem, then pulls a file from Tandem to Unix and executes a run task to delete the Tandem file:
test1 process snode=Tandem
step1 copy from (file=/home/user/testtandem pnode)
to (file=$USER.TEST.TANTEST disp=rpl
sysopts="'set code 0' 'set type u' 'set block 4096'"
snode)
step2 copy from (file=$USER.TEST.TANTEST disp=shr snode)
to (file=/home/user/testfile pnode)
step3 if (step2 < 4) then
run task snode (pgm = fup)
sysopts="PURGE $USER.TEST.TANTEST!"
eif
pend;

Miscellaneous

Calling Connect:Direct from within a shell script:

CDDIR=/home/user/cdunix
NDMAPICFG=$CDDIR/ndm/cfg/cliapi/ndmapi.cfg
export NDMAPICFG
SNODE=Unix
$CDDIR/ndm/bin/direct -x << EOJ1
submit maxdelay=unlimited test1 process snode=$SNODE
step1 copy from (file=/home/user/testunix pnode)
to (file=/home/user/delete.me snode)
pend;
quit;
EOJ1
SAVE=$?
if [[ $SAVE > 0 ]]
then
echo $SAVE
echo "Error occurred."
exit 1
fi
echo "Copy completed successfully."
exit 0

Using Connect:Direct for Unix pipe/io functionality

Test2 process snode=Unix
step1 copy from (file = "tar cf - *.cd"
sysopts = ":pipe=yes:datatype=binary:")
to (file = /tmp/test.tar)
step2 copy from (file = /tmp/test.tar)
to (file = "mkdir /tmp/tar_tst ; cd /tmp/tar_tst ; tar xf -"
sysopts = ":pipe=yes:datatype=binary:")
step3 copy from (file = "tar cf - *.cd"
sysopts = ":pipe=yes:datatype=binary:")
to (file = "mkdir /tmp/tar_tst2 ; cd /tmp/tar_tst2 ; tar xf -"
sysopts = ":pipe=yes:datatype=binary:")
pend;




Das Originaldokument ist zu finden unter http://ccf-it.de/tiki-5.0/tiki-index.php?page=ConnectDirect