- changed status to on hold
Variable expansion in control file
Issue #52
on hold
It would be great if the syntax of a control file would allow for variable expansion. This could make configuration less error prone and more elegant. For example:
check process slowLogger-1 with pidfile /monit/demo/monit/var/slowLogger-1.pid
start program = "/monit/demo/svcs/slowLogger.sh start /monit/demo/monit/var/slowLogger-1.pid 1"
stop program = "/monit/demo/svcs/slowLogger.sh stop /monit/demo/monit/var/slowLogger-1.pid"
This could be rewritten like this:
check process slowLogger-1 with pidfile $SL1_PID
start program = "$SL_CTL start $SL1_PID 1"
stop program = "$SL_CTL stop $SL1_PID"
Assuming that SL1_PID and SL_CTL are defined either in the control file or picked up from the environment as a fallback.
This would eliminate duplication and allow for more elegant syntax.
Do you see an issue or a risk associated with it?
Comments (4)
-
repo owner -
repo owner - changed component to 1. Monit
-
repo owner - changed component to Monit
-
repo owner - removed version
Removing version: 5.8.1 (automated comment)
- Log in to comment
This might be added in a later version. Or more likely, something like blocks or lists, as in
and ditto for for instance files
etc.
Variable definition might be useful, but it is unclear as tests tend to be specific and not much re-use is possible. Anyway, cleaning up, expanding and simplifying the config language is on our list.