Send dhcp-users mailing list submissions to
        dhcp-users@lists.isc.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/dhcp-users
or, via email, send a message with subject or body 'help' to
        dhcp-users-requ...@lists.isc.org

You can reach the person managing the list at
        dhcp-users-ow...@lists.isc.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of dhcp-users digest..."


Today's Topics:

   1. Build a custom log entry on a DHCPACK CentOS 6. (Mark Haney)
   2. Re: Build a custom log entry on a DHCPACK CentOS 6. (Bob Harold)
   3. Re: Build a custom log entry on a DHCPACK CentOS 6. (Mark Haney)


----------------------------------------------------------------------

Message: 1
Date: Fri, 26 May 2017 11:38:49 -0400
From: Mark Haney <mark.ha...@neonova.net>
To: dhcp-users@lists.isc.org
Subject: Build a custom log entry on a DHCPACK CentOS 6.
Message-ID:
        <CAMzGKZ9QXhjm=h1+ehjhqqb8fjbquza6gdvrxhozg2f+nsh...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

We've got a custom log entry created that's based on whether the
agent.circuit-id exists.  The problem is that the circuit-id gets included
in DHCPDISCOVER and DHCPOFFER, so we're getting duplicate custom messages
logged.

What we want to do it create this custom log file, with the circuit-id only
on the DHCPACK.  The log creation params are below.  We use this so that
customers can get a web interface view of the current leases.

Is there a way to do this with the latest CentOS 6 dhcpd package?

----
if exists agent.circuit-id
 {
        log (info, concat( "DHCPUSER:,", concat (suffix (concat ("0",
binary-to-ascii (16, 8, "", substring( hardware, 1, 1))),2), ":", suffix
(concat ("0", binary-to-ascii (16, 8, "",substring( hardware, 2, 1))),2),
":", suffix (concat ("0", binary-to-ascii(16, 8, "", substring( hardware,
3, 1))),2), ":", suffix (concat ("0", binary-to-ascii (16, 8, "",
substring( hardware, 4, 1))),2),":", suffix (concat ("0", binary-to-ascii
(16, 8, "", substring( hardware, 5, 1))),2), ":", suffix (concat ("0",
binary-to-ascii (16, 8, "", substring( hardware, 6, 1))),2)), ",IP:,",
binary-to-ascii (10, 8, ".", leased-address), ",CID:,", option
agent.circuit-id));
 }


-- 
[image: photo]
Mark Haney
Network Engineer at NeoNova
919-460-3330 <(919)%20460-3330> (opt 1) ? mark.ha...@neonova.net
<http://m...@neonova.net/>
www.neonova.net <https://neonova.net/>
<https://www.facebook.com/NeoNovaNNS/>  <https://twitter.com/NeoNova_NNS>
<http://www.linkedin.com/company/neonova-network-services>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.isc.org/pipermail/dhcp-users/attachments/20170526/d0b200b3/attachment-0001.html>

------------------------------

Message: 2
Date: Fri, 26 May 2017 14:56:36 -0400
From: Bob Harold <rharo...@umich.edu>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: Build a custom log entry on a DHCPACK CentOS 6.
Message-ID:
        <ca+nkc8c_q5h40vd5vgvw_cycvb-gncc3nz+rkv2por8vghv...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Fri, May 26, 2017 at 11:38 AM, Mark Haney <mark.ha...@neonova.net> wrote:

> We've got a custom log entry created that's based on whether the
> agent.circuit-id exists.  The problem is that the circuit-id gets included
> in DHCPDISCOVER and DHCPOFFER, so we're getting duplicate custom messages
> logged.
>
> What we want to do it create this custom log file, with the circuit-id
> only on the DHCPACK.  The log creation params are below.  We use this so
> that customers can get a web interface view of the current leases.
>
> Is there a way to do this with the latest CentOS 6 dhcpd package?
>
> ----
> if exists agent.circuit-id
>  {
>         log (info, concat( "DHCPUSER:,", concat (suffix (concat ("0",
> binary-to-ascii (16, 8, "", substring( hardware, 1, 1))),2), ":", suffix
> (concat ("0", binary-to-ascii (16, 8, "",substring( hardware, 2, 1))),2),
> ":", suffix (concat ("0", binary-to-ascii(16, 8, "", substring( hardware,
> 3, 1))),2), ":", suffix (concat ("0", binary-to-ascii (16, 8, "",
> substring( hardware, 4, 1))),2),":", suffix (concat ("0", binary-to-ascii
> (16, 8, "", substring( hardware, 5, 1))),2), ":", suffix (concat ("0",
> binary-to-ascii (16, 8, "", substring( hardware, 6, 1))),2)), ",IP:,",
> binary-to-ascii (10, 8, ".", leased-address), ",CID:,", option
> agent.circuit-id));
>  }
>
>
> --
> [image: photo]
> Mark Haney
> Network Engineer at NeoNova
> 919-460-3330 <(919)%20460-3330> (opt 1) ? mark.ha...@neonova.net
> <http://m...@neonova.net/>
> www.neonova.net <https://neonova.net/>
> <https://www.facebook.com/NeoNovaNNS/>  <https://twitter.com/NeoNova_NNS>
> <http://www.linkedin.com/company/neonova-network-services>
>
>
Try wrapping that with:
   on commit {
   ...
   }

