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.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityI 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
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