$COZ_BIN/wto

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
fagu
Posts: 14
Joined: Wed Dec 02, 2009 8:51 am

$COZ_BIN/wto

Post by fagu »

$COZ_BIN/wto -r 11 -d 6 "COZSFTP000E any message not written€"

...where is this written JES2-SYSLOG or some SYSLOGD file? do not see any error or racf message?
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: $COZ_BIN/wto

Post by dovetail »

The wto command uses the IBM _console2() api, which is an interface to the WTO service.

http://publib.boulder.ibm.com/infocente ... onsol2.htm

The routing of WTO's is determined by the routecode (-r on our wto command):
http://publibfp.boulder.ibm.com/cgi-bin ... 2556&CASE=

Descriptor codes are documented here:
http://publibfp.boulder.ibm.com/cgi-bin ... 56#HDRDESC

So as coded, -r 11 would go to the job's JESYSMSG dataset, which is often referred to as the "JOBLOG"
fagu
Posts: 14
Joined: Wed Dec 02, 2009 8:51 am

Re: $COZ_BIN/wto

Post by fagu »

...doesn't matter what rout is used, from coz-script I get nothing anywhere?
...the program works, obviously, but only from ssh-client session, not when COZSFTP is executed?

using wto -r 2 -d 6 "..." not -r 11

PuTTY-client:
=============
login as: userid
+----------------------------------------------------------+
| Dovetailed Technologies |
+----------------------------------------------------------+
userid@.....73's password:
USERID:/u/userid: >COZWTOMSG=`echo COZSFTP001I USERID=$(whoami) /etc/ssh/sftp-server.rc executed.`
USERID:/u/userid: >echo $COZWTOMSG
COZSFTP001I USERID=OMVSSTC /etc/ssh/sftp-server.rc executed.
USERID:/u/userid: >wto -r 2 -d 6 "$COZWTOMSG"
USERID:/u/userid: >
USERID:/u/userid: >cozsftp userid@zin11
Co:Z SFTP version: 2.4.0 (5.0p1) 2013-06-10
Copyright (C) Dovetailed Technologies, LLC. 2008-2013. All rights reserved.
Connecting to zin11...
+----------------------------------------------------------+
| Dovetailed Technologies |
+----------------------------------------------------------+
userid@zin11's password:
cozsftp> ls /+
/+/error.log /+/gdgnt /+/loglevel=T /+/mode=binary
cozsftp>
cozsftp>

==> nothing written to SYSLOG when COZSFTP session started?

BROWSE /SYSTEM/etc/ssh/1/sftp-server.sh Line 00000121 Col 001 101
Command ===> Scroll ===> CSR
Ä Fagu added.... Co:Z writes info to JES2 SYSLOG, when service is OK, please comment out WTO
COZWTOMSG=éecho COZSFTP001I USERID=Å(whoami) /etc/ssh/1/sftp-server.sh executed€é
ÅCOZ_BIN/wto -r 2 -d 6 ">>>> fagu <<<<"
ÅCOZ_BIN/wto -r 2 -d 6 "ÅCOZWTOMSG"
ÅCOZ_BIN/wto -r 2 -d 6 ">>>> fagu <<<<"


...this is output from SSH-client session
SDSF OPERLOG DATE 06/28/2013 1 WTOR COLUMNS 02- 125
COMMAND INPUT ===> SCROLL ===> CSR
N 4000000 ZIN1 13179 12:28:52.11 STC06866 00000090 COZSFTP001I USERID=OMVSSTC /etc/ssh/sftp-server.rc executed.



USERID:/u/userid: >/usr/local/bin/wto -r 2 -d 6 "$COZWTOMSG"
USERID:/u/userid: >/usr/local/coz/bin/wto -r 2 -d 6 "$COZWTOMSG"
USERID:/u/userid: >wto -r 2 -d 6 "$COZWTOMSG"
USERID:/u/userid: >
USERID:/u/userid: >

...demo that all 3 ways work
SDSF OPERLOG DATE 06/28/2013 1 WTOR COLUMNS 02- 125
COMMAND INPUT ===> SCROLL ===> CSR
N 4000000 ZIN1 13179 12:41:00.50 STC06865 00000090 COZSFTP001I USERID=OMVSSTC /etc/ssh/sftp-server.rc executed.
N 4000000 ZIN1 13179 12:41:07.56 STC06865 00000090 COZSFTP001I USERID=OMVSSTC /etc/ssh/sftp-server.rc executed.
N 4000000 ZIN1 13179 12:41:16.23 STC06865 00000090 COZSFTP001I USERID=OMVSSTC /etc/ssh/sftp-server.rc executed.
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: $COZ_BIN/wto

