On Wed, Sep 16, 2009 at 01:06:24PM +0100, Michael Hanselmann wrote:
> 2009/9/16 Iustin Pop <[email protected]>:
> > Currently the output of cluster verify can be parsed for 'ERROR'
> > messages, but that is the only indication we get (error or no error). In
> > order to allow monitoring tools to separate different error conditions,
> > this patch introduces a new output format (“gnt-cluster verify
> > --error-codes”) that changes the output from human-friendly to
> > machine-friendly. In this mode, an error line changes from:
> >  ERROR: node node1: drbd minor 1 of instance inst1.is not active
> >
> > to:
> >  ERROR:ENODEDRBD:node:node1:drbd minor 1 of instance inst1 is not active
> >
> > i.e. the error message is a ‘:’-separated field, with ERROR in the first
> > place, the error code in the second, the object type (cluster, node,
> > instance) in the third, the name of the object (for nodes/instances) in
> > the fourth, and then the text message.
> >
> > The patch also removes some of the verbosity of the operation
> > (“Verifying instance X”, “Verifying node X”) since on big clusters these
> > informational messages can quickly fill up an entire screen. The
> > original behaviour can be restored via the ‘--verbose’ option.
> 
> I assume the output of a plain “gnt-cluster verify” stays the same as
> before to not break existing scripts. LGTM

No, not really. Before it did have the extra 'Verifying node $foo' for
all nodes in the cluster. So this patch makes the output shorter, and
because by default an error message doesn't follow 'Verifying node
$foo', not all messages contain the object they apply to, in effect
making possible to parse snippets of the output. Before one was not able
to interpret a line without context.

So no, it's not the same. But ERROR still exists, and that was pretty
much the only thing scripts could grep for.

Let me know if this is fine.

iustin

Reply via email to