Log Statement: How to log offered Lease Time?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Log Statement: How to log offered Lease Time?

iftech

Hello,

I am trying to log the Leasetime provided in the OFFER or ACK basically by using for instance 

log (info, concat (" test1:", pick-first-value(binary-to-ascii(10,32,"",option dhcp-lease-time), "(none)")));

but without success.

It looks like we cannot log info from an OFFER or an ACK ?

When using this

log ( info, concat( "MSGTYPE", binary-to-ascii (16,8,"^", option dhcp-message-type)));

I only see MSGTYPE1 or MSGTYPE3   never 2 and 4

is it possible to log info from an OFFER or an ACK ?

THANKS


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Log Statement: How to log offered Lease Time?

Niall O'Reilly
On 18 Jan 2018, at 7:52, [hidden email] wrote:

> It looks like we cannot log info from an OFFER or an ACK ?

Here's a snippet from my log file.

Jan 17 21:48:43 sock dhcpd: DHCPDISCOVER from 78:31:c1:ec:a2:c6 (MacBook-Pro) via 10.0.1.1
Jan 17 21:48:44 sock dhcpd: DHCPOFFER on 10.0.1.162 to 78:31:c1:ec:a2:c6 (MacBook-Pro) via 10.0.1.1
Jan 17 21:48:45 sock dhcpd: DHCPNETMON 43200 78:31:c1:ec:a2:c6 10.0.1.162 (--) dynamic
Jan 17 21:48:45 sock dhcpd: DHCPREQUEST for 10.0.1.162 (10.0.0.14) from 78:31:c1:ec:a2:c6 (MacBook-Pro) via 10.0.1.1
Jan 17 21:48:45 sock dhcpd: DHCPACK on 10.0.1.162 to 78:31:c1:ec:a2:c6 (MacBook-Pro) via 10.0.1.1

If this looks lke what you need, the recipe, thanks to Frank Sweetser, is here:
http://dhcp-users.isc.narkive.com/9xDkoWm2/successful-lease-event-trigger#post5

Best regards,
Niall O'Reilly

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

signature.asc (921 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Log Statement: How to log offered Lease Time?

iftech
In reply to this post by iftech
Hello,

I can see Discover,Offer,Request,Ack in my log
What i am referring to is the detailed logging options that you can collect by using log statement
ex: log ( info, concat( "MSGTYPE", binary-to-ascii (16,8,"^", option dhcp-message-type)));

those seems only to work on Incoming DHCP messages (Discover, Request)
but not on Outgoing Offer and Ack

thanks
yves
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Log Statement: How to log offered Lease Time?

Bill Shirley-2
I use:
on commit {
  log (info, concat (
  ...
    ,"  LeaseTime:", pick-first-value(binary-to-ascii(10, 32, "", encode-int(lease-time, 32)), "(none)")

Bill

On 1/22/2018 6:14 AM, [hidden email] wrote:
Hello,

I can see Discover,Offer,Request,Ack in my log
What i am referring to is the detailed logging options that you can collect by using log statement
ex: log ( info, concat( "MSGTYPE", binary-to-ascii (16,8,"^", option dhcp-message-type)));

those seems only to work on Incoming DHCP messages (Discover, Request)
but not on Outgoing Offer and Ack

thanks
yves
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Log Statement: How to log offered Lease Time?

Bob Harold

On Mon, Jan 22, 2018 at 9:17 AM, Bill Shirley <[hidden email]> wrote:
I use:
on commit {
  log (info, concat (
  ...
    ,"  LeaseTime:", pick-first-value(binary-to-ascii(10, 32, "", encode-int(lease-time, 32)), "(none)")

Bill


On 1/22/2018 6:14 AM, [hidden email] wrote:
Hello,

I can see Discover,Offer,Request,Ack in my log
What i am referring to is the detailed logging options that you can collect by using log statement
ex: log ( info, concat( "MSGTYPE", binary-to-ascii (16,8,"^", option dhcp-message-type)));

those seems only to work on Incoming DHCP messages (Discover, Request)
but not on Outgoing Offer and Ack

thanks
yves

In my experience that logs the "normal" lease time, not the actual lease time, which can be lower due to failover MCLT settings or other situations.  There is no way to get the actual lease time that is being sent, as far as I can tell.  I would love for that to be fixed.

-- 
Bob Harold



_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Log Statement: How to log offered Lease Time?

Bob Harold

On Jan 22, 2018 9:50 AM, "Bob Harold" <[hidden email]> wrote:

On Mon, Jan 22, 2018 at 9:17 AM, Bill Shirley <[hidden email]> wrote:
I use:
on commit {
  log (info, concat (
  ...
    ,"  LeaseTime:", pick-first-value(binary-to-ascii(10, 32, "", encode-int(lease-time, 32)), "(none)")

Bill


On 1/22/2018 6:14 AM, [hidden email] wrote:
Hello,

I can see Discover,Offer,Request,Ack in my log
What i am referring to is the detailed logging options that you can collect by using log statement
ex: log ( info, concat( "MSGTYPE", binary-to-ascii (16,8,"^", option dhcp-message-type)));

those seems only to work on Incoming DHCP messages (Discover, Request)
but not on Outgoing Offer and Ack

thanks
yves

In my experience that logs the "normal" lease time, not the actual lease time, which can be lower due to failover MCLT settings or other situations.  There is no way to get the actual lease time that is being sent, as far as I can tell.  I would love for that to be fixed.

-- 
Bob Harold

Someday I hope to try this solution:


-- 
Bob Harold


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users