Koozali.org: home of the SME Server

dhcp reservation with a - db command

Offline fpausp

  • *
  • 728
  • +0/-0
dhcp reservation with a - db command
« on: April 06, 2009, 06:18:11 PM »
Hi All,

I like to get the same function as Hostnames and addresses, a binding of a mac-address to a specific ip-address.

That all should work in a script, is it possible to make a dhcp reservation with a db command or other commands ?


regards
fpausp
Viribus unitis

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: dhcp reservation with a - db command
« Reply #1 on: April 06, 2009, 08:05:16 PM »
I like to get the same function as Hostnames and addresses, a binding of a mac-address to a specific ip-address.
What's against just using the panel?

That all should work in a script, is it possible to make a dhcp reservation with a db command or other commands ?
Yes, you will have to look at the source of the hostname panel to see how reservations are committed to the database and affected using the events.
You will also have some help on this, in general when trying to grasp what is being done how and why, by reading SME Server Development Guide linked from the wiki.

From the top off my head I think you need to alter/add to the hosts database and run an event like host-create, host-delete or host-modify.

Perhaps the lazy admin toolkit can be off help as well as a lot off adding users can be done batch wise, perhaps you can find some code snippets in there you can tweak and (re)use.
« Last Edit: April 06, 2009, 08:08:08 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline fpausp

  • *
  • 728
  • +0/-0
Re: dhcp reservation with a - db command
« Reply #2 on: April 07, 2009, 08:10:24 AM »
Hi,

Thanks cactus, i will try that.

Best
fpausp
Viribus unitis

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: dhcp reservation with a - db command
« Reply #3 on: April 09, 2009, 04:01:57 AM »
fpausp

Make a change in server manager Hostnames panel (or wherever) and then review the messages log file, to see what commands were issued.
Then emulate those manually or in a script.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.