[ejabberd] ejabberdctl patch of mnesia info

Badlop badlop at gmail.com
Sat Dec 22 01:10:52 MSK 2007


2007/12/21, Tsukasa Hamano <hamano at klab.org>:
> Hi,
> I'm writing a script to check mnesia replication that clustered
> ejabberd.
> And, I felt the need to ejabberdctl show mnesia:info/0 or
> mnesia:system_info/1. Therefore, I wrote a patch of ejabberdctl.

I improved a little the patch [1] and committed to SVN. It now allows:
 - mnesia <-- this calls mnesia:system_info(all)
 - mnesia info <--- this calls mnesia:info()
 - mnesia anythingelse <--- this calls mnesia:system_info(anythingelse)

And the help message shows:
  mnesia [info]                           show information of Mnesia system

Reasons for that change:
Most admins will usually try either:
 - mnesia
 - mnesia info
The experienced admins that know additional infokeys (learned from
erlang documentation) can request specific data with:
 - mnesia anythingelse


> % ejabberdctl ejabberd at host1 mnesia info

This remains the same in SVN:
% ejabberdctl ejabberd at host1 mnesia info


> % ejabberdctl ejabberd at host1 mnesia system_info running_db_nodes

This is a little shorter now:
% ejabberdctl ejabberd at host1 mnesia running_db_nodes


And if you forget the infokey you want, no need to check erlang
documentation: you can get all the keys. For example I do:

$ sudo ejabberdctl mnesia
[{access_module,mnesia},
 {auto_repair,true},
 {backup_module,mnesia_backup},
 {checkpoints,[]},
 {db_nodes,[ejabberd at localhost]},
 {debug,none},
 {directory,"/var/lib/ejabberd/db/ejabberd"},
 {dump_log_load_regulation,false},
  ...
 {use_dir,true},
 {core_dir,false},
 {no_table_loaders,2},
 {dc_dump_limit,4},
 {version,"4.3.5"}]

And now that I saw all the keys, I remember what I really want:
$ sudo ejabberdctl mnesia directory
"/var/lib/ejabberd/db/ejabberd"


[1] https://support.process-one.net/browse/EJAB-470

 ---


More information about the ejabberd mailing list