I want to develop a plugin which detects changes in (some) of a command's output.
For this of course the plugin needs to remember the previous (one or more) results.
Is there a convention where a plugin should store such info?
local storage for plugins
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: local storage for plugins
A lot of plugins use files in /tmp/
However for those operating systems that dump /tmp/ on a reboot, /var/tmp/ is a better location.
It all depends on how easy or complicated you want to make things.
However for those operating systems that dump /tmp/ on a reboot, /var/tmp/ is a better location.
It all depends on how easy or complicated you want to make things.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: local storage for plugins
Ok. I had played with the thought of using /var/spool or such...
/var/tmp is really for temp files, which are not intended to survive across
calls to the same program, so I consider that less of an option...
/var/tmp is really for temp files, which are not intended to survive across
calls to the same program, so I consider that less of an option...
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: local storage for plugins
Certainly a matter of not only your preference but the reason for the output. If it is simply to measure a rate of change then /tmp should be fine as it will only take 1 iteration of the check to rebase the local storage location. In situations where you're watching for changes that should never occur though you are right, a custom location under var would be more appropriate. There are no documented best practices, feel free to choose the location that suits you and your application best.