|
|
|
date: Thu, 17 Sep 2009 10:23:55 +0000 (UTC),
group: uk.net.providers.aaisp
back
P660HW-T1 firewall and syslog
I have knocked up a cgi perl script, that could be run stand alone, to
process the P660's syslog records.
It looks like this http://www.deezee.org/firelog.html
If there is any interest I will tart it up a bit, ie put in some
comments, and upload it.
--
Regards
Dave Saville
date: Thu, 17 Sep 2009 10:23:55 +0000 (UTC)
author: Dave Saville lid
|
Re: P660HW-T1 firewall and syslog
Dave Saville wrote:
> I have knocked up a cgi perl script, that could be run stand alone, to
> process the P660's syslog records.
>
> It looks like this http://www.deezee.org/firelog.html
>
> If there is any interest I will tart it up a bit, ie put in some
> comments, and upload it.
I'm interested, at all sorts of levels:
I occasionally try to learn perl, but rarely find a program that does
something that interests me.
The output from the router log is interesting
I'm interested in communicating with my router programmatically.
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
date: Thu, 17 Sep 2009 19:30:53 +0100
author: Swifty
|
Re: P660HW-T1 firewall and syslog
On Thu, 17 Sep 2009 10:23:55 +0000 (UTC), Dave Saville wrote:
> I have knocked up a cgi perl script, that could be run stand alone, to
> process the P660's syslog records.
Looks interesting, would it work with a P660R-61C? I'm not sure that
has a syslog but then I've not really looked.
I've got one that extracts:
IP Address: 172.16.20.1
Speed
Inter Fast Noise Atten
Down 5280 0 6 43
Up 448 0 6 22
As it's a damn site quicker to click ona favourite than login to the
router and navigate to the little pop-up system status.
It also gnuplot to draw a graph of carrier frequency v symbols:
http://www.flickr.com/photos/allsorts-60/3929427325/
The big dip at 277kHz is part of the ADSL spec but can I find details
or a reference on that now? Can I f...
--
Cheers
Dave.
date: Thu, 17 Sep 2009 23:26:57 +0100 (BST)
author: Dave Liquorice
|
Re: P660HW-T1 firewall and syslog
On Thu, 17 Sep 2009 22:26:57 UTC, "Dave Liquorice"
wrote:
> On Thu, 17 Sep 2009 10:23:55 +0000 (UTC), Dave Saville wrote:
>
> > I have knocked up a cgi perl script, that could be run stand alone, to
> > process the P660's syslog records.
>
> Looks interesting, would it work with a P660R-61C? I'm not sure that
> has a syslog but then I've not really looked.
Yes it has - but the format of the message is different. I had one up
to a week or so ago so I *should* be able to find the old version in
my backups somewhere. Note that the dispalyed page is not quite so
informative as the one I gave the link to. I will have a poke around -
watch this space :-)
--
Regards
Dave Saville
date: Fri, 18 Sep 2009 08:09:11 +0000 (UTC)
author: Dave Saville lid
|
Re: P660HW-T1 firewall and syslog
On Thu, 17 Sep 2009 18:30:53 UTC, Swifty
wrote:
> Dave Saville wrote:
> > I have knocked up a cgi perl script, that could be run stand alone, to
> > process the P660's syslog records.
> >
> > It looks like this http://www.deezee.org/firelog.html
> >
> > If there is any interest I will tart it up a bit, ie put in some
> > comments, and upload it.
>
> I'm interested, at all sorts of levels:
>
> I occasionally try to learn perl, but rarely find a program that does
> something that interests me.
>
> The output from the router log is interesting
>
> I'm interested in communicating with my router programmatically.
>
As far as I am aware you would either have to pretend to be a browser
and "screen scrape" the returned page or script a telnet session using
something like "expect".
--
Regards
Dave Saville
date: Fri, 18 Sep 2009 08:11:03 +0000 (UTC)
author: Dave Saville lid
|
Re: P660HW-T1 firewall and syslog
Dave Saville wrote, On 18/09/09 09:11:
> On Thu, 17 Sep 2009 18:30:53 UTC, Swifty
> wrote:
>
>> Dave Saville wrote:
>>> I have knocked up a cgi perl script, that could be run stand alone, to
>>> process the P660's syslog records.
>>>
>>> It looks like this http://www.deezee.org/firelog.html
>>>
>>> If there is any interest I will tart it up a bit, ie put in some
>>> comments, and upload it.
>> I'm interested, at all sorts of levels:
>>
>> I occasionally try to learn perl, but rarely find a program that does
>> something that interests me.
>>
>> The output from the router log is interesting
>>
>> I'm interested in communicating with my router programmatically.
>>
>
> As far as I am aware you would either have to pretend to be a browser
> and "screen scrape" the returned page or script a telnet session using
> something like "expect".
>
The module WWW::Mechanize, certainly available for perl but probably
many other languages, takes away all the hard work of browser emulation.
--
Tony Firshman
<firstname>@<surname>.co.uk
date: Fri, 18 Sep 2009 11:33:00 +0100
author: Tony Firshman
|
Re: P660HW-T1 firewall and syslog
Dave Liquorice wrote:
> On Thu, 17 Sep 2009 10:23:55 +0000 (UTC), Dave Saville wrote:
>
>> I have knocked up a cgi perl script, that could be run stand alone, to
>> process the P660's syslog records.
>
> Looks interesting, would it work with a P660R-61C? I'm not sure that
> has a syslog but then I've not really looked.
>
I wrote this expect script for the Zyxel P660R and I also have one the
Billion 5200S if anyone is interested.
You will need to edit your password and log file location.
Bob Brewer
--------------------------------------------------------------------------------
#!/usr/bin/expect -d
#zyxel_stats
#records adsl stats from Zyxel P660R router.
#set password and logfile (rfile) as required
# rwb - 13/10/08
set host "192.168.1.1"
set login ""
set passwd "password"
set rfile "foo.log"
set prompt "\r\nras>"
set prenear "\u001b7\r\n"
set postnear "\r\nras>"
set prefar "\u001b7\r\n"
set postfar "tone 32"
set prechandata
"\u001b7\u001b7\u001b7\u001b7\u001b7\u001b7\u001b7\u001b7\u001b7\u001b7\u001b7\u001b7\u001b7\u001b7\u001b7\u001b7\u001b7"
set postchandata "\r\n\rras>"
set fp [open $rfile a]
set count 0
spawn telnet
expect "telnet>"
send "open $host\r"
expect "word: "
send "$passwd\r"
expect "Menu"
send "24\n"
expect "Number:"
send "8\r\n"
expect $prompt
#
while {$count < 29} {
puts $fp "date:[clock format [clock seconds] -format {%d/%m/%Y-%H.%M.%S}]"
send "wan\ adsl\ linedata\ near\r"
expect -re "($prenear)(.*)($postnear)"
puts $fp $expect_out(2,string)
send "wan\ adsl\ linedata\ far\r"
expect -re "($prefar)(.*)($postfar)"
puts $fp $expect_out(2,string)
send "wan\ adsl\ chandata\r"
expect -re "($prechandata)(.*)($postchandata)"
puts $fp $expect_out(2,string)
puts $fp end:\n
set count [expr $count+1]
sleep 30
}
close $fp
send "\r"
expect $prompt
send "exit\r"
expect "HMenu"
send "99\r\n"
date: Fri, 18 Sep 2009 10:41:54 +0100
author: Bob
|
Re: P660HW-T1 firewall and syslog
I have uploaded two versions of the script. For the P660R-61C and the
P660HW
If anyone has a Zyxel with yet another format for the syslog files if
you send me an extract I will see if I can make it work for that also.
Scripts and working email here:
http://www.deezee.org/
--
Regards
Dave Saville
date: Fri, 18 Sep 2009 18:25:29 +0000 (UTC)
author: Dave Saville lid
|
Re: P660HW-T1 firewall and syslog
On Fri, 18 Sep 2009 08:11:03 +0000 (UTC), Dave Saville wrote:
>> I'm interested in communicating with my router programmatically.
>
> As far as I am aware you would either have to pretend to be a browser
> and "screen scrape" the returned page or script a telnet session using
> something like "expect".
My script uses telnet the Net::Telnet perl module to get the
information out of the router.
--
Cheers
Dave.
date: Sat, 19 Sep 2009 10:41:55 +0100 (BST)
author: Dave Liquorice
|
Re: P660HW-T1 firewall and syslog
On Fri, 18 Sep 2009 18:25:29 +0000 (UTC), Dave Saville wrote:
> I have uploaded two versions of the script. For the P660R-61C and the
> P660HW
Thanks. Now all I have to do is to kick the router into talking to my
servers syslogd (and possibly the syslogd listening...).
--
Cheers
Dave.
date: Sat, 19 Sep 2009 13:30:47 +0100 (BST)
author: Dave Liquorice
|
Re: P660HW-T1 firewall and syslog
On Fri, 18 Sep 2009 18:25:29 UTC, "Dave Saville"
<dave@invalid.invalid> wrote:
> I have uploaded two versions of the script. For the P660R-61C and the
> P660HW
>
> If anyone has a Zyxel with yet another format for the syslog files if
> you send me an extract I will see if I can make it work for that also.
> Scripts and working email here:
>
> http://www.deezee.org/
>
Have slightly modified both scripts as I spotted there was a bit of
development/debug code left in both. Have also changed the "All seen
ports" to show counts.
Same location.
--
Regards
Dave Saville
date: Wed, 23 Sep 2009 10:07:46 +0000 (UTC)
author: Dave Saville lid
|
|
|