Getting exact error from dhcpd config test

Neff, Glen glen.neff at
Mon Jan 14 13:17:55 UTC 2013

I encountered this issue as well. I had to punt:

# Re-run test that failed, only give more verbose test failure output.
dhcpd -t -cf /tmp/dhcpconfmaint/dhcpd.conf.tmp > /tmp/dhcpconfmaint/ 2>&1
# Count lines in error output.
fullerrorcount=`wc -l < /tmp/dhcpconfmaint/`
# Determine lines without top header
withouttopheader=$(( $fullerrorcount - 4 ))
# Determine lines without bottom header
withoutbottomheader=$(( $withouttopheader - 18 ))
tail -$withouttopheader /tmp/dhcpconfmaint/ | head -$withoutbottomheader

-----Original Message-----
From: İbrahim Ercan [ibrahim.ercan at]
Received: Monday, 14 Jan 2013, 5:14
To: dhcp-users at [dhcp-users at]
Subject: Getting exact error from dhcpd config test

Hi. As I mention on this question (  ), I want to get exact error from dhcpd -t -cf command.

I tried dhcpd -q -t -cf <file> but this prints nothing. Do I have to use regex? Or is there any way to print only what error is?

Ibrahim Ercan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the dhcp-users mailing list