Feeling a bit 'trapped' by Net::SNMP

2002-12-23 Thread Ian Zapczynski
Hello all, I hope my question isn't too specific for this list. I'm still learning the basic concepts of SNMP, but I need my current script to send an SNMP trap to a host here upon failure. I am hoping to use Net::SNMP to do so, but I think I'm unclear of the syntax due to my current lack of

Re: how to use alarm() to properly time out a connection?

2002-12-20 Thread Ian Zapczynski
Jose, Yes, you are correct. I did not know about placing the alarm prior to the hanging condition (gee, I guess that makes sense) or clearing the alarm afterwards. Thank you! -Ian NYIMI Jose (BMB) wrote: -Original Message- From: Ian Zapczynski [mailto:[EMAIL PROTECTED]] Sent

how to use alarm() to properly time out a connection?

2002-12-20 Thread Ian Zapczynski
Hello all, I need to use alarm to time out a connection to an SFTP server if the connection hangs (I was able to reproduce such a hang using the Secure Shell Server for Windows, so I thought it would be nice if my script assumed this was a possibility). I think I am not understanding the perld

RESOLVED: Net::SFTP causes script to exit if connection can't be made

2002-12-13 Thread Ian Zapczynski
; if (!$sftp) { print "I can't connect!"; } else { print "SUCCESS!"; } - Original Message - From: "Ian Zapczynski" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 12, 2002 4:51 PM Subject: Net::SFTP causes sc

Re: More on Net::SFTP causes script to exit if connection can't be made

2002-12-13 Thread Ian Zapczynski
suite100") || warn "connection failed $!"; if (!$sftp) { print "I can't connect!"; } else { print "SUCCESS!"; } - Original Message - From: "Ian Zapczynski" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent:

Re: Net::SFTP causes script to exit if connection can't be made

2002-12-13 Thread Ian Zapczynski
TP->new("10.25.3.150", user=>"administrator", password=>"suite100") || warn "connection failed $!"; if (!$sftp) { print "I can't connect!"; } else { print "SUCCESS!"; } - Original Message -

Net::SFTP causes script to exit if connection can't be made

2002-12-12 Thread Ian Zapczynski
All, I just pulled down the latest Net::SFTP from CPAN and am using it w/ Perl 5.6.1. I've used the module before and don't *think* I've seen this problem, but I can't say for sure and have only one machine to test it on. What happens is that if an SFTP connection is refused to the specified

Re: populating a hash key using a variable

2002-12-11 Thread Ian Zapczynski
/ rather than what you've actually coded :-} Cheers, Rob - Original Message - From: "Kipp, James" <[EMAIL PROTECTED]> To: "'Ian Zapczynski'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, December 11, 2002 4:11 PM Subject: RE: p

Re: populating a hash key using a variable

2002-12-11 Thread Ian Zapczynski
I am not populating from a file, actually. I'm populating from the output of $sth->fetch from DBI. The $something and $something_else variables in this case are numbers which have been defined by the output of that method. If I do $hash{SOMETHING}{0} = $something; Then my hash is populated

populating a hash key using a variable

2002-12-11 Thread Ian Zapczynski
Hello all, I'm obviously making a silly mistake here and would appreciate it if someone can point out my error. I am trying to populate a hash of a hash in a while() loop. Here is what I have: my $i = 0; my %hash = (); while () { $hash{SOMETHING}{$i} = $something; $hash{SOMETH

moving a large hash to a library and using data from args to populate it

2002-12-03 Thread Ian Zapczynski
Hello all, I am writing a script which requires that a very large multi-level hash be populated at the start. I am trying to write something somewhat efficient so I can use a somewhat small loop to do a whole lot of work. Unfortunately, the size of the hash makes my script look rather ugly,

Re: add_delta_workdays from Date::Calendar not returning what I'dexpect

2002-08-12 Thread Ian Zapczynski
gt; > today is 2002-8-12 > yesterday is 2002-8-11 > the previous business day is 20020809 > > > -Original Message- > > From: Nikola Janceski [mailto:[EMAIL PROTECTED]] > > Sent: Monday, August 12, 2002 2:06 PM > > To: 'Ian Zapczynski'; [EMAIL

add_delta_workdays from Date::Calendar not returning what I'd expect

2002-08-12 Thread Ian Zapczynski
Hello all, I hope this is not too specific for this list. If so, please let me know if you have suggestions on a better place to seek the answer for this. In the code below, I am using add_delta_workdays from Date::Calendar to check if yesterday was a business day. My problem is that it seems

trouble comparing dates from two different modules

2002-07-24 Thread Ian Zapczynski
Hello all, I am using add_delta_workdays() from Date::Calendar to determine whether yesterday was or was not a business day. In order to do this, I am trying to compare it with a date output from Add_Delta_Days from Date::Calc. What I'd *like* to do is stringify the output from both of these fu

trouble comparing dates from two different modules

2002-07-24 Thread Ian Zapczynski
Hello all, I am using add_delta_workdays() from Date::Calendar to determine whether yesterday was or was not a business day. In order to do this, I am trying to compare it with a date output from Add_Delta_Days from Date::Calc. What I'd *like* to do is stringify the output from both of these fu

Re: How to pass the value of $@ to a subroutine

2002-07-03 Thread Ian Zapczynski
Thanks! Changing: my $message = @_; to: my ($message) = @_; did put the correct value in the string. If anyone cares to explain the difference between the code I had and the code Shishir suggested so I can understand why this makes a difference, I'm all ears! Thanks again, -Ian "Shishir K.

How to pass the value of $@ to a subroutine

2002-07-03 Thread Ian Zapczynski
Hello all, What I want to do is simple - if an error occurs on my previous command (in this case, making an FTP connection via Net::FTP), I want to send the value of $@ to a subroutine which sends an e-mail containing the value of $@ in the body. However, it is clear that I don't understand what

Mod_perl insight

2001-12-10 Thread Ian Zapczynski
Hello all, I'm a UNIX administrator with prior experience with Perl CGI on Windows NT. It looks as if I may be taking on some new Perl work which will make use of mod_perl with Apache. All I know so far about mod_perl is that the perl scripts run as part of the Apache process instead of forking