Passive check pipe problem
Jim Mozley
jim.mozley at exponential-e.com
Fri Oct 3 10:43:11 CEST 2003
> > Should I implement some form of locking for the script that writes to
the
> > pipe? Or turn my script into a daemon that queues the messages with a
> > suitable interval between?
>
> If you have any two processes trying to frequently write to the same file,
> you're going to get this sort of overwrite.
>
> Yes, you do want to implement some sort of file locking. If the scripts
doing
> the writing are on the same machine as the command file (not accessed by
NFS)
> then a simple flock() call is enough. If you're accessing the command
file by
> NFS, since NFS doesn't handle file locking well, you'll have to implement
your
> own file locking mechanism... such as creating and checking for a .LOCK
file.
Thanks for this Matt, I'd reached the same conclusion by the end of
yesterday after consulting various perl/unix tomes. I intend to give flock a
go (all process run on the same server) and see if this helps things. I've
had more passive check work successfully, it seems the problem only occurs
when I have a few checks virtually simultaneously.
Thanks,
Jim
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list