While rpc and rpcterms are decent they don't quite have the functionality I would like which is executing arbitrary calls against the running node. This adds an 'eval' command to the extended start script which calls nodetool. With it you can do things like
% myrel eval 'node()'
'myrel@dev'
% myrel eval 'io:format("~s\n",[[<<"hello">>,$\s,"world"]]).'
hello world
ok
% bin/myrel eval 'AppVersion = fun (App) -> [ {A, V} || {A,_,V} <- application:which_applications(), A =:= App ] end, [ AppVersion (A) || A <- [kernel, myrel ]]'
[[{kernel,"2.16.4"}],[{myrel,"0.1.0"}]]
While these examples are contrived, you can basically use this to run arbitrary code on the running node which is useful for troubleshooting, and system inspection.
While rpc and rpcterms are decent they don't quite have the functionality I would like which is executing arbitrary calls against the running node. This adds an 'eval' command to the extended start script which calls nodetool. With it you can do things like
While these examples are contrived, you can basically use this to run arbitrary code on the running node which is useful for troubleshooting, and system inspection.