Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Drano - A tool for monitoring IBM POWER Series VIO Server NICs

by bpoag (Monk)
on Dec 30, 2016 at 20:25 UTC ( [id://1178677]=CUFP: print w/replies, xml ) Need Help??

We had a nasty performance bottleneck hit us about a year ago, one that we felt was sneaky enough to require some custom monitoring.. Hence the need for this script. Drano keeps tabs on a particular parameter of a NIC inside of a VIO server, and reports whether or not bandwidth choke may be occuring.
#!/usr/bin/perl ## ## Drano v0.1 written 032415 by Bowie Poag ## ## Drano makes sure the pipes are clear by reporting when network buff +ers have been depleted. ## This script is designed to be run as root on a VIO server. ## ## It also requires a little tuning on your part -- Replace any instan +ce of "ent12" with the adapter of your choice. ## $DEBUG=0; $threshold=$ARGV[0] || 90; $problemTiny="NO"; $problemSmall="NO"; $problemMedium="NO"; $problemLarge="NO"; $problemHuge="NO"; print "\nDrano: Spinning up..\n"; print "Drano: Collecting netstat dump..\n"; print "Drano:\n"; @netstatDump=`netstat -v ent12 2>/dev/null`; foreach $item (@netstatDump) { chomp($item); $item=~s/^\s+//g; if ($item=~/Max Buffers/) { print "Drano: $item\n"; $item=~s/\s+/ /g; @line=split(" ",$item); $maxTiny=$line[2]; $maxSmall=$line[3]; $maxMedium=$line[4]; $maxLarge=$line[5]; $maxHuge=$line[6]; } if ($item=~/Allocated/ && $item!~/Max/) { print "Drano: $item\n"; $item=~s/\s+/ /g; @line=split(" ",$item); $alcTiny=$line[1]; $alcSmall=$line[2]; $alcMedium=$line[3]; $alcLarge=$line[4]; $alcHuge=$line[5]; } } print "Drano:\n"; $DEBUG && print "MxT:[$maxTiny] MxS:[$maxSmall] MxM:[$maxMedium] MxL:[ +$maxLarge] MxH:[$maxHuge]\n"; $DEBUG && print "AlT:[$alcTiny] AlS:[$alcSmall] AlM:[$alcMedium] AlL:[ +$alcLarge] AlH:[$alcHuge]\n"; print "Drano: Analyizing buffer stats..\n"; print "Drano:\n"; $conTiny=sprintf("%-2.2f",($alcTiny/$maxTiny)*100); $conSmall=sprintf("%-2.2f",($alcSmall/$maxSmall)*100); $conMedium=sprintf("%-2.2f",($alcMedium/$maxMedium)*100); $conLarge=sprintf("%-2.2f",($alcLarge/$maxLarge)*100); $conHuge=sprintf("%-2.2f",($alcHuge/$maxHuge)*100); if ($conTiny > $threshold) { $problemTiny="YES"; } if ($conSmall > $threshold) { $problemSmall="YES"; } if ($conMedium > $threshold) { $problemMedium="YES"; } if ($conLarge > $threshold) { $problemLarge="YES"; } if ($conHuge > $threshold) { $problemHuge="YES"; } printf("%-16s %16s %16s %11s\n","Drano: Buffer Size","Consumption (%)" +,"Threshold (%)","Problem?"); printf("%-16s %16s %16s %11s\n","Drano: -----------","---------------" +,"-------------","--------"); printf("%-16s %16f %16f %11s\n","Drano: Tiny","$conTiny","$threshold", +"$problemTiny"); printf("%-16s %16f %16f %11s\n","Drano: Small","$conSmall","$threshold +","$problemSmall"); printf("%-16s %16f %16f %11s\n","Drano: Medium","$conMedium","$thresho +ld","$problemMedium"); printf("%-16s %16f %16f %11s\n","Drano: Large","$conLarge","$threshold +","$problemLarge"); printf("%-16s %16f %16f %11s\n","Drano: Huge","$conHuge","$threshold", +"$problemHuge"); print "Drano:\n"; if ($problemTiny ne "YES" && $problemSmall ne "YES" && $problemMedium +ne "YES" && $problemLarge ne "YES" && $problemHuge ne "YES") { print "Drano: Everything looks fine. All your buffer consumpti +on percentages are below the given threshold of $threshold"."%".".\n" +; } else { print "Drano: Looks like you've run out of network buffers on +one or more fronts. Time to tune up.\n"; system("logger Drano Warning - Partial network buffer overflow + detected. Network interface requires additional tuning."); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2025-11-17 22:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (72 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.