mon: Add publish/subscribe capabilities to the log monitor and status cmd.

This patch allows us to stir away from the monitor's observer mechanism,
by using instead the already existing publish/subscribe mechanism.
We follow the log levels used by the log monitor, and will recognize any
one of the following subscriptions: 'log-error' (higher priority),
'log-warn', 'log-sec', 'log-info' and 'log-debug' (lowest priority).

Also, add a new 'status' command to the monitor, which may be invoked by
any client (such as the ceph tool), and which shall return the status of
the various cluster components (osdmap, pgmap, ...).

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
cephtool: Slight rework and pub/sub log support.

We reworked the code a bit to accommodate the introduction for the log
monitor's publish/subscribe mechanisms. With this patch we no longer
depend on the observer's, and use instead the much broader approach of
subscribing to events. In our case, we will subscribe to log levels.
If the '-w'/'--watch' flag is defined, the tool will be subscribed to the
'log-info' level by default, unless one of the following flags are defined
(in which case the level will be changed accordingly): '--watch-debug',
'--watch-info', '--watch-sec', '--watch-warn' and '--watch-error'.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
src: get rid of the Observers throughout the code base.

This is a big patch that will remove all references to the observers
throughout the code, including a complete removal of the Observer-related
messages' source files.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
debian: don't package gceph

Signed-off-by: Sage Weil <sage@inktank.com>
ceph.spec: don't package gceph

Signed-off-by: Sage Weil <sage@inktank.com>
remove gceph

Signed-off-by: Sage Weil <sage@inktank.com>
Makefile: drop MMonObserve*

Signed-off-by: Sage Weil <sage@inktank.com>
mon: aesthetic changes to map change log entries

Signed-off-by: Sage Weil <sage@inktank.com>
cephtool: aesthetic change to ceph -w output

* no seq
* name, not ip addr

Signed-off-by: Sage Weil <sage@inktank.com>
mon: only log map state changes from primary

We still get noise after elections, but only from the winner.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: monmap first from 'status' command

Signed-off-by: Sage Weil <sage@inktank.com>
mon: fix the priority filter.

When a given log level L was specified, we would reply with all the
messages of "level L and below"; for instance, for a 'log-error' we would
present all the messages of level 'error', 'warn', 'sec', 'info' and
'debug'.

We shouldn't be doing it that way, so we just inverted the filter
condition. Now we show only 'L and above'; i.e., for a log level of
'log-warn', show only 'log-warn' and 'log-error'.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: fix a bug that was preventing us from subscribing to some log levels.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Merge remote-tracking branch 'gh/wip-mon-refactor'

Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
mon: move health check into helper function

Signed-off-by: Sage Weil <sage@inktank.com>
mon: include health in status

Signed-off-by: Sage Weil <sage@inktank.com>
added chi value of placement to output of test routine