Thursday, June 4, 2009

Re: [BLUG] Grepping the output from the Asterisk console

Its complaining because there are color escape sequences in the
asterisk -r output. I'd recommend greping from /var/log/asterisk/full
or from wherever your full logging is done. If you really need to grep
the output from asterisk -r, then pass it through the strings program
like this:

tail -f /tmp/asterisk_output.txt | strings | grep <pattern>

strings will strip binary data from stdout.


As for Asterisk, just curious what kind of setup you have. Are you
still using POTS lines into the asterisk box or do you have a PRI line
or anything like that? At Suso we have two POTS lines going into a 4
port Rhino card and it works pretty well. Sometimes we have trouble with
echoing, but I think that's because of some settings on our Linksys IP
phones.

On Thu, Jun 04, 2009 at 12:09:20PM GMT, Kirk Gleason [kgleason@gmail.com] said the following:
> Does anyone out there know of a way to feed the output from "asterisk -r" to
> stdout so that I can grep it for certain events? I was trying to
> troubleshoot a problem yesterday, and it would have been extremely.
>
> I did try:
>
> on screen 1
> asterisk -r > /tmp/asterisk_output.txt
>
> on screen 2
> tail -f /tmp/asterisk_output.txt | grep <pattern>
>
> but whenever a pattern was matched (or so I suspect), grep would complain
> about the source being a binary file.
>
> --Kirk

> _______________________________________________
> BLUG mailing list
> BLUG@linuxfan.com
> http://mailman.cs.indiana.edu/mailman/listinfo/blug


--
Mark Krenz
Bloomington Linux Users Group
http://www.bloomingtonlinux.org/
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

No comments: