On 22 Feb 2004 17:29:03 -0800, hiwa <(E-Mail Removed)> wrote:
> (E-Mail Removed) (David Efflandt) wrote in message news:<(E-Mail Removed)>...
>> On 22 Feb 2004 02:26:28 -0800, hiwa <(E-Mail Removed)> wrote:
>> > We have a commercial broadband router between an FTTH end and an home
>> > LAN. The broadband router acts as a DHCP/PPPoE client for ISP and as a
>> > DHCP server for the LAN. If I want to write a wrapper program for
>> > invoking a dynamic DNS service client which we want should be
>> > triggered by the ISP leased IP change, how could I intercept the
>> > change from my C or Java code as an event?
>> >
>> > Almost all of the existing dynamic DNS service client programs use
>> > polling with a fixed time interval for detecting the lease change. So,
>> > we can't use them at our specific needs, of which description might be
>> > out of context here.
(snip)
>
> Thanks David for your valuable info. As I am downright a newbie for
> networking and its management, may I ask couple more question?(which
> I'm afraid might be too obvious for you)
>
>> If your (undisclosed) router has any sort of remote logging, you could
>> monitor that (syslog or SNMP), or there are some router specific programs
>> that can actually log in and grab log info.
>
> (1)My router's config page has an input form:
>
> [log forwarding]
> syslog server : ______________________
>
> What should I write in the 'syslog server:' field? In other words,
> what should be my syslog server's address?
Usually the IP of something that accepts remote syslog, hopefully with a
static IP (in same network outside of DHCP assigned range) or that always
gets the same DHCP IP.
> (2)Currently, output from ps -ax has an entry:
>
> syslogd -m 0
Whatever launches syslogd may have to include the -r switch for remote
logging, unless you have an old syslogd before v1.3 (see man syslogd). If
you have a name for IP of router and the entire hostname.domain shows up
in logs, the domain can be stripped with -s domain switch. Since I am
running named chroot (so it cannot access /dev/log directly) and my local
domain is literally 'local', mine shows up in 'ps ax' as:
/sbin/syslogd -r -s local -a /var/lib/named/dev/log
Or it could be possible to write a Perl script that would listen on UDP
port 514 instead of enabling syslogd -r, but I have not tried that and do
not have an example of a udp server.
> Then, what should be the proper configuration for syslogd program for
> getting the log from the router? In other words, what should I write
> or do and where?
I am running SuSE 8.2, so in /etc/sysconfig/syslog I set:
SYSLOGD_PARAMS="-r -s local"
and it may have automatically set:
SYSLOGD_ADDITIONAL_SOCKET_NAMED="/var/lib/named/dev/log"
Make sure that any firewall is NOT blocking UDP port 514 from LAN.
In my case WAP11 (aplink.local) shows up in /var/log/messages like:
Dec 13 16:19:26 aplink Created syslog task. ^M
Dec 13 16:19:26 aplink System ready ... ^M
Dec 13 16:19:26 aplink System started ^M
Dec 13 16:19:26 aplink Wireless PC connected 00-04-E2-63-8B-3A^M
As far as monitoring that, once you figure out what you are looking for in
/var/log/messages, see 'perldoc -q tail'. And once that is working look
for 'daemonize' in 'perldoc perlipc' to fork it into the background.
--
David Efflandt - All spam ignored
http://www.de-srv.com/