in reply to Help with perl to cli pipe
If you are most interested in getting it up and running quickly, without having to think much about the underlying details, telnet is probably the easiest route.
I say that largely because of the Net::Telnet module. It understands the idea of a CLI, setting the expected prompt character (appears to be "> " in BruteFir), etc.
Other than looking at BruteFir's docs for a few minutes, I don't have any experience with it. That said, this short example "should work", unless I missed something important.
my $host="hostname.whatever.com"; use Net::Telnet (); $t = new Net::Telnet (Timeout => 10, Port => 3000, Prompt => '/> $/'); $t->open($host); @helptext = $t->cmd("help"); print @helptext;
One caveat...I did find it a bit odd that the CLI configuration allowed you to configure a listen port, but not which ip addresses to listen on, so you can't restrict it to just localhost. I didn't see support for a password either. So it appears that once you turn it on, anyone can connect to it. You might want to use iptables to restrict access if you go this route.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with perl to cli pipe
by Bronston (Novice) on Nov 19, 2013 at 03:30 UTC | |
by kschwab (Vicar) on Nov 19, 2013 at 03:34 UTC | |
by Bronston (Novice) on Nov 20, 2013 at 18:18 UTC |