On Sun May 17 1998, Brian Rogers wrote:
> On Sun, 17 May 1998, Tony Nugent wrote:
> > On Sun May 17 1998, "Dave Mielke" wrote:
> > > [EMAIL PROTECTED] wrote:
> > >
> > > >Anyone out there want to rewrite chat to be less generic? I'd love to use
> > > >a program that is designed just for dialing modems which would report the
> > > >connect rate on syslog.
> >
> > You just might need to force chat to wait for a second or two (with a `\d')
> > in order to get it
>
> But in order to get that information, you have to use that -v option to
> chat, which generates all sorts of extra junk that I don't want in my
> logs.
There's more than one way to skin a cat! :-)
And I understand exactly where you are coming from - it is too verbose, and
the messages can really clutter up the syslog files.
There is a solution to this: tell syslogd to send local2.* messages to a
console rather than a file - either a specific tty (eg, /dev/tty8), or
/dev/console for the current active console.
You could even create a named pipe with mknod and get syslogd to send the
local2.* messages to that file, then when you start up pppd run a cat or
tail -f process on it in the background and what the messages go by. This
method is a bit messy and not as eloquent as sending to a tty, but it would
work. And there are probably other solutions too.
Actually, this is what I do on a regular basis... I get syslogd to send ALL
messages it gets to /dev/tty12 so that all I have to do to check the
current messages is to change to that tty (Alt-F12 or scroll-console to it)
and check them out. (Thanks to SVGATextMode, I'm running in a 160x100
textmode on a 17" monitor, so I can see lots of my logs :)
In /etc/syslog.conf I have...
*.*;kern.* /dev/tty12
In your specific case, you could do this to send all chat messages to your
current (non-xterm) console:
local2.* /dev/console
> I was thinking of a program which would be based on the source for
> chat. Instead of opening and parsing a text file, it would basically use
> a static script. Most of the rest of the code would remain unchanged.
Yes, but it can be done like I'm describing too - without touching the
chat sources.
> I have't looked into this myself because I'm lazy and disorganized. =-)
Say no more...
> I did once get around to untarring the source. Oh well. I just think
> there needs to be a program where you specify the number to dial, the
> number of redials allowed, and the time to pause between redials.
It already exists... it's called - `chat'. :)
> This program should also make SIMPLE reports to the system log. Chat's
> -v option reports way too much for just getting the baud rate.
Well, on that point I do have to agree. Cgat could be improved by
specifying levels of syslog verbosity.
But by specifying a tty rather than a file to send the chat syslog messages
to, then this might solve your "problem".
This conversation really belongs to the linux-ppp email list. Al Longyear
hangs around on that list, so if you have any suggestions about pppd and
chat then he's the one to talk to.
The alternative - as someone else suggested - is to learn how to write
`expect' scripts, which will also be able to do what you want and a lot
more besides!) But you probably are, as you say, too lazy to do this :-)
Try the syslogd trick - it works great!
Cheers
Tony .
[EMAIL PROTECTED] _--_|\ [EMAIL PROTECTED]
UNIX Systems Officer / *\ [EMAIL PROTECTED]
Faculty of Science \_.--._/ [EMAIL PROTECTED]
Uni of Southern Queensland v Toowoomba Australia
-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-