6,534
edits
Changes
trivial whitespace fixes
<source lang="perl">
#!/usr/bin/perl
$program = $0;
@catIndex{@catName} = (0..$#catName);
sub handler { my ($handler, $reg_info, $request_info, $requests) = @_;
open(UB,"<$source");
while(<UB>){
open(CONF,"</etc/vz/conf/$vid.conf");
my $name=$vid;
}
${beancounters{$vid}{0}}=$name;
}
}
close(UB);
for ( my $request = $requests; $request; $request = $request->next() ) {
my $myOID = new NetSNMP::OID($OID);
#1.3.6.1.4.1.2021.51.ctcount = 5
# $request->setValue(ASN_INTEGER, scalar keys (%beancounters));
print STDERR $reqOID." MODE_GET\n" if($debug);;
$request->setValue(ASN_INTEGER, scalar keys (%beancounters));
} elsif($reqOID =~ /$myOID\.([0-9]+)[\.]?([0-9]+)?[\.]?([0-9]+)?[\.]?([0-9]+)?/) {
my $catReq=$4;
my %vz;
print STDERR "Type:$typeReq, VzID: $vzidReq, Res: $resReq/$resName[$resReq], Cat: $catReq/$catName[$catReq]\n" if($debug);;
}
}
}
} elsif ($reqMode == MODE_GETNEXT) {
print STDERR $reqOID." MODE_GETNEXT\n" if($debug);
$request->setValue(ASN_INTEGER, scalar keys (%beancounters));
} elsif($reqOID =~ /$myOID\.([0-9]+)[\.]?([0-9]+)?[\.]?([0-9]+)?[\.]?([0-9]+)?$/) {
my $catReq=$4;
my %vz;
print STDERR "Type:$typeReq, VzID: $vzidReq, Res: $resReq/$resName[$resReq], Cat: $catReq/$catName[$catReq]\n" if($debug);;
if(!defined($resReq) && defined(${vz{0}})) {
$request->setValue(ASN_OCTET_STR, "".${vz{0}});
} elsif(!defined($catReq) && defined(${vz{$resReq}[0]})) {
$request->setValue(ASN_INTEGER, ${vz{$resReq}[0]});
} elsif($catReq< $#catName && defined(${vz{$resReq}[$catReq]})) {
}
}
}
}
{
}
#eof // nick