For what it's worth, here are some recent thoughts I've had on making mon less... monolithic.
It would be nice if we had perl modules for the following structures: Mon::Hostgroup Mon::Service Mon::Watch Then, we could break out the config file parser into its own module, something like "Mon::ConfigFile". This structure would make the mon scheduler code much cleaner and easier to maintain. It would also make it straighforward to write GUIs or web-based configuration tools. Having watches, services and hostgroups available as objects with their own APIs would allow us to extend Mon::Client to be able to change the mon configuration in-core. This would probably necessitate using some sort of tied object store as the back-end instead of the config file, but it would be a huge win, and it would be straightforward to switch out the back-end if we modularized the config file parsing code. Best of all, this functionality could be added gradually. It doesn't involve rewriting much code, just repackaging what's already there. The only disadvantage is that mon would be more complex to install, but this could be remedied by creating a CPAN bundle for mon modules.
