Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 examining the Monastery: (7)
As of 2015-07-01 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (24 votes), past polls