How to Execute ejabberd_ctl Commands Under Windows

This page describes a method to use ejabberd_ctl commands under Microsoft Windows.

  1. Stop ejabberd if it is already running.

  2. Start ejabberd using the shortcut, so it opens a window where you can enter commands:

    Erlang (BEAM) emulator version 5.4.13 [threads:0]
    
    Eshell V5.4.13  (abort with ^G)
    (ejabberd@arfle)1>
  3. Now you can execute ejabberd_ctl commands with this syntax: put " around words, and separate them with commas. All command responses end with a number (0, 2) that indicates the error message, don't pay much attention to it. Examples:

    (ejabberd@arfle)1> ejabberd_ctl:process([]).                                   
    Usage: ejabberdctl node command
    
    Available commands:
      status                         get ejabberd status
      stop                           stop ejabberd
      restart                        restart ejabberd
      reopen-log                     reopen log file
      register user server password  register a user
      unregister user server         unregister a user
      backup file                    store a database backup to file
      restore file                   restore a database backup from file
      install-fallback file          install a database fallback from file
      dump file                      dump a database to a text file
      load file                      restore a database from a text file
      import-file file               import user data from jabberd 1.4 spool file
      import-dir dir                 import user data from jabberd 1.4 spool directry
      delete-expired-messages        delete expired offline messages from database
      vhost host ...                 execute host-specific commands
      user-resources user server     print user's connected resources
      connected-users-number         print a number of established sessions
      connected-users                list all established sessions
    
    Example:
      ejabberdctl ejabberd@host restart
    2
    (ejabberd@arfle)2> ejabberd_ctl:process(["user-resources", "badlop", "localhost]).
    Psi
    0
    (ejabberd@arfle)3> ejabberd_ctl:process(["vhost", "localhost"]).               
    Usage: ejabberdctl node vhost host command
    
    Available commands:
      registered-users  list all registered users
    
    2
    (ejabberd@arfle)4> ejabberd_ctl:process(["vhost", "localhost", "registered-user"]).
    badlop
    0
    (ejabberd@arfle)5> ejabberd_ctl:process(["vhost", "localhost", "stats", "online users"]).
    0
    0
  4. Once you executed the commands you wanted, stop ejabberd:

    (ejabberd@arfle)6> q().
    ok

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

How to execute ejabberdctl command

I recently installed 1.1.3 in Windows XP, and try to execute ejabberdctl command. In following the above instructions, the window was closed automatically after starting up ejabberd.

What can be done to get a window to execute ejabberdctl commands?? Thank you

The Windows installer

The Windows installer creates several icons on the Windows' Start menu, one of them is 'Debug console'.

Syndicate content