LegionNET

Viacom mtv_scripts admin nfs-snmp.pl

Mar 5th, 2012
152
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2.  
  3. # nfsstat -nc
  4.  
  5. $nfsargs = shift (@ARGV);
  6.  
  7. $cmd_line = "/usr/bin/nfsstat $nfsargs";
  8.  
  9. $i = 0;
  10.  
  11. @frank = `$cmd_line`;
  12.  
  13. while ($i <= $#frank) {
  14. if (($frank[$i] =~ (/^Connection/)) || ($frank[$i] =~ (/^Client/)) || ($frank[$i] =~ (/^Version/)) || ($frank[$i] =~ (/^$/))) {
  15. $i++;
  16. next;
  17. }
  18. @bob = split /\s+/, $frank[$i];
  19. @jane = split /\s+/, $frank[++$i];
  20. $xy = 0;
  21. $yz = 0;
  22. while ($xy <= $#bob) {
  23. if ($jane[$yz] =~ /%/) {
  24. $yz++;
  25. }
  26. print "$bob[$xy]\n";
  27. print "$jane[$yz]\n";
  28. $xy++;
  29. $yz++;
  30. }
  31. $i++;
  32. }
RAW Paste Data