<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto">
I believe the Host Commands Library premium hook does this.
<div><br>
</div>
<div>Thanks,</div>
<div>Joseph B.<br>
<br>
<div><br>
On Aug 14, 2018, at 5:05 PM, Tom Gillman <<a href="mailto:Tom.Gillman@virtustream.com">Tom.Gillman@virtustream.com</a>> wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Howdy folks,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m trying to implement something with kea and I was hoping to pick the hive brain.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">What I’m trying to do is, on a request for DHCP, format a JSON query to a network service that will return a hostname and IP address. Then, generate a lease (using memfile) which then gets returned to the requesting client. I can do all
 that in a shell, which I was using the kea-hook-runscript hook library to do. The first part all works well. The problem comes in trying to update the memfile. The kea-hook-runscript calls an external shell to do the work, and blocks waiting on that shell
 to exit. Because it’s blocked, I can’t issue any lease commands through the control channel to do the updates I desire.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m not sure how to get around this, I feel like making the external callout non-blocking would introduce race conditions that would bite me later on. The only real solution I see is use a 3<sup>rd</sup>-party DB like mysql and handle the
 updates within the script, but that introduces overhead that I’m unwilling to do.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m not much of a programmer, so saying “Build your own hook library” really isn’t an option given the time constraints I’m under. I feel like I might eventually be able to it, but I simply don’t have the time.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Does anyone have any suggestions? Any constructive criticism is appreciated.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-Tom<o:p></o:p></p>
</div>
</div>
</blockquote>
<blockquote type="cite">
<div><span>_______________________________________________</span><br>
<span>Kea-users mailing list</span><br>
<span><a href="mailto:Kea-users@lists.isc.org">Kea-users@lists.isc.org</a></span><br>
<span><a href="https://lists.isc.org/mailman/listinfo/kea-users">https://lists.isc.org/mailman/listinfo/kea-users</a></span><br>
</div>
</blockquote>
</div>
</body>
</html>