RE: How to implement ping script to monitor server up/down state in perl ?

2009-07-21 Thread David Christensen
Amit Saxena wrote: > I want a perl ping script (console based) to monitor server up/down state. Here's something I wrote ~2000 FWIW. It looks like I was still on dial-up, and wanted to ping an Internet host every ~10 seconds or so to prevent my connection from being dropped due to inactivity. Br

Re: Install DBD::Sybase

2009-07-21 Thread Jenn G.
On Tue, Jul 21, 2009 at 9:11 PM, Gurunandan R. Bhat wrote: > Ooops - Sorry!! I sent an HTML reply and my links went away. > > Here is my reply with the links preserved: > > I assume you have installed the freetds library. > Please follow the solutions given here: > http://lists.ibiblio.org/piperma

Re: Key classification using Switch

2009-07-21 Thread Steve Bertrand
Steve Bertrand wrote: > Uri Guttman wrote: >>> "SB" == Steve Bertrand writes: > >> i told you dispatch tables are very useful! >> >> i leave how to code it as an exercise for you. > > Well, I did end up implementing the dispatch table, and had some serious > problems trying to retrofit it in

Re: Key classification using Switch

2009-07-21 Thread Steve Bertrand
Uri Guttman wrote: >> "SB" == Steve Bertrand writes: > > i told you dispatch tables are very useful! > > i leave how to code it as an exercise for you. Well, I did end up implementing the dispatch table, and had some serious problems trying to retrofit it into a particular class's namespac

Re: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Shawn H. Corey
Uri Guttman wrote: "SHC" == Shawn H Corey writes: SHC> Uri Guttman wrote: >> >> print < >> All STDOUT/STDERR will be assigned to this scripts audittrail log!! >> All STDOUT/STDERR will be assigned to this scripts audittrail log!! >> All STDOUT/STDERR will be assigned to this scrip

Re: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Uri Guttman
> "SHC" == Shawn H Corey writes: SHC> Uri Guttman wrote: >> >> print <> All STDOUT/STDERR will be assigned to this scripts audittrail log!! >> All STDOUT/STDERR will be assigned to this scripts audittrail log!! >> All STDOUT/STDERR will be assigned to this scripts audittrail log!!

