- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Redirecting SSH output
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2005 08:23 AM
тАО05-31-2005 08:23 AM
Re: Redirecting SSH output
I have one more thing that might interest you. I find that I am getting the exit status from the remote ssh command. If I execute the ssh command with the -v flag, I can see the exit status of the remote command. Note that the exit status of 0 is translated to 1, but other codes are sent back with the Unix value.
$ ssh -v user@host "env"
o
o
o
debug: Ssh2Common/SSHCOMMON.C:697: num_channels now 0
debug: Got session close with exit_status=0
debug: destroying client struct...
debug: uninitializing event loop
$ show sym $status
$STATUS == "%X00000001"
$ ssh -v user@host "invalid"
o
o
o
debug: Got session close with exit_status=127
debug: destroying client struct...
debug: uninitializing event loop
$ show sym $status
$STATUS == "%X0000007F"
All of this is to say that the VMS-side may not be your problem.
Regards,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2005 11:45 PM
тАО05-31-2005 11:45 PM
Re: Redirecting SSH output
I had already changed the Solaris side scripts to print the exit status so guess I stick with that. In addition to the exit status, the remote scripts writes a reason. However, this tip is useful if I do changes.
One thing about changes, why I cannot redirect but Tom can (I tested this immediately but I now saw that I forgot to write about this).
The difference is not tcsh (that the Solaris account use by default) versus bash (I assume bash, since Tom use Linux). The syntax differ of course, but even if I change to bash, redirect does not work.
Gerhard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 12:01 AM
тАО06-01-2005 12:01 AM
Re: Redirecting SSH output
FWIW, SPAWN/OUTPUT doesn't help any here either. It just creates an empty output file.
This is probably to be expected in view of what previous responses have reported as not helping (logical name definitions, PIPE, etc.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 01:29 AM
тАО06-01-2005 01:29 AM
SolutionOne other thing I have discovered about my stderr redirection is that it does not work if I execute the ssh command interactively, but does work if the command is included in a batch procedure.
In any case, since I get a non-ss$_normal return status, I don't really need to capture the output to analyze it. I just test that status and report that an exception occured that must be investigated.
Regards,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 01:57 AM
тАО06-01-2005 01:57 AM
Re: Redirecting SSH output
Actually, I thought I tested batch mode before asking the first question, but I must have missed this in the frustration.
The functionality is weird.....
Gerhard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 02:03 AM
тАО06-01-2005 02:03 AM
Re: Redirecting SSH output
You then don't redirect SYS$OUTPUT, but anything written to it should be in the BATCH job logfile.
e.g.
$> type check2.com
$ ssh stubbsj@dannii "@timestamp"
$ EXIT
$>
$> submit/queue=sys$batch check2.com /notify
$> type check2.log
$ Set NoOn
$! write sys$output "running sylogin"
$! def/user sys$input sys$command
$! set password
$ VERIFY = F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))
17-JAN-2005 11:45:34
Disconnected; connection lost (Connection closed.).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 10:02 PM
тАО06-01-2005 10:02 PM
Re: Redirecting SSH output
Since exit status 0 is changed to 1, the exit code translation is not really helping. "exit 1" is used in most scripts... Transferring error codes from one platform to another is not easy. This is probably why it is deactivated by default. I would rather have the raw output and use "SET NOON".
In my "live" scripts, redirection does not work in batch mode. I will stick with my workaround (extra submit and exit code with "tag" in output).
Thanks Tom for the workaround anyway.
/Gerhard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2005 03:36 AM
тАО08-24-2005 03:36 AM
Re: Redirecting SSH output
The "extra submitt" step can now be removed.
/Gerhard
- « Previous
-
- 1
- 2
- Next »