Mon, 28 Jan 2008, by [EMAIL PROTECTED]:

> I have an ADSL connection to the Internet. Recently there have been some
> problems with my phone line, which set me thinking. Is there a standard
> way to make a log of my internet status (i.e. connection or no
> connection?) Or perhaps it's already logged and I just need to extract it?
> 
> Cheers, Dave

Again, like problem Carlos had with password for an ssh session:
use Expect, at least, if your ADSL modem has a telnet interface.

#!/usr/bin/expect --

set timeout 60
spawn telnet st546
expect "Username :"
send "admin\r"
expect "Password :"
send "xxxxx\r"
expect "=>"
send "adsl info\r"
expect "=>"
send "exit\r"

=>adsl info
Modemstate            :  up
[..]

Put the script in a cron job and extract the data you want with grep.
With pyexpect and pylab you can make nice looking graphs.

Theo
-- 
Theo v. Werkhoven    Registered Linux user# 99872 http://counter.li.org
ICBM 52 13 26N , 4 29 47E.     +      ICQ: 277217131
SUSE 10.3                      +   Jabber: [EMAIL PROTECTED]
Kernel 2.6.22                  +   See headers for PGP/GPG info.
Claimer: any email I receive will become my property. Disclaimers do not apply.
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to