Administration Console

Metronome’s has an administration console which accessible locally via telnet, through it you can perform over-the-air tasks like reloading configuration, loading/reloading and unloading modules, activating and deactivating hosts and component, managing users etc.

To load the console you need to add admin_telnet between the list of enabled modules in the server global configuration:

modules_enabled = { …, “admin_telnet” }

The console will be accessible via telnet on the IPv4 loopback interface (localhost, 127.0.0.1) and by default listens on port 5582.
It will also have no additional security or authentication restrictions so make sure to protect it accordingly using iptables for example and make the telnet port accessible only by root, in the case multiple users have access to the system Metronome runs on:

 

iptables -A OUTPUT -d 127.0.0.1/32 -p tcp -m owner –uid-owner 0 -m tcp –dport 5582 -j ACCEPT
iptables -A OUTPUT -d 127.0.0.1/32 -p tcp -m tcp –dport 5582 -j REJECT –reject-with icmp-port-unreachable

After you have connected to the console, you can issue help to get a list of command sections and help section to get the relative list of available commands for that section, following are some brief usage examples:

config:reload()will reload the server configuration file and will cause the module which support auto reloading of configuration to automatically reload it (the others will require to be manually reloaded)

module:reload(“muc”) — will reload the MUC module loaded on all hosts

module:load(“pep”,”example.com”)will load the Personal Eventing Protocol module on the host example.com

module:unload(“pep”,”example.com”)will unload the Personal Eventing Protocol module on the host example.com

host:activate(“example.com”)enables the host example.com and starts serving it

host:deactivate(“example.com”)disables the host example.com and stops serving it

dns:purge() — purges Metronome’s dns cache

help dns — lists all available commands in the dns section

user:create(“user@example.com”, “pass”) — creates an user account on example.com with the relative password

user:password(“user@example.com”, “pass”) — changes user’s password on example.com

user:delete(“user@example.com”) — deletes user@example.com’s account

Additionally if you have Lua knowledge and understanding of Metronome internal environment, you can manipulate the server’s Lua environment directly by escaping the console sandbox by pre-pending the “>” character before typing a comand for example:

for host,session in pairs(hosts) do print(host,session) end

Will print the list of activated hosts and the host’s session table memory address reference, this allows to perform additional operations that could not be normally performed using the console commands (which still allows most common and also advanced server managing tasks to be completed). Although be warned that messing with the server environment internals directly without knowing what you’re doing could cause Metronome to stop working accordingly or even the server process to crash.