Mgrctl

From ISPWiki

Jump to: navigation, search

Contents

Introduction

The mgrctl utility is available in all our software products and is located in the /usr/local/ispmgr/sbin directory. You may use it to call ISPmanager functions from shell. We would recommend that you use our software functions via API, rather than via HTTP. You must have admin privileges (root privileges in ISPmanager).

Get a list of all mgrctl functions available:

/usr/local/ispmgr/sbin/mgrctl eventlist

Usage

The first argument is a function you want to call followed by the function parameters in the key=value format. For example:

/usr/local/ispmgr/sbin/mgrctl user

A list of users will be displayed

/usr/local/ispmgr/sbin/mgrctl user.edit elid=test

Get parameters of the test user.

/usr/local/ispmgr/sbin/mgrctl database su=test

Get a list of the test user databases.

Optional keys

Parameters:

-m <manager>      - name of the control panel's binary file that you want to call.
                    Default: ispmgr (regardless the software you are running). 
-o <output mode> - possible values: text, devel, xml. Default value - text.

Examples

Add domains in the "Domain management" module:

/usr/local/ispmgr/sbin/mgrctl -m ispmgr domain.edit name=example.com ip=8.8.8.8 ns="ns1.example.com ns2.example.com" sok=ok su=fly

Delete a www domain:

/usr/local/ispmgr/sbin/mgrctl -m ispmgr wwwdomain.delete elid=mary2.me  sok=ok

Create a www domain:

/usr/local/ispmgr/sbin/mgrctl -m ispmgr wwwdomain.edit domain=example.com alias=www.example.com docroot=auto owner=fly admin=admin@example.com autosubdomain=asdnone  ip=188.120.225.20 php=phpmod sok=ok

Update all the domains on external name servers:

for i in `/usr/local/ispmgr/sbin/mgrctl -m ispmgr domain | awk '{print $1}' | awk -F = '{print $2}'`; do /usr/local/ispmgr/sbin/mgrctl -m ispmgr domain.fix elid=$i;done
Was this helpful? Yes | No
Views
Personal tools