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;vmmgr— VMmanager KVM or Cloud;vemgr— VMmanager OVZ;dcimgr— DCImanager 5;dcimini— DCImanager 5 location;ipmgr— IPmanager;dnsmgr— DNSmanager.
-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, all control panels on the server are also suspended. After COREmanager resumes, other panels on the server will automatically resume. However, if both COREmanager and individual panels are suspended, resuming COREmanager will not automatically resume the other panels.-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
The FTP user management function is not enabled by default and requires the separate activation of the FTP module.
Usage examples
General examples
Shut down the control panel
/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 control panel function
/usr/local/mgr5/sbin/mgrctl -m <manager> -i funcname lang=ru
Examples for IPmanager
Statistics on allocated IP addresses
/usr/local/mgr5/sbin/mgrctl -m ipmgr permstat
En
Es