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. <span></span><br><br>On Monday, January 5, 2015, Horkan Smith <<a href="mailto:ale@horkan.net">ale@horkan.net</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Out of curiosity, did you look at using OMAPI and/or the dhcpctl API directly, instead of parsing the leases file?<br>
<br>
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.<br>
<br>
later!<br>
horkan<br>
<br>
On Mon, Jan 05, 2015 at 02:49:05PM -0500, James Sumners wrote:<br>
> For those interested, parsing the data in realtime, at least with Node.js,<br>
> is not viable. So this question is irrelevant.<br>
><br>
> On Thu, Dec 18, 2014 at 12:59 PM, James Sumners <<a href="javascript:;" onclick="_e(event, 'cvml', 'james.sumners@gmail.com')">james.sumners@gmail.com</a>><br>
> wrote:<br>
><br>
> > I need to monitor ISC's dhcpd.leases file so that I can feed new leases<br>
> > into a processor (which will log them to a database). My processor listens<br>
> > for data on a Unix socket . So I'll want to feed the data being appended to<br>
> > dhcpd.leases into that socket. But I also need it to still write to the<br>
> > leases file.<br>
> ><br>
> > Does anyone have any suggestions on how I might go about doing this? It's<br>
> > going to need to run non-stop.<br>
> ><br>
> > --<br>
> > James Sumners<br>
> > <a href="http://james.roomfullofmirrors.com/" target="_blank">http://james.roomfullofmirrors.com/</a><br>
> ><br>
> > "All governments suffer a recurring problem: Power attracts pathological<br>
> > personalities. It is not that power corrupts but that it is magnetic to the<br>
> > corruptible. Such people have a tendency to become drunk on violence, a<br>
> > condition to which they are quickly addicted."<br>
> ><br>
> > Missionaria Protectiva, Text QIV (decto)<br>
> > CH:D 59<br>
> ><br>
><br>
><br>
><br>
> --<br>
> James Sumners<br>
> <a href="http://james.roomfullofmirrors.com/" target="_blank">http://james.roomfullofmirrors.com/</a><br>
><br>
> "All governments suffer a recurring problem: Power attracts pathological<br>
> personalities. It is not that power corrupts but that it is magnetic to the<br>
> corruptible. Such people have a tendency to become drunk on violence, a<br>
> condition to which they are quickly addicted."<br>
><br>
> Missionaria Protectiva, Text QIV (decto)<br>
> CH:D 59<br>
<br>
> _______________________________________________<br>
> Ale mailing list<br>
> <a href="javascript:;" onclick="_e(event, 'cvml', 'Ale@ale.org')">Ale@ale.org</a><br>
> <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
> See JOBS, ANNOUNCE and SCHOOLS lists at<br>
> <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br>
<br>
--<br>
Horkan Smith<br>
678-777-3263 cell, <a href="javascript:;" onclick="_e(event, 'cvml', 'ale@horkan.net')">ale@horkan.net</a><br>
_______________________________________________<br>
Ale mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'Ale@ale.org')">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote><br><br>-- <br>James Sumners<br><a href="http://james.roomfullofmirrors.com/">http://james.roomfullofmirrors.com/</a><br><br>"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."<br><br>Missionaria Protectiva, Text QIV (decto)<br>CH:D 59<br>