Well I think that setting up simple methods to grab the info from the pdc would be the best manner. As for doing the name lookups and pinging the host. Why not be simple and just
$ping = `ping $host`;
$nslookup = `nslookup $host`;
Then you can printout the return, regex it, parse it, do whatever you want. No need to use Net::Ping or anything on a task as simple as this. Simple fill and array with all the hosts form the dumpfile, then
foreach my $host (@hosts) {
$ping = `ping $host`;
$nslookup = `nslookup $host';
print "Ping result is $ping \n";
print "Nslookup result is $nslookup for host $host \n";
}
Hopefully I helped some.
P.S. Make sure you are using ` and not ' around those system commands, to pipe it to the system and not just assing a var.
Tradez
"Never underestimate the power of stupidity"
- Bullet Tooth Tony, Snatch (2001)
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.