CentOS 6 Dhcpd Custom Log Issues
Hi all,
I’ve got an issue with C6’s dhcpd custom logging that I cannot figure out. Hopefully someone has an idea, or has seen a similar issue. We have dhcpd logging to /var/log/messages a custom header (DHCPUSER:) with MAC, IP and Circuit-ID.
I’ll not bore you with the guts, so here’s the beginning of that line in dhcpd.conf:
if exists agent.circuit-id
{
log (info, concat( “DHCPUSER:,”, concat (suffix (concat (“0”, binary-to-ascii…..
We log this specifically to have rsyslog dump that line (keyed on DHCPUSER)
into a MySQL database for use by a web app our development team built so that our customers can get reports on their DHCP leases. (Neonova provides help desk, engineering and Tier 2 and 3 tech support to rural ISPs in the US.)
Our problem is that this method logs every entry that has the CID in the packet. Which covers most DHCP requests. As such, with our bigger customers, this logging bogs down MySQL (and the file system on older ext3
based CentOS 6 boxes we have out in the field) to the point where, after a major outage and recovery, the DHCP server can’t handle the load and people are unable to get new DHCP leases, resulting in calls to our help desk.
What I want to do is have this data logged in the DHCPUSER line on the DHCPACK and only that. For some reason, when I try replace the above with
‘if option dhcp-message-type = 5’, nothing is getting logged. All the instances of this I’ve googled have similar, notably one from ~2008 that has:
if exists agent.circuit-id and dhcp-message-type = 3
and that apparently worked fine. I know the circuit-id is included in the ACK packet (tcpdump is your friend), but even on the check to log for only the dhcp message type 5 isn’t working.
Are the newer dhcpd versions different syntactically? What’s the correct method for logging on the DCHP Message type with the most recent C6
version? (dhcp-4.1.1-53.P1.el6.CentOS.x86_64)
Any ideas?
—
[image: photo]
Mark Haney Network Engineer at NeoNova
919-460-3330 <(919)%20460-3330> (opt 1) • mark.haney@neonova.net www.neonova.net
Recommended
Recent Posts
Recent Comments
- igor on LibGLU.so.1
- Hussein on NBDE, Clevis And Tang For Non-root Disk
- João M. S. Silva on CentOS 7.6 1810 Vs. VirtualBox : Bug With Keyboard Layout Selection
- Jim Plumb on Spamassassin Vs. SELinux Trouble
- woodiskingser on Off Topic – Need Help Registering To The Smplayer Forum
Archives
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- June 2021
- May 2021
- April 2021
- March 2021
- February 2021
- January 2021
- December 2020
- November 2020
- October 2020
- September 2020
- August 2020
- July 2020
- June 2020
- May 2020
- April 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- September 2019
- August 2019
- July 2019
- June 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- February 2014
- January 2014
- April 2013
- December 2012
One thought on - CentOS 6 Dhcpd Custom Log Issues
I’ve done more testing and I’ve found something very interesting. I’ve tested logging with our entire string (which will be below) with slight changes to the ‘if’ statement solely looking at the ‘dhcp-message-type = ‘
parameter. Of the four message types we routinely see some work and some don’t: (ie: if option dhcp-message-type = # { log…)
Message-Type 1 (DISCOVER): logging works Message-Type 2 (OFFER): logging does NOT work Message-Type 3 (REQUEST) logging works Message-Type 5 (ACK) logging does NOT work
And by ‘does not work’ I mean it doesn’t log anything at all. As if it’s not matching on those message types at all. I know they are being logged in syslog, where all these messages are logged to, so I know we’re getting OFFERs and ACKs, as they are logged normally in syslog.
So, anyone have any idea WTF is going on here? I suppose I could log based on REQUEST, but I’m afraid our data would be inaccurate if a request isn’t ACK’d.
—
[image: photo]
Mark Haney Network Engineer at NeoNova
919-460-3330 <(919)%20460-3330> (opt 1) • mark.haney@neonova.net http://www.neonova.net <https://neonova.net/>
<https://www.facebook.com/NeoNovaNNS/> <https://twitter.com/NeoNova_NNS>
<http://www.linkedin.com/company/neonova-network-services>