[ale] Monitoring dhcpd.leases file?

James Sumners james.sumners at gmail.com
Mon Jan 5 21:18:42 EST 2015


On Mon, Jan 5, 2015 at 5:40 PM, chip <chip.gwyn at gmail.com> wrote:

> Give this a shot, see if it gets close to kinda what you're wanting:
>
> http://pastebin.com/mi168bYi
>
> Just feed it the full pathname of the dhcpd.leases file and it'll watch
> the file and print out anything that's appended to it.  Change line 22 to
> do whatever it is you need with the output instead of printing it to a file.
>
> (code copied from
> http://code.activestate.com/recipes/157035-tail-f-in-python/ )
>
> --chip
>
> On Mon, Jan 5, 2015 at 5:24 PM, Scott Bragg <walkingbear at gmail.com> wrote:
>
>> I'd approach it by experimenting with inotifywait  and piping the diff of
>> the pre-change with post-change file.    I'm not at a system that I can
>> experiment with, but that's my first blush idea of which direction to go.
>>
>> OSSEC uses inotify, epoll and such for it's realtime monitoring and
>> reactive monitoring.   You could easily set up a trigger in OSSEC to do
>> what you want, but that'd be *extreme* overkill.
>>
>> Scott Bragg
>>
>
It's probably easier if I just show you what I wrote --
https://github.com/jsumners/dhcpd-lease-tracker

It certainly works. The problem is that my DHCPD server is updating the
leases files _constantly_, i.e. there is a helluva lot of DHCP traffic it
is handling. It's so much data that Node.js can't seem to handle it in real
time, at least not with the code I wrote.

I really wish Kea[1] were ready for production, but that's just not the
case.

[1] -- http://kea.isc.org/wiki


-- 
James Sumners
http://james.roomfullofmirrors.com/

"All governments suffer a recurring problem: Power attracts pathological
personalities. It is not that power corrupts but that it is magnetic to the
corruptible. Such people have a tendency to become drunk on violence, a
condition to which they are quickly addicted."

Missionaria Protectiva, Text QIV (decto)
CH:D 59
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20150105/997e56b4/attachment.html>


More information about the Ale mailing list