Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Perl script running external command

Reply
Thread Tools

Perl script running external command

 
 
ccc31807
Guest
Posts: n/a
 
      03-23-2011
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.
 
Reply With Quote
 
 
 
 
Justin C
Guest
Posts: n/a
 
      03-24-2011
On 2011-03-23, ccc31807 <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
 
ccc31807
Guest
Posts: n/a
 
      03-24-2011
On Mar 24, 5:22*am, Justin C <(E-Mail Removed)> 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.
 
Reply With Quote
 
ccc31807
Guest
Posts: n/a
 
      03-24-2011
On Mar 23, 3:52*pm, ccc31807 <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble running Perl script from within a Perl script laredotornado@zipmail.com Perl Misc 4 07-29-2011 01:44 PM
fail running an external C program into a Perl CGI script yairl@savion.huji.ac.il Perl Misc 9 12-31-2008 05:36 PM
Pull out only first field of ps command ( in Perl ) PERL RUN COMMAND tweetiebirds@gmail.com Perl Misc 2 03-26-2005 06:03 AM
Running perl script from command line Abhishek Srivastava Perl Misc 3 02-07-2004 08:53 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments