<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 5, 2015 at 5:40 PM, chip <span dir="ltr"><<a href="mailto:chip.gwyn@gmail.com" target="_blank">chip.gwyn@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Give this a shot, see if it gets close to kinda what you're wanting:<div><br></div><div><a href="http://pastebin.com/mi168bYi" target="_blank">http://pastebin.com/mi168bYi</a><br></div><div><br></div><div>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.</div><div><br></div><div>(code copied from <a href="http://code.activestate.com/recipes/157035-tail-f-in-python/" target="_blank">http://code.activestate.com/recipes/157035-tail-f-in-python/</a> )</div><div><br></div><div>--chip</div></div><div class="gmail_extra"><div><div class=""><br><div class="gmail_quote">On Mon, Jan 5, 2015 at 5:24 PM, Scott Bragg <span dir="ltr"><<a href="mailto:walkingbear@gmail.com" target="_blank">walkingbear@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>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. <br><br></div>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. <br><span><font color="#888888"><br></font></span></div><span><font color="#888888">Scott Bragg</font></span></div></blockquote></div></div></div></div></blockquote></div><br>It's probably easier if I just show you what I wrote -- <a href="https://github.com/jsumners/dhcpd-lease-tracker">https://github.com/jsumners/dhcpd-lease-tracker</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">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.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I really wish Kea[1] were ready for production, but that's just not the case.</div><div class="gmail_extra"><br></div><div class="gmail_extra">[1] -- <a href="http://kea.isc.org/wiki">http://kea.isc.org/wiki</a><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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</div>
</div></div>