Perl script running external command

Discussion in 'Perl Misc' started by ccc31807, Mar 23, 2011.

  1. ccc31807

    ccc31807 Guest

    This probably isn't a c.l.p.m. issue, but I'll ask anyway.

    I have a script that's run for years, part of which runs pscp to
    download and upload files to a remote server several times a day. This
    functionality is part of an essential process, and my organization's
    activities would come to a screeching halt if this ever failed. The
    machines are Windows servers.

    The call looks something like this:
    sub get_app_file
    {
    my $success = system './pscp -p -pw password username@12.34.56.78/
    directory/path/filename*.txt .';
    if ($success == 0) { $log .= "Successfully downloaded application
    file.\n"; }
    else { $log .= "PROBLEM WITH downloaded application file.\n"; }
    }

    The hardware guys are updating the servers, and I am in the process of
    moving these scripts to a new machine. A week ago, the download
    function worked, and today I can run it by hand -- BUT the script
    fails with this error message:
    ‘Fatal: Network error: Connection timed out’

    The hardware guys claim that they have made no change whatsoever to
    the system, but we have automatic updates, which have run.

    Any clues as to what might cause the problem? And maybe how to
    diagnose the failure? I'm not a hardware guy or a network guy, and I
    don't have any idea where to begin.

    Thanks, CC.
     
    ccc31807, Mar 23, 2011
    #1
    1. Advertising

  2. ccc31807

    Justin C Guest

    On 2011-03-23, ccc31807 <> wrote:
    > The call looks something like this:
    > sub get_app_file
    > {
    > my $success = system './pscp -p -pw password username@12.34.56.78/
    > directory/path/filename*.txt .';
    > if ($success == 0) { $log .= "Successfully downloaded application
    > file.\n"; }
    > else { $log .= "PROBLEM WITH downloaded application file.\n"; }
    > }
    >
    > The hardware guys are updating the servers, and I am in the process of
    > moving these scripts to a new machine. A week ago, the download
    > function worked, and today I can run it by hand -- BUT the script
    > fails with this error message:
    > ‘Fatal: Network error: Connection timed out’


    Maybe they've done something with ssh?

    What happens if you, from the command line, "ssh username@[dottedquad]"?
    I would expect a very similar error.

    Can you still ping that IP?

    I'm no newtwork expert, but that's what I'd start with.

    If you can't ssh into the box then you're not going to be able to scp
    either, pscp is just an scp wrapper/clone (PuTTY for anyone not
    familiar). At least you'll have something with which to go to the
    hardware guys, and put the problem back in their court.

    Justin.

    --
    Justin C, by the sea.
     
    Justin C, Mar 24, 2011
    #2
    1. Advertising

  3. ccc31807

    ccc31807 Guest

    On Mar 24, 5:22 am, Justin C <> wrote:
    > Maybe they've done something with ssh?


    According to 'them' (the network guys) they've done nothing to the
    server.

    > What happens if you, from the command line, "ssh username@[dottedquad]"?
    > I would expect a very similar error.


    I have three machines, my desktop, the current server, and the new
    server. I can hit the remote box with WinSCP on my desktop and the
    current server and the current server, but not the new server.

    I can't ping the remote site and never have been, but that's never
    been a problem.

    > Can you still ping that IP?


    I can't ping the remote site and never have been, but that's never
    been a problem.

    > If you can't ssh into the box then you're not going to be able to scp
    > either, pscp is just an scp wrapper/clone (PuTTY for anyone not
    > familiar). At least you'll have something with which to go to the
    > hardware guys, and put the problem back in their court.


    This morning, I ran three different test on all three machines,
    documented the results, turned it over to the network guys, and washed
    my hands of the problem. My code works, and the software works -- it's
    the machine that doesn't work.

    CC.
     
    ccc31807, Mar 24, 2011
    #3
  4. ccc31807

    ccc31807 Guest

    On Mar 23, 3:52 pm, ccc31807 <> wrote:
    > Any clues as to what might cause the problem? And maybe how to
    > diagnose the failure? I'm not a hardware guy or a network guy, and I
    > don't have any idea where to begin.


    One of the cowboys, playing on the server, made some changes he
    shouldn't have and didn't tell anybody ... AFTER he swore up and down
    that no one made any changes.

    Unfortunately, his name is Boss.

    CC.
     
    ccc31807, Mar 24, 2011
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,842
  2. Abhishek Srivastava

    Running perl script from command line

    Abhishek Srivastava, Feb 5, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    194
    Michele Dondi
    Feb 7, 2004
  3. Replies:
    2
    Views:
    168
    Tad McClellan
    Mar 26, 2005
  4. Replies:
    9
    Views:
    335
    Kiss Gabor
    Dec 31, 2008
  5. Replies:
    4
    Views:
    310
    ccc31807
    Jul 29, 2011
Loading...

Share This Page