Greetings Perl Experts,
I have a script which is already running fine for a small number of servers monitoring. The name of servers are given in script itself (because as of now those were very less to monitor). Now I need to add 100+ server names and trying to do it using external config file which will contain only name of servers.
my @services = (
#[ 'servername-001', '10.68.197.91', 1666 ],
[ 'servername-001', 'imm-servername-001.companyname.com' ],
[ 'servername-002', 'imm-servername-002.companyname.com' ],
);
The question is how can I change this script to read following part from an external text file in the same variable name as mentioned above:
[ 'servername-001', 'imm-servername-001.companyname.com' ],
[ 'servername-002', 'imm-servername-002.companyname.com' ],
I know it is not that difficult but I dont have perl expertise either :)) So, any help will be appreciated.
Thanks.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.