Page 1 of 1

omshell "connect": dhcpctl_connect: no more

Posted: Wed Jul 02, 2014 7:07 pm
by ^rooker
[PROBLEM]
Tried to fix a "peer holds all free leases" problem in my failover DHCP setup, using "omshell" to set the running dhcpd to state "partner-down".
Trying to connect with omshell, returns the following error:
dhcpctl_connect: no more
[SOLUTION]
By default, the om-api connection is not configured in /etc/dhcp/dhcpd.conf, so you must add a few lines to enable the omshell connection.
Thanks to the DHCPd failover article on Frederik's blog, I got an idea of how to configure the "omapi" for using "omshell".
Add the following lines to your primary DHCP server dhcpd.conf:

Code: Select all

key primaryhost {
    algorithm hmac-md5;
    secret "secret";
};

omapi-key primaryhost;
omapi-port 7911;
Now, try to connect with "omshell":

Code: Select all

server localhost
port 7911
key primaryhost "secret"
connect
Upon connect, you'll get the following message:
obj: <null>
This is not an error, but it indicates, that you haven't told omshell which "object" to work on.

For example:

Code: Select all

new failover-state
set name = "failovername"
open
Where "failovername" is the name you defined in the failover-pool in /etc/dhcp/dhcpd.conf.