Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Linux


General :: Write A Perl Script To Ping Multiple Server?

How to write a perl script to ping multiple server and if any server is down then we manually bring up the server within 3hours wehn it goes down and will display a message" server is up within 3hours" and if we are unable to bring the server up manually within 3 hours then we will display a message " unable to bring the server alive". Need perl script to display the message.

View 1 Replies (Posted: 07-22-2011, 09:27 AM)

Sponsored Links:

Related Forum Messages For Linux category:
Programming :: Write A Perl Script Which Will Give An Interactive Session To A User To Execute Command On The Server
I am trying to write a perl script which will give an interactive session to a user to execute command on the server. I have written a small script to do this :

Code: !/usr/bin/perl -w
use strict;
use Net::SSH::Perl;
my $host = '';
my $username = 'user';
my $login_passwd = 'test123';


Posted: 02-25-2011

View 2 Replies!   View Related
General :: How To Write Perl Script To Catch All Content
I would like to know a how to write Perl script to catch all the content in between BEGIN: and END from input file could any body help?

Posted: 08-05-2010, 11:36 AM

View 9 Replies!   View Related
General :: Write A C Code To Ping IP Addresses Which Are Read From A Text File?
i need to write a c code to ping IP addresses which are read from a text file and need to log the response time in another text file.

Posted: 08-03-2010, 04:34 AM

View 4 Replies!   View Related
Networking :: Ping Multiple Devices Via Multiple NICs?
I have an old pentium 3 computer that has ~7 NICs installed. These NICs are attached to modems and other networking equipment. According to the linux ping page on, it seems that one could send a ping from a certain specified NIC. How would one go about this?

Posted: 05-20-2010

View 6 Replies!   View Related
General :: Give Write Permissions To Multiple Users On A Folder In Ubuntu?
There is a folder that is owned by user tomcat6: drwxr-xr-x 2 tomcat6 tomcat6 69632 2011-05-06 03:43 document. I want to allow another user (ruser) write permissions on document folder. The two users (tomcat6 and ruser) does not belong to same group. I have tried using setfacl: sudo setfacl -m u:ruser:rwx document

but this gives me setfacl: document: Operation not supported error.

Posted: May 9 at 8:44

View 1 Replies!   View Related
CentOS 5 Server :: Move 5.5 To /usr/bin/perl So Root Based On Perl 5.12.1?
I am new here and want to lern CentOS. Current I have installed CentOS 5.5 x64 and Perl 5.8.8. Now i have install Perl 5.12.1 which located to /usr/local/bin/perl. But how I can move it to /usr/bin/perl so root based on Perl 5.12.1?

Posted: 2010/8/11 19:13

View 7 Replies!   View Related
Programming :: Write Iptables Commands In Perl?
I've worked with iptables in shell, but now I need to write an iptables command with perl. here is my code that I've tried but it didn't work :

print "Content-type: text/html


Posted: 07-14-2010, 04:01 PM

View 4 Replies!   View Related
Networking :: Can't Ping Past Gateway / Can Ping Server From Outside
So, I have an Virtual Machine running CentOS 5.4. It sits behind a hardware firewall which also does NAT'ing. I've set up plenty of these, so I know for sure the firewall and NAT rules are set up correctly. From the host, I can ping anything in my subnet and the gateway. But I can't ping anything else beyond the gateway. I can perform DNS queries and when I try to ping, it finds the appropriate IP address.But from the outside, I can ping the PUBLIC address (It's a 1 public to 1 private address NAT, not 1 public to multiple private). I've tried it with IPTABLES on and off, with no change.

Posted: 04-29-2010, 01:25 PM

View 11 Replies!   View Related
Ubuntu :: Write Ping Output To Txt File?
How do i write ping output to txt file?

Posted: January 18th, 2011

View 3 Replies!   View Related
Networking :: Cannot Ping With Command - Ping IP - Address But Can Ping With - Ping IP -I Eth0
I am using an virtual machine. where I need to ping from one machine to another. earlier I was able to ping. But after going to once, I cannot ping back to this machine.

But if I gave ping -I eth1 <IP> then I can ping.