Then it should only happen once, when the lease is granted.

-- 
Bob Harold
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.isc.org/pipermail/dhcp-users/attachments/20170526/84014877/attachment-0001.html>

------------------------------

Message: 3
Date: Fri, 26 May 2017 15:08:47 -0400
From: Mark Haney <mark.ha...@neonova.net>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: Build a custom log entry on a DHCPACK CentOS 6.
Message-ID:
        <camzgkz9pnu-7xsomzxymz_1httoopw7iwww26359ggawdbk...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Okay, let me see if I get this straight, I should wrap the entire if
statement inside an 'on commit {}' block?

On Fri, May 26, 2017 at 2:56 PM, Bob Harold <rharo...@umich.edu> wrote:

>
> On Fri, May 26, 2017 at 11:38 AM, Mark Haney <mark.ha...@neonova.net>
> wrote:
>
>> We've got a custom log entry created that's based on whether the
>> agent.circuit-id exists.  The problem is that the circuit-id gets included
>> in DHCPDISCOVER and DHCPOFFER, so we're getting duplicate custom messages
>> logged.
>>
>> What we want to do it create this custom log file, with the circuit-id
>> only on the DHCPACK.  The log creation params are below.  We use this so
>> that customers can get a web interface view of the current leases.
>>
>> Is there a way to do this with the latest CentOS 6 dhcpd package?
>>
>> ----
>> if exists agent.circuit-id
>>  {
>>         log (info, concat( "DHCPUSER:,", concat (suffix (concat ("0",
>> binary-to-ascii (16, 8, "", substring( hardware, 1, 1))),2), ":", suffix
>> (concat ("0", binary-to-ascii (16, 8, "",substring( hardware, 2, 1))),2),
>> ":", suffix (concat ("0", binary-to-ascii(16, 8, "", substring( hardware,
>> 3, 1))),2), ":", suffix (concat ("0", binary-to-ascii (16, 8, "",
>> substring( hardware, 4, 1))),2),":", suffix (concat ("0", binary-to-ascii
>> (16, 8, "", substring( hardware, 5, 1))),2), ":", suffix (concat ("0",
>> binary-to-ascii (16, 8, "", substring( hardware, 6, 1))),2)), ",IP:,",
>> binary-to-ascii (10, 8, ".", leased-address), ",CID:,", option
>> agent.circuit-id));
>>  }
>>
>>
>> --
>> [image: photo]
>> Mark Haney
>> Network Engineer at NeoNova
>> 919-460-3330 <(919)%20460-3330> (opt 1) ? mark.ha...@neonova.net
>> <http://m...@neonova.net/>
>> www.neonova.net <https://neonova.net/>
>> <https://www.facebook.com/NeoNovaNNS/>  <https://twitter.com/NeoNova_NNS>
>>   <http://www.linkedin.com/company/neonova-network-services>
>>
>>
> Try wrapping that with:
>    on commit {
>    ...
>    }
>
> Then it should only happen once, when the lease is granted.
>
> --
> Bob Harold
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users@lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>



-- 
[image: photo]
Mark Haney
Network Engineer at NeoNova
919-460-3330 <(919)%20460-3330> (opt 1) ? mark.ha...@neonova.net
www.neonova.net <https://neonova.net/>
<https://www.facebook.com/NeoNovaNNS/>  <https://twitter.com/NeoNova_NNS>
<http://www.linkedin.com/company/neonova-network-services>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.isc.org/pipermail/dhcp-users/attachments/20170526/05cae48d/attachment.html>

------------------------------

Subject: Digest Footer

_______________________________________________
dhcp-users mailing list
dhcp-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users

------------------------------

End of dhcp-users Digest, Vol 103, Issue 7
******************************************

Reply via email to