[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Modem connection speed



-----BEGIN PGP SIGNED MESSAGE-----

On Thu, 9 Sep 1999, Enrico Zini wrote:

> Opening "/var/log/connection_speeds"...
> chat:  Sep 09 16:23:04 CONNECT 50666/ARQ/V90/LAPM/V42BIS
> Closing "/var/log/connection_speeds".
> Opening "/var/log/connection_speeds"...
> chat:  Sep 09 10:55:38 CONNECT 50666/ARQ/V90/LAPM/V42BIS
> Closing "/var/log/connection_speeds".
> 
> Fine.
> 
> Now, what if I wanted it to be logged through syslogd, possibly without
> those Opening and Closing lines?

i do something similar, in the end i can just cat a file and get only the 
part of the line after CONNECT for the current session. You could easily
modify this to use logger to log to syslogd.

First, i use /var/log/ppp.connect as the report file. In
/etc/ppp/ip-up.d/, i have this script:

  #!/bin/sh

  CONNECTFILE="/var/log/ppp.connect"
  SPEEDFILE="/var/run/ppp-speed.$PPP_IFACE"

  cat $CONNECTFILE | perl -ne 'print /CONNECT (.*)/' > $SPEEDFILE
  echo -n > $CONNECTFILE

Now, /var/run contains the info that i want. I've even set up a script in
/usr/local/bin to extract just the speed from that line.

In your case, you could change "> $SPEEDFILE" at the end of line 6 to
"| logger -i -p local2.info" to log to syslogd. man logger for more info,
and check /etc/syslog.conf if local2 doesn't log to /var/log/ppp.log.


- -- 
  finger for PGP public key.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv

iQCVAwUBN9g/ir7M/9WKZLW5AQELkwP/W58c4sKOuhT0NHkgeLQawgUVWUg57nMp
lKRowaRWGcx23xQXCypbmg3b8iqrDhtustrB/WMVJ0pkb/xr1D+j7oRzEjMNAK+J
gSTXUkDYRjwh9Ia264YQX9Z64vUdrE0DhzHMTJqJuTa7Y8y0Z7i+NSrsK69r1gjH
UrrYygB29h8=
=NERa
-----END PGP SIGNATURE-----


Reply to: