That's a bit tricky, probably impossible with the current code in an automated way, since the monitor defines inside the apache module (and all the others) don't allow to specify a specific nagios template.
I'd do something like this:
APPROACH 1 - Without changes to the apache module
Where you declare the apache class:
- disable automatic monitoring (be that for some nodes or all, you can define that via hiera or top scope variables)
- Add a custom monitor::process (or monitor::port) define where you explicitly pass the template param (which is not used in the apache module) and the apache relevant params.
APPROACH 2 - Changing the apache module (as you guessed)
- Add to the apache class a parameter to specify the template to use for monitoring
- Add the 'template' parameter to the monitor:: defines in the apache class and pass to it the value of the parameter you added to the apache class
Hope this helps,
al