[ale] Monitoring dhcpd.leases file?

James Sumners james.sumners at gmail.com
Mon Jan 5 20:53:12 EST 2015


I wasn't actually aware of the dhcptl API. I just read the man page, and I
don't think it would work for my use case. It seems to be more for
manipulating current entries that you already know about, or creating new
ones. It doesn't look like it would be a viable way to monitor all leases
being created.

On Monday, January 5, 2015, Horkan Smith <ale at horkan.net> wrote:

> Out of curiosity, did you look at using OMAPI and/or the dhcpctl API
> directly, instead of parsing the leases file?
>
> Failing that, I'd try using the 'tail -f' command or it's programmatic
> equivalent (I think it's seeking to the end of the file and just sleeping
> on feof(), but it's been awhile since I've looked.)  The version of 'tail'
> I've got (from GNU core utils) also supports a 'tail --follow=name' to
> handle file rotations.
>
> later!
>    horkan
>
> On Mon, Jan 05, 2015 at 02:49:05PM -0500, James Sumners wrote:
> > For those interested, parsing the data in realtime, at least with
> Node.js,
> > is not viable. So this question is irrelevant.
> >
> > On Thu, Dec 18, 2014 at 12:59 PM, James Sumners <james.sumners at gmail.com
> <javascript:;>>
> > wrote:
> >
> > > I need to monitor ISC's dhcpd.leases file so that I can feed new leases
> > > into a processor (which will log them to a database). My processor
> listens
> > > for data on a Unix socket . So I'll want to feed the data being
> appended to
> > > dhcpd.leases into that socket. But I also need it to still write to the
> > > leases file.
> > >
> > > Does anyone have any suggestions on how I might go about doing this?
> It's
> > > going to need to run non-stop.
> > >
> > > --
> > > 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
> > >
> >
> >
> >
> > --
> > 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
>
> > _______________________________________________
> > Ale mailing list
> > Ale at ale.org <javascript:;>
> > http://mail.ale.org/mailman/listinfo/ale
> > See JOBS, ANNOUNCE and SCHOOLS lists at
> > http://mail.ale.org/mailman/listinfo
>
>
> --
> Horkan Smith
> 678-777-3263 cell, ale at horkan.net <javascript:;>
> _______________________________________________
> Ale mailing list
> Ale at ale.org <javascript:;>
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>


-- 
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/ab78c3ed/attachment.html>


More information about the Ale mailing list