<HTML dir=ltr><HEAD><TITLE>RE: Use omshell/omapi to set hostname for ddns?</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText82909 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>These are static customers correct? As if you add them with a specific IP for say a week or more lease time?</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Brad</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> dhcp-users-bounce@isc.org on behalf of Steve van der Burg<BR><B>Sent:</B> Wed 5/14/2008 5:34 AM<BR><B>To:</B> dhcp-users@isc.org<BR><B>Subject:</B> RE: Use omshell/omapi to set hostname for ddns?<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>These objects are in the leases file, not the configuration file.  They're dynamic - ie. added via omapi while the server is running - so no restart is required.  When a restart does have to happen (because of changes to the config file(s)), the server reads the leases file and all is well.<BR>If I ever lost the leases file (unlikely; I back it up once a minute to another server), it would take a really, really long time to pump all the host objects back in via omshell + expect.<BR><BR>The omshell + expect slowness is fine during normal operations because my code only pushes changes (delete a host object, add a host object, update a host object by adding or removing a static address, etc) up to the servers once a minute, and the number of changes that users of the management app that I've cooked up can make in a minute is fairly small.<BR><BR>...Steve<BR><BR>"Brad Dameron" <Brad.Dameron@clearwire.com> wrote:<BR>> Uh. Why would you not keep them in a seperate include file and update it.<BR>> That way if you have to restart it only takes a few seconds. That is how we<BR>> do it. I update that file and then make the change via OMAPI so I don't have<BR>> to restart. But I still keep it for a restart.<BR>> <BR>> Brad<BR>><BR>> ________________________________<BR>><BR>> From: dhcp-users-bounce@isc.org on behalf of Steve van der Burg<BR>> Sent: Tue 5/13/2008 12:44 PM<BR>> To: dhcp-users@isc.org<BR>> Subject: RE: Use omshell/omapi to set hostname for ddns?<BR>><BR>><BR>><BR>> Yeah, I keep meaning to look into the perl OMAPI modules.  I've got about<BR>> 10k dynamic host objects that are in each of my two dhcp servers, and the<BR>> thought of how long it would take to push all of those in at once, if I lost<BR>> the leases file, is pretty scary.<BR>><BR>> Thanks for the pointer.<BR>><BR>> ...Steve<BR>><BR>> "Brad Dameron" <Brad.Dameron@clearwire.com> wrote:<BR>>> I have been using this little app instead of expect. A heck of a lot cleaner<BR>>> and easier to use:<BR>>><BR>>> <A href="http://freshmeat.net/projects/omcmd/">http://freshmeat.net/projects/omcmd/</A><BR>>><BR>>> Or if you prefer perl:<BR>>><BR>>> <A href="http://nickg.home.cern.ch/nickg/dhcpd/omapiperl.html">http://nickg.home.cern.ch/nickg/dhcpd/omapiperl.html</A><BR>>> <<A href="http://nickg.home.cern.ch/nickg/dhcpd/omapiperl.html">http://nickg.home.cern.ch/nickg/dhcpd/omapiperl.html</A>><BR>>><BR>>><BR>>> Hope this helps.<BR>>><BR>>> Brad<BR>>><BR>>> ________________________________<BR>>><BR>>> From: dhcp-users-bounce@isc.org on behalf of Steve van der Burg<BR>>> Sent: Tue 5/13/2008 10:06 AM<BR>>> To: dhcp-users@isc.org<BR>>> Subject: Re: Use omshell/omapi to set hostname for ddns?<BR>>><BR>>><BR>>><BR>>>>>> "Steve van der Burg" <steve.vanderburg@lhsc.on.ca> wrote:<BR>>>> Hi, I'm using a failover pair of 3.0.5 servers with omshell and am trying to<BR>>>> find a way to get a printer that, for some reason, can't work with the<BR>>>> servers to do ddns.  Other hosts (PCs) on the same subnet are able to get<BR>>>> their A records published, but the printer, which is supplying a<BR>>>> client-hostname but no uid, doesn't work.<BR>>>> I have scoured the docs and the mailing list, but to no avail.  Reading the<BR>>>> server docs suggests to me that the ddns TXT and A recs are not getting<BR>>>> generated because the printer is not sending a uid, but I don't know if that<BR>>>> is correct.  So, I either need some way to generate a uid for it via server<BR>>>> config, or some way to set a name in its host container (we only allow known<BR>>>> MACs, so each machine has a host object dynamically sent to the dhcp server<BR>>>> via omshell) that will then get picked up and used for ddns.<BR>>><BR>>> Okay, after a lot more searching, here's the answer to my own question:<BR>>><BR>>> To use omshell to set ddns info (in my case, just an A record), do something<BR>>> like this:<BR>>><BR>>>    $con->send("set statements=\"ddns-hostname=\\\"$hname\\\"; ".<BR>>>                                "ddns-domainname=\\\"$domain\\\";\"\n");<BR>>>    $con->expect(1,'eof');<BR>>><BR>>> (I'm using expect with omshell).<BR>>><BR>>> ...Steve<BR>>><BR>>><BR>>>  --------------------------------------------------------------------------------<BR>>> This information is directed in confidence solely to the person named above<BR>>> and may contain confidential and/or privileged material. This information<BR>> may<BR>>> not otherwise be distributed, copied or disclosed. If you have received this<BR>>> e-mail in error, please notify the sender immediately via a return e-mail and<BR>>> destroy original message. Thank you for your cooperation.<BR>><BR>>  --------------------------------------------------------------------------------<BR>> This information is directed in confidence solely to the person named above<BR>> and may contain confidential and/or privileged material. This information may<BR>> not otherwise be distributed, copied or disclosed. If you have received this<BR>> e-mail in error, please notify the sender immediately via a return e-mail and<BR>> destroy original message. Thank you for your cooperation.<BR><BR> --------------------------------------------------------------------------------<BR>This information is directed in confidence solely to the person named above and may contain confidential and/or privileged material. This information may not otherwise be distributed, copied or disclosed. If you have received this e-mail in error, please notify the sender immediately via a return e-mail and destroy original message. Thank you for your cooperation.<BR><BR></FONT></P></DIV></BODY></HTML>