Log host identifier
Narcis Garcia
informatica at actiu.net
Thu Oct 19 07:27:49 UTC 2017
Thank you;
Is there some way to get the label of the host definition instead of
having to add a hostname/fqdn/identifier to each host?
(such as "printer_1" here)
host printer_1 {
hardware ethernet 00:11:22:33:44:55;
fixed-address 172.16.20.201;
}
El 19/10/17 a les 09:12, Bill Shirley ha escrit:
> Add logging to your dhcpd.conf. Here is what I use:
> on commit {
> if static {
> set is-static = " --> STATIC";
>
> option dhcp-renewal-time = encode-int(43200 / 2, 32); #
> 43200 = 12 hours
> option dhcp-rebinding-time = encode-int(43200 * 7 / 8, 32);
> ddns-ttl = encode-int((43200 / 2) + 1, 32);
> } else {
> set is-static = "";
>
> option dhcp-renewal-time = encode-int(lease-time / 2, 32);
> option dhcp-rebinding-time = encode-int(lease-time * 7 / 8, 32);
> ddns-ttl = encode-int((lease-time / 2) + 1, 32);
> }
>
> log ( info,
> concat (
> "Host:", pick-first-value(option fqdn.hostname, option
> host-name, "(none)"), "=>", pick-first-value(config-option
> server.ddns-hostname, "(none)")
>
> ," VendorId:", pick-first-value(option
> vendor-class-identifier, "(none)")
>
> ," Lease:",
> pick-first-value(binary-to-ascii(10,32,"",encode-int(lease-time,32)),
> "(none)")
> ," Renewal:", pick-first-value(binary-to-ascii(10, 32, "",
> config-option dhcp-renewal-time), "(none)")
> ," Rebind:", pick-first-value(binary-to-ascii(10, 32, "",
> config-option dhcp-rebinding-time), "(none)")
>
> ," TTL:", pick-first-value(binary-to-ascii(10, 32, "",
> config-option server.ddns-ttl), "(none)")
>
> ," GIaddr:", pick-first-value(binary-to-ascii(10, 8, ".",
> packet(24,4)), "(none)")
> , is-static
> )
> );
> }
>
> Bill
>
>
> On 10/19/2017 3:00 AM, Narcis Garcia wrote:
>> isc-dhcp-server is currently logging in my system:
>> DHCPDISCOVER from 11:22:33:44:55:66 via eth0
>> DHCPOFFER on 172.16.20.201 to 11:22:33:44:55:66 via eth0
>> DHCPREQUEST for 172.16.20.201 from 11:22:33:44:55:66 via eth0
>> DHCPACK on 172.16.20.201 to 11:22:33:44:55:66 via eth0
>>
>> How can I make the service logs some name about that known client? (such
>> as "printer_1")
>>
>> Thanks.
>> _______________________________________________
>> dhcp-users mailing list
>> dhcp-users at lists.isc.org
>> https://lists.isc.org/mailman/listinfo/dhcp-users
>
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
More information about the dhcp-users
mailing list