Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Thank you I am very humbled for your help its very appreciated. I have my script pointing to one remote solaris 10 server for testing and this is what I see first in debug turned on to my screen and after that this is what I see in my log file.

First is my output to my screen from debugging.

# perl tester-a.pl Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1a317160)', 60, 'ARRAY(0x1a31777 +0)', 'ARRAY(0x1a3177c0)') called at tester-a.pl line 32 main::change_password('solarishost') called at tester-a.pl lin +e 20 Password: Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1a317160)', 60, '$') called at t +ester-a.pl line 48 main::change_password('solarishost') called at tester-a.pl lin +e 20 <code> Last login: Wed Apr 8 10:32:54 2015 from mycomputer. $ Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1a317160)', 60, 'Password:') cal +led at tester-a.pl line 50 main::change_password('solarishost') called at tester-a.pl lin +e 20 su - root Password: Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1a317160)', 60, '#') called at t +ester-a.pl line 52 main::change_password('solarishost') called at tester-a.pl lin +e 20 [root@solarishost ~ ] # Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1a317160)', 60, '#') called at t +ester-a.pl line 54 main::change_password('solarishost') called at tester-a.pl lin +e 20 hostname solarishost [root@solarishost ~ ] # Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1a317160)', 60, '#') called at t +ester-a.pl line 56 main::change_password('solarishost') called at tester-a.pl lin +e 20 uptime 1:59pm up 10 day(s), 14:43, 4 users, load average: 5.19, 5.16, 4. +90 [root@solarishost ~ ] # Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1a317160)', 60, 'New Password:') + called at tester-a.pl line 58 main::change_password('solarishost') called at tester-a.pl lin +e 20 passwd amagana New Password: Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1a317160)', 60, 'Re-enter new Pa +ssword:') called at tester-a.pl line 60 main::change_password('solarishost') called at tester-a.pl lin +e 20 Re-enter new Password: Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1a317160)', 60, '#') called at t +ester-a.pl line 62 main::change_password('solarishost') called at tester-a.pl lin +e 20 passwd: password successfully changed for amagana [root@solarishost ~ ] # Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1a317160)', 60, '$') called at t +ester-a.pl line 64 main::change_password('solarishost') called at tester-a.pl lin +e 20 exit logout $ Closing spawn id(3). at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 1431 Expect::hard_close('Expect=GLOB(0x1a317160)') called at /usr/l +ib/perl5/site_perl/5.8.8/Expect.pm line 1621 Expect::DESTROY('Expect=GLOB(0x1a317160)') called at tester-a. +pl line 20 eval {...} called at tester-a.pl line 20 main::change_password('solarishost') called at tester-a.pl lin +e 20 Pid 4754 of spawn id(3) terminated, Status: 0xFF00

This is my log file results

vi /var/tmp/expect_script.log ======= system ======= ^M You are accessing a U.S. Government (USG) Information System (IS) th +at is ^M provided for USG-authorized use only. + ^M + ^M By using this IS (which includes any device attached to this IS), yo +u consent^M to the following conditions: + ^M + ^M -The USG routinely intercepts and monitors communications on this IS +for ^M purposes including, but not limited to, penetration testing, COMSEC + ^M monitoring, network operations and defense, personnel misconduct (PM +), law ^M enforcement (LE), and counterintelligence (CI) investigations. + ^M + ^M -At any time, the USG may inspect and seize data stored on this IS. + ^M + ^M -Communications using, or data stored on, this IS are not private, ar +e ^M subject to routine monitoring, interception, and search, and may be + ^M disclosed or used for any USG authorized purpose. + ^M + ^M -This IS includes security measures (e.g.,authentication and access c +ontrols)^M to protect USG interests--not for your personal benefit or privacy. + ^M + ^M -Notwithstanding the above, using this IS does not constitute consent + to PM, ^M LE or CI investigative searching or monitoring of the content of pri +vileged ^M communications, or work product, related to personal representation +or ^M services by attorneys, psychotherapists, or clergy, and their assist +ants. ^M Such communications and work product are private and confidential.^M Password: ^M Last login: Wed Apr 8 10:32:54 2015 from mycomputer.^M^M +--------------------------------------------------------------------- +--------+^M |You are accessing a U.S. Government (USG) Information System (IS) tha +t is |^M |provided for USG-authorized use only. + |^M | + |^M |By using this IS (which includes any device attached to this IS), you + consent|^M |to the following conditions: + |^M | + |^M |-The USG routinely intercepts and monitors communications on this IS +for |^M | purposes including, but not limited to, penetration testing, COMSEC + |^M | monitoring, network operations and defense, personnel misconduct (PM +), law |^M | enforcement (LE), and counterintelligence (CI) investigations. + |^M | + |^M |-At any time, the USG may inspect and seize data stored on this IS. + |^M | + |^M |-Communications using, or data stored on, this IS are not private, ar +e |^M | subject to routine monitoring, interception, and search, and may be + |^M | disclosed or used for any USG authorized purpose. + |^M | + |^M |-This IS includes security measures (e.g.,authentication and access c +ontrols)|^M | to protect USG interests--not for your personal benefit or privacy. + |^M | + |^M |-Notwithstanding the above, using this IS does not constitute consent + to PM, |^M | LE or CI investigative searching or monitoring of the content of pri +vileged |^M | communications, or work product, related to personal representation +or |^M | services by attorneys, psychotherapists, or clergy, and their assist +ants. |^M | Such communications and work product are private and confidential. + |^M +--------------------------------------------------------------------- +--------+^M $ su - root^M Password: ^M +--------------------------------------------------------------------- +--------+^M |You are accessing a U.S. Government (USG) Information System (IS) tha +t is |^M |provided for USG-authorized use only. + |^M | + |^M |By using this IS (which includes any device attached to this IS), you + consent|^M |to the following conditions: + |^M | + |^M |-The USG routinely intercepts and monitors communications on this IS +for |^M | purposes including, but not limited to, penetration testing, COMSEC + |^M | monitoring, network operations and defense, personnel misconduct (PM +), law |^M | enforcement (LE), and counterintelligence (CI) investigations. + |^M | + |^M |-At any time, the USG may inspect and seize data stored on this IS. + |^M | + |^M |-Communications using, or data stored on, this IS are not private, ar +e |^M | subject to routine monitoring, interception, and search, and may be + |^M | disclosed or used for any USG authorized purpose. + |^M | + |^M |-This IS includes security measures (e.g.,authentication and access c +ontrols)|^M | to protect USG interests--not for your personal benefit or privacy. + |^M | + |^M |-Notwithstanding the above, using this IS does not constitute consent + to PM, |^M | LE or CI investigative searching or monitoring of the content of pri +vileged |^M | communications, or work product, related to personal representation +or |^M | services by attorneys, psychotherapists, or clergy, and their assist +ants. |^M | Such communications and work product are private and confidential. + |^M +--------------------------------------------------------------------- +--------+^M ^[[01m[root@solarishost ~ ]^[[m # hostname^M solarishost^M ^[[01m[root@solarishost ~ ]^[[m # uptime^M 1:59pm up 10 day(s), 14:43, 4 users, load average: 5.19, 5.16, 4. +90^M ^[[01m[root@solarishost ~ ]^[[m # passwd amagana^M New Password: ^M Re-enter new Password: ^M passwd: password successfully changed for amagana^M ^[[01m[root@solarishost ~ ]^[[m # exit^M logout^M $

In reply to Re^12: expect.pm header by amagana
in thread expect.pm header by amagana

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (8)
    As of 2019-06-26 15:50 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Is there a future for codeless software?



      Results (110 votes). Check out past polls.

      Notices?