[Nagiosplug-help] FileHandles and Perl

Jan van den Berg j.vandenberg at cheesecrispies.com
Sat May 10 17:39:06 CEST 2003


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>;
close 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?

Thanks,

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/20030510/f4a56f7b/attachment.html>


More information about the Help mailing list