omshell in a Script

Martin McCormick martin at dc.cis.okstate.edu
Mon Nov 4 16:37:32 UTC 2013


"Glenn Satchell" writes:
> You could try the Perl Expect module, it works just like TCL Expect. Opens
> a two way connection to the omshell process so you get the output too in a
> way where you can search for different responses. If you've used TCP
> Expect then the concepts are very similar in Perl.

	I certainly have. Thank you! I am actually re-writing an
application I wrote several years ago in C, but now in perl and
everything has gone smoothly up until now so this will probably
get me out of the jam I find myself in right now.

	In my old C application, I have a sub application that
generates a full-blown expect script that spawns omshell,
logs in to a DHCP server and then adds and 
deletes hosts using expects logging facility to capture the 
events. It works, but it is a monster, kind of like one of those
mouse-trap games in which one turns the crank and sets off a
chain of chaos in which one thing triggers the next until the
bell rings or a little man falls over.

> There's also Perl modules: Net-ISC-DHCPd-0.14
> http://search.cpan.org/~jhthorsen/Net-ISC-DHCPd-0.14/lib/Net/ISC/DHCPd.pm
> but I've never used this so don't know what it's like.

	I tried installing that and the installer script
determined it couldn't do so after several minutes of huffing
and puffing.

	Anyway, thanks for the tip on Expect.pm. That looks like
a gold mine of possibilities.

Martin


More information about the dhcp-users mailing list