It is possible, what platform is this file created on? Can
you supply a sample file? I assume this file would have to
be read in a few times per day if you want the data up to
date or on the fly when someone request the data.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=386949
It is possible, what platform is this file created on? Can
you supply a sample file? I assume this file would have to
be read in a few times per day if you want the data up to
date or on the fly when someone request the data.
Logged In: YES
user_id=319044
We use Linux with ISC DHCPD Version 3
here a sample what is in /var/lib/dhcp/dhcpd.leases
------------ snip ----------------
lease 172.17.251.252 {
starts 4 2005/05/12 12:10:03;
ends 4 2005/05/12 14:10:03;
tstp 4 2005/05/12 14:10:03;
binding state free;
hardware ethernet 00:12:01:11:a9:d5;
uid "\001\000\022\001\021\251\325";
}
lease 172.17.253.199 {
starts 3 2006/10/18 06:53:04;
ends 3 2006/10/18 08:53:04;
binding state active;
next binding state free;
hardware ethernet 00:13:19:a8:ef:0a;
uid "\001\000\023\031\250\357\012";
client-hostname "SEP001319A8EF0A";
}
lease 212.122.XXX.XXX {
starts 3 2006/10/18 06:52:32;
ends 3 2006/10/18 09:52:32;
binding state active;
next binding state free;
hardware ethernet 00:03:93:0a:c3:60;
uid "\001\000\003\223\012\303`";
client-hostname "Max";
}
lease 212.122.XXX.XXX {
starts 3 2006/10/18 06:38:56;
ends 3 2006/10/18 08:38:56;
binding state active;
next binding state free;
hardware ethernet 00:11:24:db:49:72;
uid "\001\000\021$\333Ir";
client-hostname "Pong";
}
----------------- snap -----------
it should be possible to run a php script via cron some
times a day.
Logged In: YES
user_id=386949
Hi Steffen,
Please use the following php script to test out the
dhcp.lease data to verify if this will parse correctly.
Please let me know, I would like to add this to the next
release.
Cheers,
mearls
test dhcp.lease file
Logged In: YES
user_id=690166
Originator: NO
Looks like it parses fine. Example output(using the posted data) matches ours:
Lease = 172.17.251.252
Lease Start = 2005/05/12
Lease Mac = 00:12:01:11:a9:d5
Lease = 172.17.253.199
Lease Start = 2006/10/18
Lease Mac = 00:13:19:a8:ef:0a
Lease Hostname = "SEP001319A8EF0A"
Lease = 212.122.XXX.XXX
Lease Start = 2006/10/18
Lease Mac = 00:03:93:0a:c3:60
Lease Hostname = "Max"
Lease = 212.122.XXX.XXX
Lease Start = 2006/10/18
Lease Mac = 00:11:24:db:49:72
Lease Hostname = "Pong"