mdd has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; open(OMSHELL, "|/bin/omshell") || die("Could not open omshell\n"); print OMSHELL "server localhost\n"; print OMSHELL "port 6902\n"; print OMSHELL "key omapi_key fakekey==\n"; print OMSHELL "connect\n"; print OMSHELL "new failover-state\n"; print OMSHELL "set name = \"netreg-failover\"\n"; print OMSHELL "open\n"; close(OMSHELL) || die("Could not close omshell\n");
This works in that it prints a list of dhcpd status messages once it hits the open command. However, instead of display the output on screen, I want to parse it, capture a few lines and do some processing. I don't know how to both open omshell to enter commands and read the output instead of displaying it. I hope that makes sense. I tried searching for the correct way to do it but couldn't wrap my head around the examples I've looked at.
-Mike
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl and omshell for dhcpd status -- IPC
by Discipulus (Canon) on Feb 04, 2018 at 20:10 UTC | |
|
Re: perl and omshell for dhcpd status
by NetWallah (Canon) on Feb 04, 2018 at 21:32 UTC | |
|
Re: perl and omshell for dhcpd status
by hippo (Archbishop) on Feb 05, 2018 at 10:09 UTC |