Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

reworked EmpireSystemedge::empireNTREGPERF to use walkSnmpTable(); co…

…de parses, but I have no way to test it
  • Loading branch information...
commit ba958bd27011243a3daa55c8bd657d4c8bf9d04c 1 parent 778ee86
@medea61 medea61 authored
Showing with 21 additions and 30 deletions.
  1. +21 −30 src/perllib/Torrus/DevDiscover/EmpireSystemedge.pm
View
51 src/perllib/Torrus/DevDiscover/EmpireSystemedge.pm
@@ -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')) {
@@ -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') );
@@ -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',
Please sign in to comment.
Something went wrong with that request. Please try again.