Table of Contents
Prosody comes bundled with a mod_admin_telnet plugin. Enabling this plugin starts a telnet console to let you communicate with a running Prosody instance. The console is very powerful, and enables you change things without restarting the server.
Supplied commands make it easy to load, unload and reload modules, show client to server and server to server connections and much more.
Using the advanced mode allows for easy debugging of Prosody at runtime also.
To use any of these commands you need to have the module "admin_telnet" in your config file. You connect to the console by executing:
telnet localhost 5582
To load a module on all hosts, simply run:
If you only want to load it on a single host, perhaps example.org:
Quite often after editing and reloading the server configuration, you will want to reload a module to have the changes take effect.
Let's reload the pep module on all hosts:
Too personal? Let's unload pep just from example.com:
Check if a module is loaded
> modulemanager.is_loaded("host", "module")
Client (c2s) commands
Show current client connections on all hosts:
Show current client connections only on a specific host:
Close a user's session. The supplied JID may either be 'bare' (ie. firstname.lastname@example.org) to close all connections for that account or 'full' (ie. email@example.com/Office) to close only that session.
Show all secure (encrypted) connections.
Show all insecure (unencrypted) connections.
Server-to-server (s2s) commands
Show current s2s connections on all hosts.
Show current s2s connections on a specific host.
Close an s2s connection.
For example to close a connection from example.org to jabber.org:
Begin shutting down the server. An optional reason can be sent to all connections when they are closed to tell them why the server is stopping.
Report for how long the server has been running.
Report the version of the running server.
Reload the server's configuration file. Note that not all changes may take effect, for example you may need to reload affected modules.
List all the hosts currently configured (but not necessarily enabled) for the server.
Activates a given host. If changes have been applied to the config you may need to reload it.
Deactivates a given host.
Note: This is new in 0.9
Fetches the room object. Not very useful by itself, but has some useful methods.
Shows what affiliation
jid has in the room.
muc:room(room):set_affiliation(actor, jid, affiliation)
Sets affiliation for
jid in the room. Pass `true` as first argument. Possible values for affiliation are
"outcast" (banned) and
nil (no affiliation).
Shows what role the user with nickname
nick has in the room.
Kicks everyone from the room and removes it. Note: You need to call
:save(true) afterwards in order to purge the room completely.
Commits the room to storage. Passing
true as argument ensures that non-persistent rooms are removed.
Note: 0.9 and above.
Create the specified user account.
Set the password for the specified user account.
Permanently remove the specified user account.
List users on the specified host, optionally filtering with a pattern.
Leaving the console
Type either 'bye' or 'quit' to end the console session.
The console can also be used to access server internals at runtime, this can be done by prefixing a line with the '>' character. For example:
> hosts | Result: table: 0x80dffe0
This is most useful to those debugging or otherwise familiar with Prosody's internals.