incrond would definitely work in a normal case; however, to further
complicate things, the project target is an embedded platform
(OpenWrt-based), so adding additional tools is less-desirable.

We could certainly write a wrapper around monit -- but if auto-reload /
inotify-based events are valuable to others, we'd rather incorporate it.

Best,
Eric






On Sat, May 16, 2020 at 12:53 PM Phil Townes <[email protected]> wrote:

> Have a look at incrond
>
> It monitors for file system events, and performs configured actions when
> it detects a new file, or a file write being closed.
>
> Best,
> Phil
>
>
> On Sat, 16 May 2020, 1:25 am Eric Montellese, <[email protected]> wrote:
>
>> Greetings Monit Community!
>>
>> I'm working on a project that would like the ability to re-load the monit
>> configuration automatically when it changes.
>>
>> In the simplest case, this result can be produced with a monit rule that
>> sends SIGHUP to the monit process whenever the main monit configuration
>> file changes, for example:
>>
>> check file monit_config with path /path/to/monitrc
>>
>>      if changed checksum then exec "/usr/bin/killall -s SIGHUP monit"
>>
>> 1.  As a preliminary question -- can you see an issue with this pattern?
>>
>> It does seem to be working as expected.  However, the intended design is
>> to have the main monit configuration file call
>>
>> include /path/to/monit.d/*
>>
>> and to allow third parties to add or change files in this directory.
>>
>> 2.  Is there an existing way to check for changes (and additions and
>> deletions) to any file within a directory (it does not appear to be baked
>> in).  If not, is there a standard way that this has been accomplished by
>> others?  I can see a number of possible solutions.  (A script to generate a
>> checksum of all files, a separate application that uses inotify and sets a
>> flag, etc)
>>
>> 3.  Would there be interest by the community in taking a patch that
>> allows the option to automatically re-load the configuration files if they
>> change.  Somethilng like a "set autoreload" in the config file which would
>> trigger monit to monitor it's own configuration?
>>
>> 4.  Would there be interest by the community in a patch that allows
>> watching a given directory for any changes?
>>
>> Best Regards,
>> Eric
>>
>

Reply via email to