To customize the cmon startup process, you can define the Command Line Arguments in a custom file, instead of hacking up the init script directly. The CMON init script (or systemd) will append all configuration options defined inside /etc/default/cmon
when starting up the cmon process and translates those options into command line arguments. For example:
$ cat /etc/default/cmon
RPC_PORT=9500
RPC_BIND_ADDRESSES="10.10.10.13,192.168.33.1,127.0.0.1"
EVENTS_CLIENT=http://127.0.0.1:9510
CLOUD_SERVICE=http://127.0.0.1:9518
In the example above, cmon will bind into those IP addresses and listen to port 9500 once started. If you filter out the ps
output from the server, you should get the following:
/usr/sbin/cmon --rpc-port=9500 --bind-addr='10.10.10.13,192.168.33.1,127.0.0.1' --events-client='http://127.0.0.1:9510' --cloud-service='http://127.0.0.1:9518