473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

perl script host loop

1
Hello;

While this script working, in case of not to connect a node ("BADYK01","BAGRK01", "BAHLK01", "BAHLK02", "BAHLK03") , it stops.

I want it to be continue even if it doesnt connect a node. I mean if it couldnt connect to BAGRK01, I want it to be continue and connect the other node BAHLK01.

Thanks

Expand|Select|Wrap|Line Numbers
  1.     # $interface = "1.0"
  2.     # This PerlScript example iterates through an array of three session names
  3.     # connecting to each one in turn. The unix 'df' command is
  4.     # sent to each server and the output is captured to a logfile.
  5.     TEST1:
  6.     # Enable errors
  7.     #
  8.     use Win32::OLE;
  9.     Win32::OLE->Option(Warn => 3);
  10.     #unlink <*.txt>;
  11.     $crt->Session->Disconnect();
  12.     # An array of session names to connect to.
  13.     @sessions = ("BADYK01","BAGRK01", "BAHLK01", "BAHLK02", "BAHLK03");
  14.     # define some useful constants
  15.     #
  16.     $true = 1;
  17.     $false = 0;
  18.     $StartLog = $true;
  19.     $StopLog = $false;
  20.     $Append = $true;
  21.     $Overwrite = $false;
  22.     $Raw = $true;
  23.     $Not_raw = $false;
  24.     # NOTE: Set your logfile path here
  25.     #
  26.     #$LogFile = "LOG.txt";
  27.     #$LogFile = "$LOG.log";
  28.     #
  29.     $crt->Screen->{'Synchronous'} = $true;
  30.     # Loop thru the array of sessions
  31.     #
  32.     for ($i = 0; $i < 5; $i++) {
  33.     # Connect to each session using the "/s sessionname" argument.
  34.     #
  35.     $crt->Session->Connect("/s " . $sessions[$i]);
  36.     # Wait for 5 seconds, or until the login prompt appears.
  37.     #
  38.     $crt->Screen->WaitForString("MAIN LEVEL COMMAND <___>");
  39.     # Set the name of the logfile for this session.
  40.     #
  41.     $crt->Session->{'LogFileName'} = LOG . ".txt";
  42.     # Enable logging
  43.     #
  44.     $crt->Session->Log($StartLog,$Append);
  45.     # Send the 'df' command followed by a CR (octal 015)
  46.     #
  47.     $crt->Screen->Send("EOL:;\015");
  48.     $crt->Screen->WaitForString("BASE TRANSCEIVER STATION ALARMS HANDLING COMMAND <EO_>");
  49.     $crt->Session->Log($StopLog);
  50.     $crt->Session->Disconnect();
  51.     }
  52.     $crt->Screen->{'Synchronous'} = $false;
Sep 26 '12 #1
0 1475

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then...
9
by: Martin Foster | last post by:
Hi. I would like to be able to mimic the unix tool 'uniq' within a Perl script. I have a file with entries that look like this 4 10 21 37 58 83 111 145 184 226...
2
by: ColinQin | last post by:
Hi All, Now i have 2 servers A and B, A is a production server (the running web app is writen with php) and B is a CVS server. When i click a button in the running web app, i need to execute a...
1
by: Balajisanthanakrishnan | last post by:
Old Title: Hi all, need help for this perl script- thanks in advance I am BalajiSanthanakrishnan, chennai. Now I am working in a Perl Script which is executing in the Unix Servers. Basically i am...
4
by: jane007 | last post by:
Hello everybody: I am having a problem. On Unix platform, there is a script that need user to input data from console, then when I call Unix perl script from Windows, these is an issue occurs,...
1
by: Tension | last post by:
Hi. I have a Perl script that starts a build process (plus a lot of other things). The build process needs a few environment variables set. This is done automatically in a buildEnv.bat script...
4
by: jonathan184 | last post by:
Hi I have a perl script, basically what it is suppose to do is check a folder with files. Now the files are checked using a timestamp with the command ls -l so the timestamp in this format is...
2
by: gwigg | last post by:
Hi, am am having a problem with extracting all the data I want using a perl script the data being in a mysql database. The script works fine until row 59101 is reached in the 1st table, anyone aware...
82
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a)...
0
by: somsub | last post by:
Hi All, I am facing a problem while running a perl script through selenium RC server . I recorded oone log in test case with slenium IDE and run it after that with the ide only and it worked...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.