RE: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Patrick K Christopher TANAGER
This is how I got it to work. However any STDOUT completion messages will need to be done outside the brace. } local *STDOUT; if ( $GlblInfo{audit} ) { printf "All STDOUT/STDERR will be assigned to this scripts audittrail log!!\n"; printf "All STDOUT/STDERR will be assigned to this s

Re: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Shawn H. Corey
Uri Guttman wrote: ""D" == "Wagner, David <--- Senior Programmer Analyst --- CFS" > writes: "D> printf "All STDOUT/STDERR will be assigned to this scripts audittrail log!!\n"; "D> printf "All STDOUT/STDERR will be assigned to this scripts audittrail log!!\n"; "D> printf "Al

Re: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Uri Guttman
> ""D" == "Wagner, David <--- Senior Programmer Analyst --- CFS" > > writes: "D> printf "All STDOUT/STDERR will be assigned to this scripts audittrail log!!\n"; "D> printf "All STDOUT/STDERR will be assigned to this scripts audittrail log!!\n"; "D> printf "All STDOUT/S

RE: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: Tony Esposito [mailto:tony1234567...@yahoo.co.uk] > Sent: Tuesday, July 21, 2009 08:08 > To: beginners@perl.org > Subject: Fw: Having problems getting data back to STDOUT once > I assign it to a file > > Back to the question at hand - have you tried using 'te

Re: Key classification using Switch

2009-07-21 Thread Steve Bertrand
Uri Guttman wrote: >> "SB" == Steve Bertrand writes: > > SB> # STRINGS > SB> case /^(comment|plan_type|description|desc|started| > SB> billing_address1|billing_address2|shipping_address1| > SB> shipping_address2|billing_company_name|shipping_company_name| > SB>

Re: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Shawn H. Corey
Jay Savage wrote: On Tue, Jul 21, 2009 at 9:25 AM, Shawn H. Corey wrote: John W. Krahn wrote: [snip] close(STDERR); open(STDOUT , '>') || die "Unable to open STDOUT: $!"; You're not opening STDOUT to anything. And you closed STDERR so the die message can't go anywhere. In fact

Re: Key classification using Switch

2009-07-21 Thread Uri Guttman
> "SB" == Steve Bertrand writes: SB> # STRINGS SB> case /^(comment|plan_type|description|desc|started| SB> billing_address1|billing_address2|shipping_address1| SB> shipping_address2|billing_company_name|shipping_company_name| SB> shipping_town|billing_town)$/

Re: Key classification using Switch

2009-07-21 Thread John W. Krahn
Steve Bertrand wrote: I'm currently working on a field value validation system. It takes in a custom data type, and then runs each key through a switch statement and validates the value. As I add new data types, I run the type through the switch, to ensure all fields are tested. When they are no

Fw: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Tony Esposito
Back to the question at hand - have you tried using 'tee' use File::Tee qw(tee); # simple usage: tee(STDOUT, '>', 'stdout.txt'); Tony From: John W. Krahn To: Sent: Tuesday, 21 July, 2009 8:41:25 Subject: Re: Having problems getting data back to STDOUT once

Re: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Jay Savage
On Tue, Jul 21, 2009 at 9:25 AM, Shawn H. Corey wrote: > John W. Krahn wrote: [snip]        close(STDERR);        open(STDOUT , '>') || die "Unable to open STDOUT: $!"; >>> >>> You're not opening STDOUT to anything.  And you closed STDERR so the die >>> message can't go anywhere.  In fact

Re: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread John W. Krahn
Tony Esposito wrote: From: John W. Krahn Shawn H. Corey wrote: John W. Krahn wrote: Shawn H. Corey wrote: Wagner, David --- Senior Programmer Analyst --- CFS wrote: I am done processing and I want to place the final output line also on the screen. Here is what I have: if ( $GlblI

Key classification using Switch

2009-07-21 Thread Steve Bertrand
I'm currently working on a field value validation system. It takes in a custom data type, and then runs each key through a switch statement and validates the value. As I add new data types, I run the type through the switch, to ensure all fields are tested. When they are not, I classify them withi

Re: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread John W. Krahn
Shawn H. Corey wrote: John W. Krahn wrote: Shawn H. Corey wrote: Wagner, David --- Senior Programmer Analyst --- CFS wrote: I am done processing and I want to place the final output line also on the screen. Here is what I have: if ( $GlblInfo{audit} ) { printf "\n\n*Shoul

Re: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Shawn H. Corey
John W. Krahn wrote: Shawn H. Corey wrote: Wagner, David --- Senior Programmer Analyst --- CFS wrote: I am done processing and I want to place the final output line also on the screen. Here is what I have: if ( $GlblInfo{audit} ) { printf "\n\n*Should be last line in the a

Re: Install DBD::Sybase

2009-07-21 Thread Gurunandan R. Bhat
Ooops - Sorry!! I sent an HTML reply and my links went away. Here is my reply with the links preserved: I assume you have installed the freetds library. Please follow the solutions given here: http://lists.ibiblio.org/pipermail/freetds/2006q3/020587.html and here: http://www.perlmonks.org/?node

Re: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread John W. Krahn
Shawn H. Corey wrote: Wagner, David --- Senior Programmer Analyst --- CFS wrote: I am done processing and I want to place the final output line also on the screen. Here is what I have: if ( $GlblInfo{audit} ) { printf "\n\n*Should be last line in the audittrail file...

Re: Install DBD::Sybase

2009-07-21 Thread Gurunandan R. Bhat
On Tue, 2009-07-21 at 14:38 +0800, Jenn G. wrote: You must install the freetds library before compiling DBD::Sybase? > Hello, > > I follow the steps on this link to install and use DBD::Sybase for MSSQL: > http://www.perlmonks.org/?node_id=392385 > > But when configure I got: > > BLK api NOT

Re: How to implement ping script to monitor server up/down state in perl ?

2009-07-21 Thread Amit Saxena
Hi Bob, It seems there is some confusion. I just want to monitor remote server connectivity (either through ping or something else) but I don't want to call my programs every few intervals etc. What I want is a daemon sort of a thing in Perl running either on the source system (preferably) or on

Re: How to implement ping script to monitor server up/down state in perl ?

2009-07-21 Thread Amit Saxena
Thanks Thomas, I will surely look at mon to know about how to write monitoring code in Perl. Thanks & Regards, Amit Saxena On Tue, Jul 21, 2009 at 5:25 AM, Thomas Bätzler wrote: > Amit Saxena wrote: > > Hi Thomas, > > > > Thanks for the response. > > > > The client for which I am working will

Re: How to implement ping script to monitor server up/down state in perl ?

2009-07-21 Thread PANG J.
Amit Saxena : Hi all, I want a perl ping script (console based) to monitor server up/down state. I once made that a subroutine based on Net::Ping: use Net::Ping; sub pinghost { my $host = shift; my $type = shift || 'icmp'; my $port = shift || 7; # for syn ping my $stat

RE: How to implement ping script to monitor server up/down state in perl ?

2009-07-21 Thread Bob McConnell
From: Amit Saxena > > The client for which I am working will not allow any external utility / > modules to be installed on their development / production environments. > Moreover they want the solution implemented using Perl only. If they won't allow any utilities, how will you install this one?

AW: How to implement ping script to monitor server up/down state in perl ?

2009-07-21 Thread Thomas Bätzler
Amit Saxena wrote: > Hi Thomas, > > Thanks for the response. > > The client for which I am working will not allow any external utility / > modules to be installed on their development / production environments. > Moreover they want the solution implemented using Perl only. Actually, mon ist pure

Re: How to implement ping script to monitor server up/down state in perl ?

2009-07-21 Thread Eric Veith
You could create a simple daemon that works using the observer OOP concecpt: Nodes register themselves as observers to the server that should be monitored, which constantly sends "I am alive" packets AND tries to notify the connected observers when it's beeing rebooted using another message. HTH

Re: How to implement ping script to monitor server up/down state in perl ?

2009-07-21 Thread Amit Saxena
Hi Thomas, Thanks for the response. The client for which I am working will not allow any external utility / modules to be installed on their development / production environments. Moreover they want the solution implemented using Perl only. Thanks & Regards, Amit Saxena On Tue, Jul 21, 2009 at

AW: How to implement ping script to monitor server up/down state in perl ?

2009-07-21 Thread Thomas Bätzler
Amit Saxena asked: > I want a perl ping script (console based) to monitor server up/down > state. Why re-invent the wheel when there's already stuff like mon (http://mon.wiki.kernel.org/index.php/Main_Page) or nagios (http://www.nagios.org/)? HTH, Thomas -- To unsubscribe, e-mail: beginners-

AW: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Thomas Bätzler
Wagner, David --- Senior Programmer Analyst --- CFS asked: > I have looked at perldoc -f open and tried a number of things. The > line "should be last line" is appearing in my audittrail file, but I > never see the EndOfProg or Error in the auditrrail or on the screen. Try "perldoc -f sele

How to implement ping script to monitor server up/down state in perl ?

2009-07-21 Thread Amit Saxena
Hi all, I want a perl ping script (console based) to monitor server up/down state. So far I have tried two different approaches, though none of them were successful. *First Approach* Call the operating system "ping" command from the Perl program and get the server up/down state. Call this progr

Re: Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Shawn H. Corey
Wagner, David --- Senior Programmer Analyst --- CFS wrote: I am done processing and I want to place the final output line also on the screen. Here is what I have: if ( $GlblInfo{audit} ) { printf "\n\n*Should be last line in the audittrail file...*\n\n"; clo

Having problems getting data back to STDOUT once I assign it to a file

2009-07-21 Thread Wagner, David --- Senior Programmer Analyst --- CFS
I am done processing and I want to place the final output line also on the screen. Here is what I have: if ( $GlblInfo{audit} ) { printf "\n\n*Should be last line in the audittrail file...*\n\n"; close(STDOUT); close(STDERR); open(STDOUT , '>')

Re: Install DBD::Sybase

2009-07-21 Thread Jenn G.
And I tried to install unixODBC but also make failed: g++ -g -O2 -o .libs/ODBCConfig main.o -L/usr/X11R6/lib/qt-3.3.8b/lib /usr/lib/qt-3.3.8b/lib/libqt-mt.so -L/usr/X11R6/lib /usr/lib/libmng.so -ljpeg -lpng -lz -lGL -lXmu -lXrender -lXrandr -lXcursor -lXinerama -lXft /usr/lib/libfreetype.so -lfon