omshell Script for partner-down mode

Glenn Satchell glenn.satchell at uniq.com.au
Tue Apr 19 13:13:20 UTC 2011


There's a couple of things not quite right, but you have most if it.

This is from includes/failover.h - partner-down is state = 4.

/* A failover peer's running state. */
enum failover_state {
         unknown_state                   =  0, /* XXX: Not a standard 
state. */
         startup                         =  1,
         normal                          =  2,
         communications_interrupted      =  3,
         partner_down                    =  4,

keyname is the name of the key from the omapi key statement in dhcpd.conf.

failover name is the name of the failover pair from the failover peer 
statement in dhcpd.conf.

You should open the object before setting any attributes.

Also you have a space in your number you are setting.

So, updating your script you need something like this:

#!/bin/sh
# set local server into partner-down mode
omshell << EOF
server localhost
key keyname *<super-duper-secret key here>*
connect
new failover-state
set name = "failovername"
open
set local-state = 4
update
EOF

regards,
-glenn

On 04/19/11 01:59, Martin McCormick wrote:
> 	While trying to create an omshell script to put a
> still-living dhcp server in to partner-down mode, I received a
> "not implimented" error which actually tells me I am probably
> doing something wrong as the failover-state object is listed as
> supported. This uses what is called a here script  The script is as follows:
>
> #!/bin/sh
> omshell<<  EOF
> port 7911
> key keyname "SH They're listening out there"
> connect
> new failover-state
> set local-state = "00:00:00:0 1"
> open
> update
> EOF
>
> The output is as follows:
>
>>>> obj:<null>
>> obj: failover-state
>> obj: failover-state
> local-state = "00:00:00:0 1"
>> can't open object: not implemented
> obj: failover-state
> local-state = "00:00:00:0 1"
>> can't update object: not found
> obj: failover-state
> local-state = "00:00:00:0 1"
>
> Obviously not what I was looking for.
>
> 	Any suggestions are appreciated.
> _______________________________________________



More information about the dhcp-users mailing list