Skip to content

Commit

Permalink
reworked EmpireSystemedge::empireNTREGPERF to use walkSnmpTable(); co…
Browse files Browse the repository at this point in the history
…de parses, but I have no way to test it
  • Loading branch information
medea61 committed Aug 12, 2012
1 parent 778ee86 commit ba958bd
Showing 1 changed file with 21 additions and 30 deletions.
51 changes: 21 additions & 30 deletions src/perllib/Torrus/DevDiscover/EmpireSystemedge.pm
Expand Up @@ -500,34 +500,6 @@ sub discover
}


# Empire NTREGPERF

my $empireNTREGPERF =
$session->get_table( -baseoid => $dd->oiddef('empireNTREGPERF') );
if( defined $empireNTREGPERF )
{
next;
$devdetails->setCap('empireNTREGPERF');
$devdetails->storeSnmpVars( $empireNTREGPERF );

my $ref = {'indices' => []};
$data->{'empireNTREGPERF'} = $ref;
foreach my $INDEX
( $devdetails->getSnmpIndices($dd->oiddef('empireNTREGPERF') ) )
{
# This is all configured on a per site basis.
# The xml will be site specific
push( @{ $ref->{'indices'} }, $INDEX);
my $template = {};
$Torrus::ConfigBuilder::templateRegistry->
{'EmpireSystemedge::NTREGPERF_' . $INDEX} = $template;
$template->{'name'}='EmpireSystemedge::NTREGPERF_' . $INDEX;
$template->{'source'}='vendor/empire.systemedge.ntregperf.xml';

}
}


# Empire Service Checks

if($dd->checkSnmpTable('empireSvcTable')) {
Expand Down Expand Up @@ -565,6 +537,25 @@ sub discover
}


# Empire NTREGPERF

if($dd->checkSnmpTable('empireNTREGPERF')) {
$devdetails->setCap('EmpireSystemedge::empireNTREGPERF');
$data->{'empireNTREGPERF'} = {};
$data->{'empireNTREGPERF'}{'indices'} = [];

my $indices = $dd->walkSnmpTable('empireNTREGPERF');

while( my( $index, $value ) = each %{$indices} ) {
push(@{$data->{'empireSvcStats'}{'indices'}}, $index);

$Torrus::ConfigBuilder::templateRegistry->{'EmpireSystemedge::NTREGPERF_' . $index} = {};
$Torrus::ConfigBuilder::templateRegistry->{'EmpireSystemedge::NTREGPERF_' . $index}{'name'}='EmpireSystemedge::NTREGPERF_' . $index;
$Torrus::ConfigBuilder::templateRegistry->{'EmpireSystemedge::NTREGPERF_' . $index}{'source'}='vendor/empire.systemedge.ntregperf.xml';
}
}


#NOT CONFIGURED## Empire DNLC
#NOT CONFIGURED# my $empireDnlc = $session->get_table( -baseoid =>
#NOT CONFIGURED# $dd->oiddef('empireDnlc') );
Expand Down Expand Up @@ -840,9 +831,9 @@ sub buildConfig
}
}

if( $devdetails->hasCap('empireNTREGPERF') )
if( $devdetails->hasCap('EmpireSystemedge::empireNTREGPERF') )
{
Debug("NTREGPERF");
Debug("EmpireSystemedge::NTREGPERF");
my $ntregTree = "NT_REG_PERF";
my $ntregParam = {
'precedence' => '-10000',
Expand Down

0 comments on commit ba958bd

Please sign in to comment.