I want to query a DHCP server for logs about leased IP’s every 5 minutes. I am not sure how to run the query from my server or which file to edit.

The queried logs will be sent to the server and placed into a MySQL database which I have created.


Check /var/lib/dhcp/dhcpd.leases (or /var/lib/dhcp3/dhcpd.leases) file. The somewhat outdated manpage says you might have to create the file with touch first. I don't remember ever having to do that.

As to the MySQL part, if you don't have that figured out already, you might use some dynamic scripting language like Python or Perl with either standard access module, or some ORM (like SQLAlchemy) for richer but more complicated setup. Any questions about that would be more suited for stackoverflow though

  • I want the logs to be sent to a remote syslog server. then i will use cron tab to have the query repeated every 5 minutes – sosytee Aug 20 '13 at 12:29
  • @sosytee I guess then that those details should be included in the original question, as sending stuff to a local syslog or filtering it and sending to a remote daemon is quite another matter. The question should read 'How to send DPCPD leases to remote syslogd' or something in that line. Please edit accordingly. – moon.musick Aug 20 '13 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.