<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SSH - capturing output within a PIPE stream in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267856#M40981</link>
    <description>Jack,&lt;BR /&gt;&lt;BR /&gt;  I seem to recall SSH needs to have it's input and/or output explicitly redirected in order to work in a pipe.&lt;BR /&gt;&lt;BR /&gt;Something like:&lt;BR /&gt;&lt;BR /&gt;$ PIPE (DEFINE/USER TT NL: ; -&lt;BR /&gt;        SSH ALPHAX SHOW TIME) | -&lt;BR /&gt;       SEARCH SYS$PIPE dec &lt;BR /&gt;&lt;BR /&gt;I know I got this working once, but I can't find my code right now. I'll keep looking.&lt;BR /&gt;&lt;BR /&gt;It may also have been something like:&lt;BR /&gt;&lt;BR /&gt;$ PIPE CONTINUE | (some DEFINE commands ; SSH some options? ) | etc...&lt;BR /&gt;&lt;BR /&gt;Experiment using TYPE SYS$PIPE as the final stage.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 29 Dec 2010 21:05:41 GMT</pubDate>
    <dc:creator>John Gillings</dc:creator>
    <dc:date>2010-12-29T21:05:41Z</dc:date>
    <item>
      <title>SSH - capturing output within a PIPE stream</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267853#M40978</link>
      <description>I would like to substitute SSH for all of the RSH cmds I have in various DCL scripts. I usually use PIPE to capture the output from the RSH cmd, but SSH doesn't seem to know about the SYS$PIPE device. Here's a simple example (w/SSH public-keys already set up):&lt;BR /&gt;&lt;BR /&gt;This works ok:&lt;BR /&gt;&lt;BR /&gt;$ pipe rsh alphax show time | search sys$pipe dec&lt;BR /&gt;21-DEC-2010 10:43:29&lt;BR /&gt;&lt;BR /&gt;This does not work as expected:&lt;BR /&gt;&lt;BR /&gt;$ pipe ssh alphax show time | search sys$pipe dec&lt;BR /&gt;21-DEC-2010 10:43:34&lt;BR /&gt;%SEARCH-I-NOMATCHES, no strings matched</description>
      <pubDate>Wed, 29 Dec 2010 18:07:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267853#M40978</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2010-12-29T18:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: SSH - capturing output within a PIPE stream</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267854#M40979</link>
      <description>Hi, &lt;BR /&gt;If you do this in a batch job, it works.&lt;BR /&gt;Problem seems to be that the ssh client when used in interactive mode stubbornly writes to the terminal screen (tt:?), whatever sys$output is. &lt;BR /&gt;&lt;BR /&gt;The sftp client refuses to accept passwords when run in a batch process (you would expect it would accept it from sys$input) but there security reasons might be a reason to have it behave that way.&lt;BR /&gt;&lt;BR /&gt;The OpenVMS ssh client is not the nec plus ultra of usability.</description>
      <pubDate>Wed, 29 Dec 2010 19:49:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267854#M40979</guid>
      <dc:creator>SDIH1</dc:creator>
      <dc:date>2010-12-29T19:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: SSH - capturing output within a PIPE stream</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267855#M40980</link>
      <description>The OpenVMS ssh port just isn't good at this sort of thing.&lt;BR /&gt;&lt;BR /&gt;Google finds existing discussions of this "fun", including&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=878635" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=878635&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Ok, on to solving this...&lt;BR /&gt;&lt;BR /&gt;Have you considered a virtual private network here?    That's one of the easiest approaches, and can potentially avoid rewriting a whole lot of code.&lt;BR /&gt;&lt;BR /&gt;Or maybe a package that deals with process scheduling or whatever the particular goal(s) here might be?  Basically to trump the requirements for remote command submission.&lt;BR /&gt;&lt;BR /&gt;If this is specifically for time and timekeeping as could be inferred from the example, then ntp would be an obvious solution.  Either using public servers or (if there's a security requirement) potentially a GPS or an atomic clock for more constrained environments.&lt;BR /&gt;&lt;BR /&gt;This remote-access approach can also be implemented via ssh and its port-forwarding mechanisms, via stunnel, or via another means of creating and maintaining a secure network link.  With stunnel or a site-to-site VPN, for instance, you could continue to use the existing rsh tools, and with minimal or no modifications.&lt;BR /&gt;&lt;BR /&gt;Here's how to port-forward standard X via ssh:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://labs.hoffmanlabs.com/node/134" target="_blank"&gt;http://labs.hoffmanlabs.com/node/134&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;And there's the massive brute-force approach of pseudo terminals.  The PTD$ callable interface.  See the I/O User's Reference Manual for details.  With this API, you can usually script just about anything...&lt;BR /&gt;&lt;BR /&gt;Consider whether the preservation of what look to be some rather questionable application designs through the implementation of additional hacks is a strategy that you really want to pursue, too.  (Not to dissuade you here, but just to cause you to think about alternatives and options from your chosen path.)   rexec and rsh have been deprecated for eons, and parsing command output is generally unsupported and can also be somewhat unstable from release to release.&lt;BR /&gt;&lt;BR /&gt;There are tools around that allow passing commands or other information around to a group of hosts, whether for distributed management or as part of SNMP or HTTP or, well, all sorts of tools and approaches.&lt;BR /&gt;&lt;BR /&gt;And this before we get to discussions such as gSOAP or other tools for distributed processing.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.johndapps.com/download" target="_blank"&gt;http://www.johndapps.com/download&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;And no, ssh isn't all that good at I/O redirection (nor, for that matter, is VMS itself particularly good at I/O redirection), as you've discovered.&lt;BR /&gt;&lt;BR /&gt;Reposting due to ITRC being ITRC.</description>
      <pubDate>Wed, 29 Dec 2010 20:10:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267855#M40980</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2010-12-29T20:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: SSH - capturing output within a PIPE stream</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267856#M40981</link>
      <description>Jack,&lt;BR /&gt;&lt;BR /&gt;  I seem to recall SSH needs to have it's input and/or output explicitly redirected in order to work in a pipe.&lt;BR /&gt;&lt;BR /&gt;Something like:&lt;BR /&gt;&lt;BR /&gt;$ PIPE (DEFINE/USER TT NL: ; -&lt;BR /&gt;        SSH ALPHAX SHOW TIME) | -&lt;BR /&gt;       SEARCH SYS$PIPE dec &lt;BR /&gt;&lt;BR /&gt;I know I got this working once, but I can't find my code right now. I'll keep looking.&lt;BR /&gt;&lt;BR /&gt;It may also have been something like:&lt;BR /&gt;&lt;BR /&gt;$ PIPE CONTINUE | (some DEFINE commands ; SSH some options? ) | etc...&lt;BR /&gt;&lt;BR /&gt;Experiment using TYPE SYS$PIPE as the final stage.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Dec 2010 21:05:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267856#M40981</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-12-29T21:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: SSH - capturing output within a PIPE stream</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267857#M40982</link>
      <description>Jack,&lt;BR /&gt;&lt;BR /&gt;  I found the magic incantation. You need to redefine SYS$COMMAND and provide an option to turn on batch mode. Try this:&lt;BR /&gt;&lt;BR /&gt;$ pipe (define/nolog sys$command nl: ; -&lt;BR /&gt;ssh -o "batchmode yes" alphax show time) | search sys$pipe dec&lt;BR /&gt;&lt;BR /&gt;This seems to work from an interactive prompt, and from a command procedure executed both interactively and in batch.</description>
      <pubDate>Wed, 29 Dec 2010 22:26:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267857#M40982</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-12-29T22:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: SSH - capturing output within a PIPE stream</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267858#M40983</link>
      <description>Thanks John, that seems to solve my problem!&lt;BR /&gt;&lt;BR /&gt;Hoff, as mentioned by someone else, I've got scripts that collect info from all of the VMS nodes to generate reports. Looping through all the nodes and PIPEing the output of a single line RSH cmd has made extracting data fairly simple.  Now I want to convert to SSH.</description>
      <pubDate>Thu, 30 Dec 2010 16:42:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ssh-capturing-output-within-a-pipe-stream/m-p/5267858#M40983</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2010-12-30T16:42:08Z</dc:date>
    </item>
  </channel>
</rss>

