The mgrctl utility is used to perform operations on the control panel and invoke its functions from the command line. By default, it is located at /usr/local/mgr5/sbin/mgrctl.
Syntax
/usr/local/mgr5/sbin/mgrctl [-m <manager>] [-u | -i [lang=<language>] | -l | [[-o <output format>] [-R | <funcname> [[<param>=<value>] ...]] [[-e <param>=$<ENV_NAME>] ...]]]
Where:
-m— specifies the control panel to which the command applies. After the key, specify the short name of the panel:core— COREmanager;billmgr— BILLmanager;
-i— displays brief information about all available panel functions. If a specific <funcname> is provided, it shows brief information about that function’s parameters. If the lang parameter is specified, the information is displayed in the selected language <language>. Default value:en;-o— output format. Available values:text,xml,devel,json. Default:text;-l— suspends the control panel. The panel is stopped by calling the exit function. Restarting the panel is blocked;-u— resumes operation of a panel previously suspended with the-lflag;
If COREmanager is suspended, BILLmanager on the server is also suspended. After COREmanager resumes, other panels on the server will automatically resume. However, if both COREmanager and BILLmanager are suspended, resuming COREmanager will not automatically resume BILLmanager.-R— restarts the control panel before executing the function.- <
funcname> — function name; - <
param>=<value> — function parameter and its value;
- <
-e =$— parameters passed via environment variables.
Passing parameters via environment variables
This feature is available in COREmanager version 5.325 and later.
To pass sensitive data as mgrctl parameters, use environment variables. To do this, run the utility with the following parameter:
-e '<param>=$<ENV_NAME>'Explanation
Include the
$ symbol before the environment variable name and enclose the entire argument =$ in single quotes.Password passing example
To pass a password:
-
Set the password value in the
SECRET_PASSWORDenvironment variable:export SECRET_PASSWORD=secret -
Create an FTP user in BILLmanager:
/usr/local/mgr5/sbin/mgrctl -m billmgr ftp.user.edit name=ftpuser home=/ owner=www-root -e 'passwd=$SECRET_PASSWORD' sok=ok
Explanation
Usage examples
General examples
Shut down the platform
/usr/local/mgr5/sbin/mgrctl -m <manager> exit
List all available functions
/usr/local/mgr5/sbin/mgrctl -m <manager> -i
List parameters of a specific platform function
/usr/local/mgr5/sbin/mgrctl -m <manager> -i funcname lang=ru
BILLmanager examples
Suspend tariff plan
/usr/local/mgr5/sbin/mgrctl -m billmgr pricelist.suspend elid=<id>Explanation
Restart BILLmanager
/usr/local/mgr5/sbin/mgrctl -m billmgr exitAdd message to ticket
/usr/local/mgr5/sbin/mgrctl -m billmgr 'ticket.edit' name=theme message=text plid=ID elid=ID sok=ok su=adminExplanation
Get list of tariffs
/usr/local/mgr5/sbin/mgrctl -m billmgr pricelistExplanation
Useful tips
Related topics:
En
Es