<?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: Execting a command on remote server in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774096#M75533</link>
    <description>Hello Paul,&lt;BR /&gt;&lt;BR /&gt;if all those other systems are NFS-clients, and *your* system is an NFS-server, then the NFS-command "on" might be right what you want.&lt;BR /&gt;Read the man pages for "on" and enable that service for *your* computer in your "/etc/inetd.conf". &lt;BR /&gt;Then start the "on" command on your computer like this:&lt;BR /&gt;on serverB "sysdef | grep nflocks &amp;gt;&amp;gt; output"&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Wodisch&lt;BR /&gt;</description>
    <pubDate>Sun, 28 Jul 2002 19:26:08 GMT</pubDate>
    <dc:creator>Wodisch_1</dc:creator>
    <dc:date>2002-07-28T19:26:08Z</dc:date>
    <item>
      <title>Execting a command on remote server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774091#M75528</link>
      <description>Does anyone know how to execute a command on a local system so it will take effect on a remote system.&lt;BR /&gt;&lt;BR /&gt;I have written a script to check some files and output the command to a file.  I could ftp the file onto 200+ servers, but wondered if it is possible to execute the command on a local system to work on the remote system.&lt;BR /&gt;&lt;BR /&gt;Similar to perhaps&lt;BR /&gt;remsh hostname -n sysdef | grep nflocks &amp;gt;&amp;gt; output_file&lt;BR /&gt;&lt;BR /&gt;where the sysdef option would be the local command, outputting to a file back on the local server, but actually running the script on the remote system.&lt;BR /&gt;&lt;BR /&gt;Any ideas ?</description>
      <pubDate>Sun, 28 Jul 2002 04:32:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774091#M75528</guid>
      <dc:creator>Paul Thomson_2</dc:creator>
      <dc:date>2002-07-28T04:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Execting a command on remote server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774092#M75529</link>
      <description>sysdef would have to be available within the filesystems available to the remote systems.&lt;BR /&gt;&lt;BR /&gt;option 1) Copy sysdef to all systems.&lt;BR /&gt;&lt;BR /&gt;option 2) Create a directory to hold common commands that all systems can run, and export it via NFS. Then each remote system would mount this filesystem and then they would have access to the common commands.&lt;BR /&gt;&lt;BR /&gt;Hope this helps...&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Sun, 28 Jul 2002 04:44:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774092#M75529</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-07-28T04:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Execting a command on remote server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774093#M75530</link>
      <description>Why not 'rcp' the script instead of all the NFS traffic?  Just make sure the original script has execute permissions and do rcp -p sysdef SYSTEM:/..../sysdef&lt;BR /&gt;George</description>
      <pubDate>Sun, 28 Jul 2002 09:32:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774093#M75530</guid>
      <dc:creator>George Petrides_1</dc:creator>
      <dc:date>2002-07-28T09:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Execting a command on remote server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774094#M75531</link>
      <description>When doing a remsh command, it's important to know what the local shell will do versus the remote shell. For instance: &lt;BR /&gt;&lt;BR /&gt;remsh $HOST pwd &amp;gt; /var/tmp/$HOST.pwd &lt;BR /&gt;&lt;BR /&gt;and &lt;BR /&gt;&lt;BR /&gt;remsh $HOST pwd \&amp;gt; /var/tmp/$HOST.pwd &lt;BR /&gt;or &lt;BR /&gt;remsh $HOST "pwd &amp;gt; /var/tmp/$HOST.pwd" &lt;BR /&gt;&lt;BR /&gt;The first will write the pwd results into /var/tmp/$HOST.pwd on the local machine while the 2nd and 3rd examples will write the results on the remote machine. Note that "..." and '...' will behave differently. Double quotes "..." will expand env variables like $HOST before sending the resultant string to the remote computer. However, '...' will send the string exactly as typed, and the env varible $HOST would have to be defined at the remote system, which is unlikely. &lt;BR /&gt;&lt;BR /&gt;I would not assume anything about the remote environment, such as $PATH. You can probably assume that pwd for remsh will be the user's home directory, but that's about all. Use bull pathnames to make sure the specific command will be found: &lt;BR /&gt;&lt;BR /&gt;remsh $HOST /usr/bin/pwd &amp;gt; /var/tmp/$HOST.pwd &lt;BR /&gt;&lt;BR /&gt;I've attached a script called remshall.sh which accomplishes something like what you're looking for. I use it to look at dozens of machines and get a status, for instance, get the current time/date for all the machines to make sure NTP is setup, or check the size of syslog, etc.</description>
      <pubDate>Sun, 28 Jul 2002 17:18:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774094#M75531</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2002-07-28T17:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Execting a command on remote server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774095#M75532</link>
      <description>Thanks for replies.&lt;BR /&gt;&lt;BR /&gt;I do use remsh to perform tasks on a remote server similar to how you have described.&lt;BR /&gt;&lt;BR /&gt;What I really want to do is somehow perform the following&lt;BR /&gt;&lt;BR /&gt;On a local server (serverA) a file called localfile&lt;BR /&gt;&lt;BR /&gt;I would like to execute this on a remote server (serverB)&lt;BR /&gt;&lt;BR /&gt;I perhaps confused the issue by mentioning remsh.&lt;BR /&gt;&lt;BR /&gt;So I would like to execute a file, say called localfile, located on serverA to take effect on serverB and output the information back to a file on serverA&lt;BR /&gt;&lt;BR /&gt;I know with remsh you can specify the output to be on the local server or the remote server.&lt;BR /&gt;But the command you execute needs to be on the remote server.  Is there anyway to access a remote server, then execute a command that is located on the local server.&lt;BR /&gt;&lt;BR /&gt;Am I making sense !?!?&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Paul&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 28 Jul 2002 18:03:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774095#M75532</guid>
      <dc:creator>Paul Thomson_2</dc:creator>
      <dc:date>2002-07-28T18:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Execting a command on remote server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774096#M75533</link>
      <description>Hello Paul,&lt;BR /&gt;&lt;BR /&gt;if all those other systems are NFS-clients, and *your* system is an NFS-server, then the NFS-command "on" might be right what you want.&lt;BR /&gt;Read the man pages for "on" and enable that service for *your* computer in your "/etc/inetd.conf". &lt;BR /&gt;Then start the "on" command on your computer like this:&lt;BR /&gt;on serverB "sysdef | grep nflocks &amp;gt;&amp;gt; output"&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Wodisch&lt;BR /&gt;</description>
      <pubDate>Sun, 28 Jul 2002 19:26:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774096#M75533</guid>
      <dc:creator>Wodisch_1</dc:creator>
      <dc:date>2002-07-28T19:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Execting a command on remote server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774097#M75534</link>
      <description>This sounds like a system inventory script that I wrote to collect data from over 300 HP-UX machines. The way I set it up was to place a cron job on every machine. This job would use ftp commands within the script to pull down the latest copy of the inventory script. Then the script runs the local copy of the inventory script, save a copy of the results on the machine and ftp a copy back to the inventory collector machine.&lt;BR /&gt;&lt;BR /&gt;In that way, I could update the inventory script (daily if needed) and all the machines would run the latest version that evening and all the new results returned to the collector the next day.&lt;BR /&gt;&lt;BR /&gt;NOTE: from personal experience with this script: always use set -u in your scripts. A simple spelling error that would have been caught with set -u removed the /usr/local/bin directories on 300+ machines. Test your scripts carefully before dropping them into the central directory.</description>
      <pubDate>Mon, 29 Jul 2002 00:09:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774097#M75534</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2002-07-29T00:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Execting a command on remote server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774098#M75535</link>
      <description>Your serverA's "localfile" that you want to execute on serverB, as initiated from ServerA (do I understand it correctly?) - is it some form of script generated from something else (i.e. it may change from run to run)?&lt;BR /&gt;&lt;BR /&gt;If so, I would have a generic script on serverB which does a rcp of "localfile" and then executes it.  The generic script could be called from a remsh from serverA...&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;Carlo</description>
      <pubDate>Mon, 29 Jul 2002 12:10:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/execting-a-command-on-remote-server/m-p/2774098#M75535</guid>
      <dc:creator>Carlo Henrico_1</dc:creator>
      <dc:date>2002-07-29T12:10:22Z</dc:date>
    </item>
  </channel>
</rss>