Post by dovetail »

I'm not sure what the problem is.
Are you sure that your edits to sftp-server.sh are using the correct character codepoints?
To check, turn HEX ON in ISPF and compare your $ and ` symbols to those that we ship that work.

Also, we don't recommend that you modify sftp-server.sh
If you want to add something, put it in /etc/ssh/sftp-server.rc or $HOME/.ssh/sftp-server.rc scripts.
These are dotted in by sftp-server.sh.

BTW: I notice that we are using -r 11 in the sftp-server.sh script that we ship.
We recently added _BPXK_JOBLOG=STDERR, which will cause -r 11 to not work properly.
So, in the future we will change to use -r 2
fagu
Posts: 14
Joined: Wed Dec 02, 2009 8:51 am

Re: $COZ_BIN/wto

Post by fagu »

yes, and if we use export _BPXK_JOBLOG=2 instead of STDERR/sdterr no RACF-message is issued

I know my sftp-server.sh/rc are used, can write echo and that works if unix file permissions are ok, I'm really confused. doesn't matter if userid has uid(0) or uid(1234...), no WTO message, and no RACF message either. echo to "terminal"

I got the feeling, that the script should issue WTO if something goes wrong, and support has something to look after. Now we unfortunately miss that hint.

BROWSE sftp-server.tcpip.1.userid1.179.151626.2602. Line 00000028 Col 001 122
Command ===> Scroll ===> CSR
Ý86.606¨ coz-zoptsÖdovetail.com ",%servercp"
Ý86.606¨ debug3: Type: SSH2_FXP_EXTENDED
Ý86.606¨ debug3: request 2: SSH_FXP_EXTENDED: 'coz-zoptsÖdovetail.com'
Ý86.606¨ debug3: request 2: coz-zoptsÖdovetail.com
Ý86.606¨ coz-zoptsÖdovetail.com "clientcp=IBM-1047"
Ý86.607¨ debug3: Type: SSH2_FXP_REALPATH
Ý86.607¨ debug3: request 3: realpath
Ý86.607¨ realpath "."
Ý86.607¨ debug3: initial zos directory requested: //
CatalogSearchÝD¨: filterKey="USERID1"
CatalogSearchÝT¨: -> search()
CatalogSearchÝT¨: search: total_length=65536, min_required=0, used=64, num_fields_plus_one=6, resume=
CatalogSearchÝT¨: <- search()
ZosUtilÝT¨: Skipping getDatasetInfo for USERID1, setting pPerm to S_IFDIR
Ý86.624¨ debug1: request 3: sent names count 1
Ý08.697¨ debug1: read eof
Ý08.697¨ session closed for local user USERID1 from Ý192.49.208.73¨
Fri Jun 28 15:16:48 DST 2013 COZSFTP001I cozsftp OMVSSTC /etc/ssh/sftp-server.rc executed
Fri Jun 28 15:16:48 DST 2013 COZSFTP100I cozsftp OMVSSTC SFTP_SERVER_OPTIONS=-e -l debug3 -f AUTH
Fri Jun 28 15:16:48 DST 2013 OMVSSTC COZ_LOG=T
Fri Jun 28 15:16:48 DST 2013 OMVSSTC SFTP_ZOS_OPTIONS=mode=binary
Fri Jun 28 15:16:48 DST 2013 OMVSSTC SFTP_ZOS_INITIAL_DIR=//
Fri Jun 28 15:16:48 DST 2013 OMVSSTC USE_COZ_SFTP=true
Fri Jun 28 15:16:48 DST 2013 OMVSSTC COZ_BIN=/usr/local/coz/bin
Fri Jun 28 15:16:48 DST 2013 OMVSSTC COZ_SFTP_USER_SERVER_RC=/u/userid1/.ssh/sftp-server.rc
Fri Jun 28 15:16:48 DST 2013 OMVSSTC COZ_SFTP_USER_SERVER_CONFIG=/u/userid1/.ssh/cozsftp_server_config
Fri Jun 28 15:16:48 DST 2013 COZSFTP002I cozsftp OMVSSTC /etc/ssh/1/sftp-server.sh executed
Fri Jun 28 15:16:48 DST 2013 COZSFTP200I cozsftp OMVSSTC SFTP_LOGFILE=/tmp/sftp-server.tcpip.1.userid1.179.151626.2602.log


...the Å is $, just FINSWE TN3270 client stuff

BROWSE /SYSTEM/etc/ssh/1/sftp-server.sh
Command ===>
Ä If we are not supposed to use the Co:Z version of the sftp-server,
74C84A84898499A4AA999A884A94AA84A884C97E4A89A8994984A884A8A96A89A896
B0960650195056302477625403604250385036A9055929650660385026370259559B
---------------------------------------------------------------------------------------
Ä or we can't find it as an executable file, then fall back and exec the IBM version
74994A848897A4889848A48A48948A88AA88984889864A8894889948889489848A884A884CCD4A89A899
B0690650315D3069540930120150575343123506935B0385506133021320154057530385092405592965
---------------------------------------------------------------------------------------
if ÝÝ € ( ÅUSE_COZ_SFTP == "true" && -x "ÅSFTP_SERVER" ) ¨¨; then
884AA454445EEC6CDE6ECED47747A9A8745546A475ECED6ECDECD7454BB54A889
960DD0A0D0B425D369D26370EE0F3945F0000070FB2637D259559F0D0DDE03855
---------------------------------------------------------------------------------------
ÅCOZ_BIN/wto -r 2 -d 6 "COZSFTP002W Co:Z not used, IBM SFTP because install options€"
445CDE6CCD6AA94694F4684F47CDEECEDFFFE4C97E499A4AA8864CCD4ECED48888AA8489AA899499A899A57
00B369D295163600902004060F36926370026036A9056304254B092402637025314250952313306739652AF


...how can I send a message somewhere when WTO do not work at all, and terminal neither,
writing to file works always if file permissions are ok

=========================================================================================

...if echo to terminal is in ...rc file, then COZSFTP will fail

BROWSE /SYSTEM/etc/ssh/sftp-server.rc L
Command ===>
echo "édateé COZSFTP100I cozsftp Å(whoami) SFTP_SERVER_OPTIONS=ÅSFTP_SERVER_OPTIONS"

*********************************************** Bottom of Data **********************

USERID1:/u/userid1: >cozsftp userid1@zin11
Co:Z SFTP version: 2.4.0 (5.0p1) 2013-06-10
Copyright (C) Dovetailed Technologies, LLC. 2008-2013. All rights reserved.
Connecting to zin11...
userid1@zin11's password:
[94.537] Received message too long 3566638400
USERID1:/u/userid1: >

=========================================================================================

...if echo to terminal is in ...sh client script has started sftp, then COZSFTP will fail
...same result after exit from sftp program and returned to ...sh script

BROWSE /SYSTEM/etc/ssh/1/sftp-server.sh
Command ===>
echo "édateé COZSFTP100I cozsftp Å(whoami) SFTP_SERVER_OPTIONS=ÅSFTP_SERVER_OPTIONS"

Ä Establish the default C locale and invoke sftp-server
export LC_ALL="C"
"ÅSFTP_SERVER" ÅSFTP_SERVER_OPTIONS 2>"ÅSFTP_LOGFILE"
RC=Å?

USERID1:/u/userid1: >cozsftp userid1@zin11
Co:Z SFTP version: 2.4.0 (5.0p1) 2013-06-10
Copyright (C) Dovetailed Technologies, LLC. 2008-2013. All rights reserved.
Connecting to zin11...
userid1@zin11's password:
[67.455] Received message too long 3566638400
USERID1:/u/userid1: >

=========================================================================================
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: $COZ_BIN/wto

Post by dovetail »

USERID1:/u/userid1: >cozsftp userid1@zin11
Co:Z SFTP version: 2.4.0 (5.0p1) 2013-06-10
Copyright (C) Dovetailed Technologies, LLC. 2008-2013. All rights reserved.
Connecting to zin11...
userid1@zin11's password:
[67.455] Received message too long 3566638400
USERID1:/u/userid1: >
The error above is happening because your sftp-server.sh or sftp-server.rc script is writing something to stdout.
Probably an echo line.

I can't explain why the Co:Z wto command isn't working at your installation.
You might want to try using the IBM z/OS "logger" command instead.

I also cannot explain why export _BPXK_JOBLOG=STDERR causes problems for you.
According to the IBM documentation, this is equivalent to _BPXK_JOBLOG=2
Post Reply