<?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: script help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506794#M843735</link>
    <description>Chris,&lt;BR /&gt;alternative to Chris's ssh is using remsh (which will need files seting up on each server) or expect (downloadable, but you can then mimic telnet sessions).&lt;BR /&gt;Regards</description>
    <pubDate>Thu, 17 Mar 2005 08:50:37 GMT</pubDate>
    <dc:creator>Peter Godron</dc:creator>
    <dc:date>2005-03-17T08:50:37Z</dc:date>
    <item>
      <title>script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506791#M843732</link>
      <description>I am not very good at scripting and am looking for suggestions to accomplish something. &lt;BR /&gt;&lt;BR /&gt;I would like to create a script that i can run from one HPUX server that will run "dmesg", output this and then telnet to another server and run "dmesg" etc... then put it to a file that i can print or look at.. by doing this, i will be able to run once and review nightly. &lt;BR /&gt;&lt;BR /&gt;my question is, how do i, in a script log into another server, run the command, then log into another etc.... is this possible?</description>
      <pubDate>Thu, 17 Mar 2005 08:42:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506791#M843732</guid>
      <dc:creator>Chris Fadrowski</dc:creator>
      <dc:date>2005-03-17T08:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506792#M843733</link>
      <description>First off, you need to set up a method to communicate.  I recommend you install and configure ssh.&lt;BR /&gt;Now, after this , you can run a command like ...&lt;BR /&gt;&lt;BR /&gt;for i in servera serverb serverc serverd &lt;BR /&gt;do &lt;BR /&gt;   echo -------------------&lt;BR /&gt;   echo Server $i&lt;BR /&gt;   echo -------------------&lt;BR /&gt;   ssh $i "/usr/sbin/dmesg"&lt;BR /&gt;   echo --------------------&lt;BR /&gt;done &amp;gt;&amp;gt; dmesg_log_file&lt;BR /&gt;&lt;BR /&gt;This will contact each server run dmesg on each and put the results in "dmesg_log_file".&lt;BR /&gt;Quite simple really - once you've got ssh working and configured.</description>
      <pubDate>Thu, 17 Mar 2005 08:48:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506792#M843733</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2005-03-17T08:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506793#M843734</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;see man remsh&lt;BR /&gt;&lt;BR /&gt;Run a remote shell and command&lt;BR /&gt;&lt;BR /&gt;see also&lt;BR /&gt;&lt;A href="http://www.shelldorado.com" target="_blank"&gt;www.shelldorado.com&lt;/A&gt; for learning&lt;BR /&gt;&lt;BR /&gt;ex&lt;BR /&gt;hostname;remsh topaz -n pwd&lt;BR /&gt;&lt;BR /&gt;xserv3&lt;BR /&gt;/usershome/steves&lt;BR /&gt;&lt;BR /&gt;Local hostname then login dir on other machine topaz&lt;BR /&gt;&lt;BR /&gt;           Steve Steel</description>
      <pubDate>Thu, 17 Mar 2005 08:48:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506793#M843734</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2005-03-17T08:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506794#M843735</link>
      <description>Chris,&lt;BR /&gt;alternative to Chris's ssh is using remsh (which will need files seting up on each server) or expect (downloadable, but you can then mimic telnet sessions).&lt;BR /&gt;Regards</description>
      <pubDate>Thu, 17 Mar 2005 08:50:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506794#M843735</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-03-17T08:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506795#M843736</link>
      <description>where you have echo ----------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;what do you mean? echo what in this space..?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sorry, i am really bad at scripting. it's quite new to me.</description>
      <pubDate>Thu, 17 Mar 2005 11:24:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506795#M843736</guid>
      <dc:creator>Chris Fadrowski</dc:creator>
      <dc:date>2005-03-17T11:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506796#M843737</link>
      <description>The 'echo ----------' is telling the output to put the '-------------'.&lt;BR /&gt;&lt;BR /&gt;echo just that, 'print what I am putting here.'&lt;BR /&gt;This print can be on screen or to a file or to error.&lt;BR /&gt;&lt;BR /&gt;I would suggest you go with ssh instead of remsh. Once you have it setup on systems you can avoid ever using the remsh/telnet/ftp commands again - these are all substituted in ssh.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Mar 2005 12:50:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506796#M843737</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-03-17T12:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506797#M843738</link>
      <description>Another option would simply be to run dmesg via cron and have each system email you the output.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Mar 2005 13:00:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506797#M843738</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2005-03-17T13:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506798#M843739</link>
      <description>The real question is: &lt;BR /&gt;What data do you want to gather?  &lt;BR /&gt;&lt;BR /&gt;dmesg is overwritten with time...so eventually - the data that you are looking for will be gone - until you reboot...&lt;BR /&gt;&lt;BR /&gt;Better to get dat via an utility - like /opt/ignite/bin/print_manifest&lt;BR /&gt;&lt;BR /&gt;or cfg2html or sysinfo301&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Thu, 17 Mar 2005 13:10:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506798#M843739</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-03-17T13:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506799#M843740</link>
      <description>"dmesg" uses a circular buffer of fixed size. So when&lt;BR /&gt;the buffer is full, it overwrites the earliest log. So a&lt;BR /&gt;better solution would be start a cron job that will run&lt;BR /&gt;once in every (say) 60 minutes and append it in a &lt;BR /&gt;file. The cron job should email this file once every&lt;BR /&gt;day.&lt;BR /&gt;&lt;BR /&gt;Make sure that the cron job runs &lt;BR /&gt; # dmesg - &lt;BR /&gt;&lt;BR /&gt;(dmesg with a dash as an argument). This will print&lt;BR /&gt;out only incremental dmesg logs.&lt;BR /&gt;&lt;BR /&gt;- Biswajit&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Mar 2005 13:49:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506799#M843740</guid>
      <dc:creator>Biswajit Tripathy</dc:creator>
      <dc:date>2005-03-17T13:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506800#M843741</link>
      <description>Create a common nfs mountpoint to one central log location (That will centralize your logging)&lt;BR /&gt;&lt;BR /&gt;Then use the syslogd utility, which is already running to log the messages that you want to that common log area.&lt;BR /&gt;&lt;BR /&gt;All you will need to do is add a line to your /etc/syslog.conf file to log these messages to the log file&lt;BR /&gt;&lt;BR /&gt;Sample line from syslog.conf&lt;BR /&gt;&lt;BR /&gt;*.crit  /nfsmountpoint/logs/syslog.glogal.crit&lt;BR /&gt;*.info;*.alert /nfsmountpoint/logs/syslog.general&lt;BR /&gt;&lt;BR /&gt;restart syslogd by&lt;BR /&gt;&lt;BR /&gt;/sbin/init.d/syslogd stop&lt;BR /&gt;/sbin/init.d/syslogd start&lt;BR /&gt;&lt;BR /&gt;good luck&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Mar 2005 15:28:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506800#M843741</guid>
      <dc:creator>Jim Butler</dc:creator>
      <dc:date>2005-03-17T15:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506801#M843742</link>
      <description>ssh is all set up.. still having problems getting my script to work. &lt;BR /&gt;&lt;BR /&gt;it stops when asking for a password. I could put this in the file (i think) but can i just give root the ability to log in without asking for a password to run dmesg?</description>
      <pubDate>Thu, 17 Mar 2005 16:15:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506801#M843742</guid>
      <dc:creator>Chris Fadrowski</dc:creator>
      <dc:date>2005-03-17T16:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506802#M843743</link>
      <description>Chris, cool - you got ssh - that's great in and of itself.&lt;BR /&gt;&lt;BR /&gt;Now go to the user's home directory on each machine and make a key...&lt;BR /&gt;ssh-keygen -t rsa &lt;BR /&gt;or &lt;BR /&gt;ssh-keygen -t dsa &lt;BR /&gt;&lt;BR /&gt;Be agreeable and answer all the prompts with defaults - and when asked - don't put in a password.&lt;BR /&gt;&lt;BR /&gt;cd .ssh&lt;BR /&gt;&lt;BR /&gt;now, You'll see a file there id_rsa.pub or id_dsa.pub.&lt;BR /&gt;&lt;BR /&gt;cat id_rsa.pub &amp;gt;&amp;gt; authorized_keys&lt;BR /&gt;or&lt;BR /&gt;cat id_dsa.pub &amp;gt;&amp;gt; authorized_keys&lt;BR /&gt;&lt;BR /&gt;Do the same on both servers&lt;BR /&gt;&lt;BR /&gt;Now on machine a, copy the id_rsa (or dsa) file from machine b into a file called machineb (it just a temporary file name - call it what u want).&lt;BR /&gt;then, cat machineb &amp;gt;&amp;gt; authorized_keys&lt;BR /&gt;&lt;BR /&gt;chmod -R og-rwx ~/.ssh&lt;BR /&gt;(secure up all those new files)&lt;BR /&gt;&lt;BR /&gt;do the same on machine b, appending the public key file (id_rsa.pub or id_dsa.pub) to the authorized_keys file.&lt;BR /&gt;&lt;BR /&gt;Now, just ssh from one machine to the other. &lt;BR /&gt;ssh machineb &lt;BR /&gt;It will ask you to add a key re: your host name, be agreeable and let it.&lt;BR /&gt;&lt;BR /&gt;Do the same from the other machine.&lt;BR /&gt;&lt;BR /&gt;Now, you're done - you can ssh back and forth.&lt;BR /&gt;&lt;BR /&gt;Make sure to read your man pages on ssh and review security settings, etc. for the ssh services... once you're done.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Mar 2005 16:43:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506802#M843743</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2005-03-17T16:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506803#M843744</link>
      <description>Chris,&lt;BR /&gt;&lt;BR /&gt;when you create the keys let the passphrase empty, otherwise at login you'll be asked again the passphrase - you cannot run ssh from the script with non-empty passphrases. Otherwise you can add the passphrases to the ssh-agent but it will not work as cronjob (I've tried my own)&lt;BR /&gt;&lt;BR /&gt;have a lot of fun...</description>
      <pubDate>Fri, 18 Mar 2005 03:49:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506803#M843744</guid>
      <dc:creator>Ionut Grigorescu_2</dc:creator>
      <dc:date>2005-03-18T03:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506804#M843745</link>
      <description>Chris, you got a lot of help from a lot of people here - please assign points to the replies.</description>
      <pubDate>Fri, 18 Mar 2005 08:32:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506804#M843745</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2005-03-18T08:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506805#M843746</link>
      <description>I certainly will and always do, i am just trying to see what solution works the best.</description>
      <pubDate>Fri, 18 Mar 2005 08:34:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506805#M843746</guid>
      <dc:creator>Chris Fadrowski</dc:creator>
      <dc:date>2005-03-18T08:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506806#M843747</link>
      <description>OK, sorry - didn't think it was gonna happen - apologies.</description>
      <pubDate>Fri, 18 Mar 2005 08:57:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506806#M843747</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2005-03-18T08:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506807#M843748</link>
      <description>One thing that you can also do is just set up a little script on each server as a cronjob to run at 'X' time. (Cron is a nice way to make sure that no matter, jobs get run regardless of whatever emergency is occupyign your time.) You could also have a second script to run through each one and check for keywords and print a report that you can then check, or send you an email or whatever. Once you have the report sent to your email, then you can probably check it much easier then going to the server and checking, plus you can keep multiple copies for however long without too many issues.</description>
      <pubDate>Fri, 18 Mar 2005 09:28:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3506807#M843748</guid>
      <dc:creator>Edward McCouch</dc:creator>
      <dc:date>2005-03-18T09:28:54Z</dc:date>
    </item>
  </channel>
</rss>

