Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by ybiC (Prior)
on Jul 24, 2001 at 06:01 UTC ( #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")


Comment on Re: switchcheck.pl (Getopt, $_, nonport interfaces)
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (14)
As of 2014-08-21 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (136 votes), past polls