[Nagiosplug-devel] tip for plugin development and temp files
Matthieu Fournet
fournet.matthieu at gmail.com
Wed Dec 28 22:10:07 CET 2011
Sure (thanks for the tip, anyway), but you may know that Nagios allows
plugins to be written in any language, not only C.
My point was just to warn plugin developers about concurrent plugin
executions and colliding temp files, and suggesting a basic way to
circumvent this. Yours looks better than mine (and I googled for methods to
do this in PERL, which is the language I use for plugin development, I'll
consider updating my plugins), but this questions plugins portability and
the need to install PERL libraries...
Anyway, thanks for your rude welcome to this mailing list. I just wanted to
warn about a stupid bug I made lately where 2 concurrent executions of my
plugin were using the same temp file. Leave the documentation as is, and
expect no more comments from me.
Regards
Matthieu
On Wed, Dec 28, 2011 at 2:22 PM, Ferenc Wagner <wferi at niif.hu> wrote:
> Matthieu Fournet <fournet.matthieu at gmail.com> writes:
>
> > I'd like to add my 10 cents to the plugins developer guidelines (at
> section
> > "3.3. Don't make temp files unless absolutely required",
> > http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN254),
> > regarding the use of temporary files.
> > [...]
> > So my advice would be to name temp files like :
> >
> > tmp_[plugin_name]_[timestamp]
>
> Libc provides the mkstemp() family and tmpfile() for this purpose. I
> think you'd be better off using those instead of inventing own methods.
> --
> Regards,
> Feri.
>
>
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
> _______________________________________________________
> Nagios Plugin Development Mailing List
> Nagiosplug-devel at lists.sourceforge.net
> Unsubscribe at
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
> ::: Please include plugins version (-v) and OS when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nagios-plugins.org/archive/devel/attachments/20111228/ff17f423/attachment.html>
More information about the Devel
mailing list