rcbops/rcbops-maas — pull request #79 by git-harry (2014-08-14 16:05:11+00:00)
Title: Increase control on data printed

maas has some particular requirements regarding the output. This
commit attempts to address the following:

- Report an error if the script attempts to return more than 30 metrics.
While the agent does log this and does stop sending metrics the status
of the check remains available. This could cause issues if the metrics
aren't used with alarms

- Uncaught exceptions generate a status message.
Exceptions don't generate a status message unless one is explicitly
set. Sometimes an exception may only occur if run by the agent. Status
messages have a limit of 256 characters so the text is taken from the
tail of the traceback.

- Strip newlines from output
The agent treats each line separately. Multi-line output such as
exceptions needs to have newlines escaped so that it can be used in the
status message.

- Use the last status message
The agent uses the first status message it receives and logs any that
follow as duplicates. If an error happens after an okay status message
the message needs to be updated.