DHCPD Scripts
Tim Gustafson
tjg at soe.ucsc.edu
Thu Sep 25 15:55:44 UTC 2008
> Yes. Look at the dhcp-eval man page and search for "execute".
Alan,
Thanks for your suggestion, it definitely pointed me in the right direction.
I now have the following in my dhcpd.conf file:
on commit {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
log(concat("Commit: IP: ", ClientIP, " Mac: ", ClientMac));
if(execute("/root/scripts/dhcp-event", "commit", ClientIP, ClientMac) = 0)
{
log(concat("Sent DHCP Commit Event For Client ", ClientIP));
} else {
log(concat("Error Sending DHCP Commit Event For Client ", ClientIP));
}
}
When I start the server, everything seems honky-dory, but then when a client
goes to renew their IP, I get the following in my log file:
dhcpd: Commit: IP: 192.168.9.254 Mac: 0:a:e4:2f:3f:f2
dhcpd: execute: no such function.
dhcpd: Error Sending DHCP Commit Event For Client 192.168.9.254
dhcpd: invalid expression type in print_expression: 45
dhcpd then dies without further warning. I Googled "dhcpd execute" and the
only things I found were things that had nothing to do with the
configuration file. I also checked the dhcp-options and dhcp-eval pages and
neither of them mention the "execute" keyword.
Is this an option that has to be enabled specifically at compile-time or
something? I'm running version isc-dhcp3-server-3.0.5_2 right now. Is this
a feature for a different version?
Tim Gustafson
SOE Webmaster
UC Santa Cruz
tjg at soe.ucsc.edu
831-459-5354
More information about the dhcp-users
mailing list