[Nagiosplug-help] FileHandles and Perl

atonns at mail.ivillage.com atonns at mail.ivillage.com
Mon May 12 11:54:09 CEST 2003

This sounds like a symptom of common problem - the scope of filehandles. You
might want to create a typeglob to use as a filehandle, that way it gets
garbage collected when it is out of scope.
For examples:
w-do-I-make-an-array-of-filehandles> -
I'm not 100% sure this is your problem, but is definately a "best practices"
thing when dealing with an embedded interpreter (or highly recursive

"Computer science is as much about computers as 
        astronomy is about telescopes" -- Edsger Dijkstra 
Anthony Tonns, UNIX Administrator - atonns at mail.ivillage.com 

-----Original Message-----
From: Jan van den Berg [mailto:j.vandenberg at cheesecrispies.com]
Sent: Saturday, May 10, 2003 8:36 PM
To: nagiosplug-help at lists.sourceforge.net
Subject: [Nagiosplug-help] FileHandles and Perl

Hi there,
I am developing a plugin in Perl that uses a file to store and write values.
The program runs just fine from the commandline. However now I tried to
integrate it in Nagios and it gave some problems. I found out that when the
interpreter hits the open statement the programs shuts down ie it doesnt do
anything, and Nagios returns a Critical without any data. Anything in front
of this statement works but after it doesn't.
#it stop right here
open(FILEWRITE, "< counter.dat") or die ("Can't open counter.dat");
@number = <FILEWRITE>;
I use this "open" call to get some data out of a file and use it for
comparison and later I open it again and write to it (depending).
This data is key to the program. My question is whether there is another way
around this. I need to open a file and read from it, but somehow ePN doesn't
allow this. Or am I overseeing something else here?

Jan van den Berg
PS reply to my email as I am not at work. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20030512/fb56f607/attachment.html>

More information about the Help mailing list