Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Perl and SSH hanging

Options
  • 06-06-2008 3:12pm
    #1
    Registered Users Posts: 9,579 ✭✭✭


    Hey,

    Right I got a perl script that runs with a specific perl installation. This script must call another script using another perl version to I have something like:
    	my @cmd =  qw(  );
    
    	@cmd = qx{C:/perl2/bin/perl.exe Script.pl $host);
    
    	return join('', @cmd);
    


    Script.pl SSH's into a range of IP addresses but on some IP's it hangs as the server doesn't respond. Problem is, it never times out and holds up the whole script from running the rest of the IP addresses.

    I tried the Perl Alarm function but this doesn't seem to time out either. The script just hangs.

    This is a cron script so I can't afford it to hang, plus all IP's OS's are changing constantly so the problem hops from IP to IP so filtering out IP isn't a problem.

    I hope I made sense here but has anyone any ideas?

    Thanks,


Comments

  • Closed Accounts Posts: 1,444 ✭✭✭Cantab.


    Why not use threads?


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Problem is I must wait for the script to run to capture the output of it? - If I use threads will I still end up locking up things? -


  • Registered Users Posts: 26,579 ✭✭✭✭Creamy Goodness


    could you possibly ping the host contained in $host first to make sure it's up, then if you get a positive response back preceed with the ssh connection?


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Exactly what I am doing already :) - problem is I believe the SSH service is down on the remote host or something. Damn annoying


Advertisement