I cannot install any package, so tell me solution which includes not installing any package.

Posted: 07-15-2011, 05:01 AM

View 2 Replies!   View Related
General :: Multiple Servers Or One Server With Multiple VMWare?
I'm looking at setting up a couple automated systems: Here are a few examples:

* Internal accounting system to download and process emails
* Public web server to visit

I could put each system on its own separate box -- for example, it's generally good practice to separate anything that external users have access to (such as a webserver) from internal processes such as accounting. Now, rather than dishing out the money for two separate servers, could I get away with just installing new instances of VMWare on the same box for each system?

To give you an idea, these are not large scale computationally sensitive systems. The accounting one is simply downloading and tallying emails, and the latter is just a webserver with maybe 5 hits per day on a good day. I could definitely pick up a new box for say $50, but I wanted to know the general practice of using VMWare on the same box versus two separate boxes.

Posted: 02-07-2011

View 2 Replies!   View Related
Programming :: Perl - Writing To File - Keep Open Or Only During Write?
i am working on this thread: [URL] if it is better to open a file every time i need to write to it or should i keep a file open the whole time and when i am done with the script, close it and sendmail it out?

Or i just thought of this: i could keep concatenating to a string and just sendmail when done.

Posted: 05-24-2011, 07:35 PM

View 2 Replies!   View Related
Programming :: Write A Small Perl Script To Collect Some Info From Mysql?
am running Centos 5.4 and would like to write a small perl script to collect some info from mysql.

so I went
yum install perl-DBI
yum install perl-DBD-mysql


use Mysql;


Why can't perl find I guess because it doesn't exist as I ran find / -name, and also could not find it.

shouldn't that file have been created and thus exist after I install perl-DBD-mysql?

Posted: 10-10-2010, 08:11 AM

View 6 Replies!   View Related
SUSE / Novell :: Write IPTABLES Script To Block The ICMP Ping?
I was trying to write IPTABLES script to block the ICMP ping using the below mentioned command in OpenSUSE 11.2 Doing this in VMware.....

iptables -A OUTPUT -o eth0 -p icmp -j DROP

& then I tried to ping the different computer & it didnt allow me to ping.
Then I deleted using the command -

iptables -D OUTPUT -o eth0 -p icmp -j DROP

then I couldnt ping also. Another thing I found is my firefox is not connecting to the internet as well, but before writing the script, I can connect to internet.

I did a "dhclient" & iptables -F....

Posted: 03-13-2010, 11:30 PM

View 6 Replies!   View Related
Programming :: Indexing Multiple Drives With Perl?
I have 4 separate drives, all un-RAIDed.Each drive has almost the same root directories, but different contents in each folder.

For example:

/mnt/sda/TV Shows/Lost/
/mnt/sdb/TV Shows/Your_Favorite_Show/

The goal is to have a single folder that has symlinks to all the files in each of the drives. Pretty much a poor man's JBOD. Previously, I had problems with conditions like 2 drives having the same sub folder contents, but I ended up solving that with the current script I'm using now.What I'm looking for now is speed. I'm very new to Perl and the script takes about 12 minutes to complete with the current drives.

Basically, the script makes a list of all directories and files in each drive. First, it makes the directories. I didn't use any validation because if a directory already exists, it simply won't make one. However, with the files, I used a hash to only keep the unique files. Then I use the key/value pairs with ln to create every link to the files only, not directories.


use warnings;
my @drives_to_sync = qw ( /mnt/sda/ /mnt/sdb/ /mnt/sdc/ /mnt/sdd/);


Posted: 05-07-2010, 02:07 PM

View 2 Replies!   View Related
Programming :: Unable To Match Across Multiple Lines In Perl
I'm trying to split a text file into various parts. Everything in between "123" and "break" (including linebreaks) goes into the splitted file.

e.g. using this text file:

This should split into 4 files. However I'm only getting 2 files: one for the line "123break" and one for "123 blah break". The two occurrences that contain linebreaks are being ignored. The .* part of my match should capture linebreaks seeing that I'm using the /s modifier shouldn't it? Even when I use the match /(123 break)/gs it still doesn't capture the first occurrence. I'm using Perl v5.12.3 (from ActiveState) on Windows XP. The text file is also in Windows format.

