Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 7ca84d00a753576dfaee15bac39038f0 > files > 303

mrtg-2.14.5-4.el5.x86_64.rpm

#!/usr/bin/perl
# This script is used to establish a TCP connection with a host to get the 
# report of disk-space quota provided by repquota utility.
#
# use: ./getreport.pl <hostname> <port number>
#
# By Steven Micallef <smic@wire.net.au> on the 24/4/1999.
# Modified by Adrian Turcu <adrianturcu@yahoo.com> on 18/9/2000.

use Net::Telnet ();

$hostname = $ARGV[0];
$port = $ARGV[1];

# If you've changed the port showdisk.pl runs on, change it here too.
#$port = 9047;

$i = 0;

if ($hostname eq "" || $port eq "" )
{
  print "Usage: $0 <hostname> <port number>\n";
  exit;
}

$t = new Net::Telnet ( Host => $hostname, Port => $port);
$t->open("$hostname");

do
{
  $data = $t->getline(Timeout => 40);
    print $data;
} while ( $data );