Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: switchcheck.pl (Getopt, $_, nonport interfaces)

by ybiC (Prior)
on Jul 24, 2001 at 06:01 UTC ( [id://99212]=note: print w/replies, xml ) Need Help??


in reply to switchcheck.pl

    Hi fingers,
First off - good job for using Net::Snmp!   I used UCD SNMP for a similar script because of the included additional utilities, but in hindsight wish I'd done like you.

A couple of trivial suggestions come to mind:

  • Getopt::Long might simplify processing of command-line arguments.
  • If you're going to use $hostname instead of $_ in
    foreach(@hostname){ undef @unique; $hostname=$_;
    it could be a tiny bit cleaner as
    foreach $hostname(@hostname){ undef @unique;
  • I don't know how well the particular syntax would transfer to your code, but "(code) mind your snmPs & Qs" uses a hash to count non-port interfaces, then subtracts them from final port status report.   As you note, it reaaally improves accuracy of generated reports.
BTW, thanks for the compliment in your pod.   I "appreciate poorly written code" because I'm so well practiced at *writing* it! 8^D
    cheers,
    Don
    striving toward Perl Adept
    (it's pronounced "why-bick")

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://99212]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found