ovsysnms
上传用户:shbosideng
上传日期:2013-05-04
资源大小:1555k
文件大小:1k
源码类别:

SNMP编程

开发平台:

C/C++

  1. #!/usr/local/bin/perl5
  2. # -*- mode: Perl -*-
  3. ##################################################################
  4. # Config file creator
  5. ##################################################################
  6. # Created by Laurie Gellatly <gellatly@one.net.au>
  7. # this produces an array of ip address and system names for each
  8. # ip address passed to it, by pulling info
  9. # off the device via snmp
  10. #################################################################
  11. #
  12. # Distributed under the GNU copyleft
  13. #
  14. # $Id: ovsysnms,v 1.1.1.1 2002/02/26 10:16:36 oetiker Exp $
  15. #
  16. use Socket;
  17. use strict;
  18. use ovmrtg;
  19. use vars '$DEBUG';
  20. my $DEBUG = 0;
  21. my($router,@res,$cnt); 
  22. sub main {
  23.   $router = $ARGV[0];
  24.   die <<USAGE  unless $router;
  25. USAGE: ovsysnms 'router IP ADDRESS/S or HPOV selection Names'
  26. EXAMPLE:  ovsysnms 193.21.1.2 >> resolved
  27. USAGE
  28.    @res = ovsysnms(@ARGV);
  29.    for($cnt = 0 ; $cnt < @res; ++$cnt){
  30.       print "$res[$cnt]n";
  31.    }
  32. }  
  33. main;
  34. exit(0);