<div dir="ltr">Thanks guys.<div>Here is my hook point and event.</div><div>---</div><div># hook points and events<br>case "$1" in<br><br> lease4_renew|lease4_recover|lease4_decline) <br><br> # Do nothing<br> echo $1<br> exit 0<br> ;;<br><br> leases4_committed)<br><br> echo $1<br> delete_record<br> add_record<br> ;;<br><br> lease4_expire |lease4_release)<br> echo $1<br><br> delete_record<br> ;;<br><br> *)<br> echo "Unhandled function call ${*}"<br> exit 123<br> ;;<br>esac<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 8, 2024 at 6:04 PM Darren Ankney <<a href="mailto:darren.ankney@gmail.com">darren.ankney@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I am not a developer, but I do know (loosely) what events these refer to:<br>
<br>
* lease4_recover (Kea has removed the lease from the lease database<br>
(post expire or release) things like lease affinity affect when this<br>
happens)<br>
* lease4_release (client sent a DHCPRELEASE packet)<br>
* lease4_decline (client sent a DHCPDECLINE packet)<br>
<br>
Thank you,<br>
Darren Ankney<br>
<br>
On Thu, Aug 8, 2024 at 3:55 AM luckydog xf <<a href="mailto:luckydogxf@gmail.com" target="_blank">luckydogxf@gmail.com</a>> wrote:<br>
><br>
> Actually I have tested lease4_expire, leases4_committed and lease4_renew already. They're easy to verify.<br>
> But the rest ones, I don't understand which scenarios can call them.<br>
> Thanks.<br>
><br>
> On Thu, Aug 8, 2024 at 3:52 PM luckydog xf <<a href="mailto:luckydogxf@gmail.com" target="_blank">luckydogxf@gmail.com</a>> wrote:<br>
>><br>
>> Thanks for your reply.<br>
>> Actually, I have read that docs already. However, I'm still puzzled. I'm going to add and remove DNS records against Samba with kea-dhcp hook points, which is the same as DDNS.<br>
>><br>
>> Here is the skeleton of my bash script. Not sure if the action for each hook point is right or not.<br>
>> While add_record and delete_record are public functions.<br>
>> ---<br>
>> # hook points<br>
>> case "$1" in<br>
>><br>
>> lease4_renew|lease4_recover )<br>
>><br>
>> # Do nothing<br>
>> echo $1<br>
>> exit 0<br>
>> ;;<br>
>><br>
>> leases4_committed)<br>
>><br>
>> echo $1<br>
>> delete_record<br>
>> add_record<br>
>> ;;<br>
>><br>
>> lease4_expire |lease4_release) #|lease4_decline)<br>
>> echo $1<br>
>><br>
>> delete_record<br>
>> ;;<br>
>><br>
>> *)<br>
>> echo "Unhandled function call ${*}"<br>
>> exit 123<br>
>> ;;<br>
>> esac<br>
>><br>
>><br>
>> On Thu, Aug 8, 2024 at 3:38 PM Francis Dupont <<a href="mailto:fdupont@isc.org" target="_blank">fdupont@isc.org</a>> wrote:<br>
>>><br>
>>> luckydog xf writes:<br>
>>> > I'm running External Hook Scripts now. From<br>
>>> > <a href="https://kea.readthedocs.io/en/kea-2.6.0/arm/hooks.html" rel="noreferrer" target="_blank">https://kea.readthedocs.io/en/kea-2.6.0/arm/hooks.html</a> there are the<br>
>>> > following hook points.<br>
>>><br>
>>> => the right documentation for writing hooks is not the ARM but<br>
>>> the developer guide and its Hook Developer's Guide section<br>
>>> <a href="https://reports.kea.isc.org/dev_guide/df/d46/hooksdgDevelopersGuide.html" rel="noreferrer" target="_blank">https://reports.kea.isc.org/dev_guide/df/d46/hooksdgDevelopersGuide.html</a><br>
>>><br>
>>> If you can't find all answers to your questions please come back to<br>
>>> this mailing list.<br>
>>><br>
>>> BTW names as LEASES4_AT0_HOSTNAME are about a particular hook library<br>
>>> running shell scripts described in its own section of the ARM<br>
>>> (Run Script Support for External Hook Scripts) which in fact just<br>
>>> exposes parameters which can be read from some callout points.<br>
>>><br>
>>> Regards<br>
>>><br>
>>> Francis Dupont <<a href="mailto:fdupont@isc.org" target="_blank">fdupont@isc.org</a>><br>
><br>
> --<br>
> ISC funds the development of this software with paid support subscriptions. Contact us at <a href="https://www.isc.org/contact/" rel="noreferrer" target="_blank">https://www.isc.org/contact/</a> for more information.<br>
><br>
> To unsubscribe visit <a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/kea-users</a>.<br>
><br>
> Kea-users mailing list<br>
> <a href="mailto:Kea-users@lists.isc.org" target="_blank">Kea-users@lists.isc.org</a><br>
> <a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/kea-users</a><br>
-- <br>
ISC funds the development of this software with paid support subscriptions. Contact us at <a href="https://www.isc.org/contact/" rel="noreferrer" target="_blank">https://www.isc.org/contact/</a> for more information.<br>
<br>
To unsubscribe visit <a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/kea-users</a>.<br>
<br>
Kea-users mailing list<br>
<a href="mailto:Kea-users@lists.isc.org" target="_blank">Kea-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/kea-users</a><br>
</blockquote></div>