Hello Wernher,
On Sun, 2 Mar 2014 21:42:00 +0200
Wernher Eksteen wrote:
> Hi Everyone,
>
> I need your help with this one please.
>
> I have a config file that is written/updated with a Python based web front
> end tool. I would like to add/remove hosts to/from this config file using
> Perl.
>
Hi Shlomi,
Thank you for the pointers. I do want to learn Python as well when I get a
chance. This "framework" I'm writing now will automate things to a great
extend eventually freeing up loads of my daily operations time so I can
focus on more interesting things.
I'm really not expecting the cod
On Mar 3, 2014, at 8:47 AM, Wernher Eksteen wrote:
> Hi Shlomi,
>
> Thank you for the pointers. I do want to learn Python as well when I get a
> chance. This "framework" I'm writing now will automate things to a great
> extend eventually freeing up loads of my daily operations time so I can fo
So, when I do this:
my $src = (grep {/.*(ARIN|APNIC).*(\n)?/; $1} @ret)[0];
I get a full line and not just the capture:
# ARIN WHOIS data and services are subject to the Terms of Use
When I do this:
my $src = (grep {s/.*(ARIN|APNIC).*(\n)?/$1/} @ret)[0];
I get just the match but it also alters
I think you want to use 'map' instead of grep.
HTH, Ken
On Mon, Mar 3, 2014 at 6:35 PM, shawn wilson wrote:
> So, when I do this:
> my $src = (grep {/.*(ARIN|APNIC).*(\n)?/; $1} @ret)[0];
> I get a full line and not just the capture:
> # ARIN WHOIS data and services are subject to the Terms o
On Mon, 3 Mar 2014 18:35:55 -0500
shawn wilson wrote:
> So, when I do this:
> my $src = (grep {/.*(ARIN|APNIC).*(\n)?/; $1} @ret)[0];
> I get a full line and not just the capture:
> # ARIN WHOIS data and services are subject to the Terms of Use
If you can't figure out what's wrong, neither wil
Hi Jim,
The format of the config file is like this:
*Config file example1:* For one host in this case named hostname1 belonging
to 4 contactgroups (group1 to group4),
< begin config file example 1 >
host_contactgroups += [
( 'group1', ['hostname1'] ),
( 'group2', ['h
So, based on the config examples I gave above, the Perl script I'm writing
will do the following:
1. Read the existing config file and determine the following:
- How many hosts are there and what are their names.
- What are the contactgroups and tag_criticality values for each host ie:
"prod" or "