~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to perl/SNMP/examples/testleak.pl

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-09-13 12:06:21 UTC
  • Revision ID: james.westby@ubuntu.com-20040913120621-g952ntonlleihcvm
Tags: upstream-5.1.1
ImportĀ upstreamĀ versionĀ 5.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use SNMP 1.6;
 
2
 
 
3
$host = shift;
 
4
unless ($host) {
 
5
  $| = 1;  print "enter SNMP host address: "; $| = 0;
 
6
  chomp($host = <STDIN>);
 
7
}
 
8
 
 
9
$obj = new SNMP::Session DestHost, $host;
 
10
 
 
11
while (){
 
12
print $obj->get(["ifNumber",0]);
 
13
  open(COM,"ps -u$$|") || die;
 
14
  @bar = <COM>; 
 
15
  $siz = (split(' ',$bar[1]))[4];
 
16
  $rss = (split(' ',$bar[1]))[5];
 
17
  close(COM);
 
18
  print "siz = $siz, rss = $rss\n";
 
19
}