Logging questions

Marc Perea marccp at srttel.com
Thu Mar 18 16:56:16 UTC 2010


Tim,
option 82 info is pretty easy to log to syslog, provided you always hand back a lease. Something like this in the dhcpd.conf:
 
if exists agent.circuit-id {
        log(info,concat(binary-to-ascii(10,8,".",leased-address)," ASSIGNED TO AGENT.CIRCUIT-ID => ",option agent.circuit-id));
}
will produce output like:
 
Mar 17 11:29:26 isg-dhcp dhcpd: [ID 702911 daemon.info] DHCPOFFER on 74.207.x.y to 00:1a:2b:54:a9:e2 via 74.207.128.1
Mar 17 11:29:26 isg-dhcp dhcpd: [ID 702911 daemon.info] 74.207.x.y ASSIGNED TO AGENT.CIRCUIT-ID => 10.150.124.106:1-14-15-0-adsl-0-35-1415

BUT, be aware that in a no free leases situation, no offer will be made (which is what generates the logging above), and you will simply get this instead:
 
Mar 17 11:28:24 isg-dhcp dhcpd: [ID 702911 daemon.error] DHCPDISCOVER from 00:40:36:22:5a:c0 via 74.207.128.1: network isg-test: no free leases
 
Note there is no option 82 info on where your error is coming from. For us, this means one of our hundreds of relay agents has this customer MAC attached to it that is unable to get a lease, but which one?
 
This patch claims to fix that, but I haven't tried it (yet):
http://www.miquels.cistron.nl/isc-dhcpd/patch-server::02-log-agent-options 
 
As for question 2, I haven't really thought about that situation much and haven't had to troubleshoot by L2 address nearly as often as L3, so haven't found as much of a need for formatting it appropriately. Anyone else have any thoughts?
 
HTH,
 
--Marc
Message: 4
Date: Wed, 17 Mar 2010 11:34:49 -0700
From: Tim Gavin <livewire98801 at gmail.com>
Subject: Logging questions
To: Users of ISC DHCP <dhcp-users at lists.isc.org>
Message-ID:
<10af9a9a1003171134l47b66ed9jaeb567a6d2d6b7a4 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

I have two questions pertaining to logging.  I've looked through the
archives, but can't make sense of the responses.  I think it's because
everyone's trying to do more with it than I want to do.

First question:

I'm about to start getting option 82 information from our layer two
vendor network (I admin a ISP fiber network), and it appears that
people have issues getting that info logged into the syslog.  Is this
something I have to add, or is it only when people use fancy logging
scripts that this is an issue?  If it's something I have to add,
what's the easiest way to do it?


Second (less critical) question:

The MACs are logged in "computer standard" format of
aa:bb:cc:dd:ee:ff.  This is all well and good normally, but all of my
equipment, and all of our vendor's equipment is Cisco. That means I
have to reformat every MAC when flipping back and forth between
routers/switches and the DHCP server.  Is there any way I can change
the logging format to aabb.ccdd.eeff ?

Thanks :)

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20100318/1562226c/attachment.html>


More information about the dhcp-users mailing list