[asterisk-dev] Formatting options for CLI output

Paul Belanger paul.belanger at polybeacon.com
Fri Nov 9 08:39:30 CST 2012


On 12-11-08 06:26 PM, Nir Simionovich wrote:
> Hi All,
>
>
>
>    Well, per Michael's response on JIRA, I'm moving this discussion to the
> mailing list.
>
>
>
>    Here's the thing - almost anyone who's built a large scale Asterisk
> platform had used either
> Nagios or Icinga (or other) to monitor it. Normally, what you would to
> monitor Asterisk would
> be to either use the shell to issue 'asterisk -rx' commands and parse the
> output. Or connect
> to the manager, issue a similar command and parse the output again.
>
>
>
>    Now, while regular expressions do the job right - I believe that adding
> the ability to format
> the CLI output to a specific format can really be helpful. For example, on
> JIRA I've submitted
> a small patch that would enable to reformat the output from "sip show peers"
> only XML or
> JSON. This can now be easily be parsed from the outside using built-in
> scripting languages,
> such as PHP, Python, etc - thus, providing a new means of integrating with
> the Asterisk CLI
> at ease.
>
>
>
>    Initially, I'm thinking of adding this ability for the "summary" lines of
> various CLI commands.
> But later on, enabling it for each of the CLI commands - that produces some
> operational
> output. For example, imagine outputting the "core show channels concise"
> output into a JSON
> array - man, that would really be something.
>
>
>
>    Michael claims that the CLI is the wrong place to put it - I don't
> disagree with that. Question
> be, what would be the right place to put this kind of functionality?
>
>
As for the data part, why couldn't we build on:

*CLI> data get /asterisk/channel/sip/peers

-- 
Paul Belanger | PolyBeacon, Inc.
Jabber: paul.belanger at polybeacon.com | IRC: pabelanger (Freenode)
Github: https://github.com/pabelanger | Twitter: 
https://twitter.com/pabelanger



More information about the asterisk-dev mailing list