[asterisk-dev] Formatting options for CLI output

Nir Simionovich nir.simionovich at gmail.com
Thu Nov 8 17:26:26 CST 2012


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? 

 

Kind Regards,

  Nir Simionovich

  GreenfieldTech

  (w) http://www.greenfieldtech.net <http://www.greenfieldtech.net/>   

  (p) +972-73-2557799        (MSN): nirs at greenfieldtech.net

  (m) +972-54-6982826      (GTALK): nir.simionovich at gmail.com

  (f) +972-73-2557202      (SKYPE): greenfieldtech.nir

                       (tungle.me <http://tungle.me/> ):
http://tungle.me/nirsimionovich 

logo2     cid:image001.jpg at 01CA5976.61329B80 


Disclaimer:
This e-mail is intended solely for the person to whom it is addressed and
may contain confidential or legally privileged information. Access to this
e-mail by anyone else is unauthorized. If an addressing or transmission
error has misdirected this e-mail, please notify the author by replying to
this e-mail and destroy this e-mail and any attachments. 
E-mail may be susceptible to data corruption, interception, unauthorized
amendment, viruses and delays or the consequences thereof. If you are not
the intended recipient, be advised that you have received this email in
error and that any use, dissemination, forwarding, printing or copying of
this email is strictly prohibited.

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121109/1898d346/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 4762 bytes
Desc: not available
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121109/1898d346/attachment-0002.jpeg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 5822 bytes
Desc: not available
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121109/1898d346/attachment-0003.jpeg>


More information about the asterisk-dev mailing list