Code listed below.

The above code generates two files Output_1.txt and Output_2.txt which contain "123break" and "123 blah break" respectively. I want it to generate four files.

Posted: 05-11-2011, 10:07 AM

View 4 Replies!   View Related
Programming :: Delete Multiple Lines In A File Using Perl?
I have a file looks like the following:

digraph topology
"" -> ""[label="1.000", style=solid];
"" -> ""[label="1.000", style=solid];


Order of these lines are random... So I cannot delete line #19, for example... And you can see that top four lines I want to delete are pairs. So there might be some clever way to detect the lines, if a line has both "1.9" and "1.11", then delete the line... I am new to perl language. The following is the code I have now... I think I just need to write some code inside the while loop checking if I want to delete the line $dotline before I write to a NEW file.


#!/usr/bin/perl -w
$TOPPATH = "/tmp";
$NAME = "topology";


Posted: 04-15-2011, 03:55 PM

View 16 Replies!   View Related
Programming :: Perl - Multiple Child Processes In Parallel?
I'm looking for a way in Perl to be able to take a list of servers, ssh multiple commands to it and store the results. If I do this process serially, sometimes one server will hang the whole script and if it doesn't, it still takes hours to complete.

I'm thinking what I need to do is make a parent loop that calls out a separate process that passes the server name to the child sub process and then executes all the commands I have defined in its own process. If one server 'hangs', at least that won't stop the script from doing all the other servers in the list.

I'm guessing using the fork() command would serve me best, however, all the online descriptions I have found have been vague at best.

Posted: 09-03-2010, 07:06 AM

View 4 Replies!   View Related
General :: Cannot Connect To Server But Can Ping To Server
I created an account called adminftp on a local Linux server Centos.Added this user to FTP group.When I use Filzilla from another computer in the same network, it cannot connect to the server but I can ping to the server.

Posted: 12-26-2010, 07:26 PM

View 6 Replies!   View Related
General :: Ping - Gives Unknown Host Error - Ping To LAN Address Works Fine
Even ping google's ip address doesn't work. unknown host error using backtrack4 able to browse net with these settings.

My network settings:

What's the problem with these settings...

Posted: 05-13-2011, 01:47 PM

View 10 Replies!   View Related
CentOS 5 Server :: Unable To Give "Perl Path" To Run Perl CGI Script
I am unable to run perl-cgi script in my cent os Apache server. I have used locate perl command in terminal window and it gives following result:


tell which is the path to perl for example "usr/bin perl"

Posted: 2011/6/2 8:59

View 13 Replies!   View Related
Programming :: Perl Regex Not Matching Across Multiple Lines Despite Ms Flags / Fix It?
I have written a regular expression (tested in regexpal and regextester alpha something) with which I want to replace something like code...

but it only matches functions which occupy one line only, despite my tests showing multiple line matching in javascript testers online and using the m and s flags (which should make it multi line no?)

Posted: 08-16-2010, 03:27 PM

View 14 Replies!   View Related
Programming :: Perl's Length() Counts Umlauts Multiple Times
I'm programming some skript to get statistical information about some texts. This includes calculating the mean of word lengths.Unfortunately, Umlauts count as two characters. In the example below the output is 9, it should be 6.

sincercly, Max

use POSIX;
use locale;
my $test = length("ABC���");
print $test;

Posted: 12-14-2010, 02:51 AM

View 4 Replies!   View Related
Programming :: Convert Multiple File In Directory - Ascii To Hex In Perl ?
I have found a perl script that can convert single file: ascii to hex.

However I have thousand of file that I want to convert from ascii to hex.

Here is the perl script that convert single ascii file to hex in single line:


So I would like to read multiple file from a directory.

Then the file will be have same name file with hex data.

Here is sample of the read and write directory file.


Posted: 04-09-2011, 02:27 PM

View 3 Replies!   View Related
Copyright 2005-08, All rights reserved