aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/config.pm29
-rwxr-xr-xinclude/nms.pm7
-rw-r--r--include/nms/util.pm16
3 files changed, 42 insertions, 10 deletions
diff --git a/include/config.pm b/include/config.pm
index 2a65c94..a45caf9 100755
--- a/include/config.pm
+++ b/include/config.pm
@@ -50,7 +50,34 @@ our @snmp_objects = [
['jnxOperatingTemp'],
['jnxOperatingCPU'],
['jnxOperatingDescr'],
- ['jnxBoxSerialNo']
+ ['jnxBoxSerialNo'],
+ ['jnxVirtualChassisFpcId'],
+ ['jnxVirtualChassisPortName'],
+ ['jnxVirtualChassisPortAdminStatus'],
+ ['jnxVirtualChassisPortOperStatus'],
+ ['jnxVirtualChassisPortInPkts'],
+ ['jnxVirtualChassisPortOutPkts'],
+ ['jnxVirtualChassisPortInOctets'],
+ ['jnxVirtualChassisPortOutOctets'],
+ ['jnxVirtualChassisPortInMcasts'],
+ ['jnxVirtualChassisPortOutMcasts'],
+ ['jnxVirtualChassisPortInPkts1secRate'],
+ ['jnxVirtualChassisPortOutPkts1secRate'],
+ ['jnxVirtualChassisPortInOctets1secRate'],
+ ['jnxVirtualChassisPortOutOctets1secRate'],
+ ['jnxVirtualChassisPortCarrierTrans'],
+ ['jnxVirtualChassisPortInCRCAlignErrors'],
+ ['jnxVirtualChassisPortUndersizePkts'],
+ ['jnxVirtualChassisPortCollisions'],
+ ['jnxVirtualChassisMemberFabricMode'],
+ ['jnxVirtualChassisMemberLocation'],
+ ['jnxVirtualChassisMemberMixedMode'],
+ ['jnxVirtualChassisMemberModel'],
+ ['jnxVirtualChassisMemberPriority'],
+ ['jnxVirtualChassisMemberRole'],
+ ['jnxVirtualChassisMemberSerialnumber'],
+ ['jnxVirtualChassisMemberSWVersion'],
+ ['jnxVirtualChassisMemberUptime']
];
BEGIN {
diff --git a/include/nms.pm b/include/nms.pm
index eff61c3..3133042 100755
--- a/include/nms.pm
+++ b/include/nms.pm
@@ -8,7 +8,7 @@ use JSON;
package nms;
use base 'Exporter';
-our @EXPORT = qw(db_connect convert_mac);
+our @EXPORT = qw(db_connect convert_mac convert_decimal);
BEGIN {
require "config.pm";
@@ -54,6 +54,11 @@ sub convert_addr {
}
}
+# I am not a perl programmer
+sub convert_decimal {
+ return join("",(map { sprintf "%c", $_ } split(/\./,shift)));
+}
+
# Convert raw binary SNMP data to list of bits.
sub convert_bytelist {
return split //, unpack("B*", shift);
diff --git a/include/nms/util.pm b/include/nms/util.pm
index 3e8596e..511da33 100644
--- a/include/nms/util.pm
+++ b/include/nms/util.pm
@@ -17,7 +17,7 @@ sub parse_switch {
'mgmt_v4_addr' => "$mgtmt4",
'mgmt_v6_addr' => "$mgtmt6",
'traffic_vlan' => "$lolid",
- 'distro' => "$distro"
+ 'distro_name' => "$distro"
);
%{$ret{'placement'}} = guess_placement($switch);
return %ret;
@@ -132,10 +132,10 @@ sub guess_placement_tg {
$x = int(292 + (($e-1)/2) * 31.1);
$y = undef;
- $x += 14 if ($e >= 13);
- $x += 14 if ($e >= 25);
- $x += 14 if ($e >= 41);
- $x += 14 if ($e >= 59);
+ $x += 14 if ($e >= 21);
+ $x += 14 if ($e >= 37);
+ $x += 14 if ($e >= 55);
+ $x += 14 if ($e >= 69);
if ($s > 2) {
$y = 405 - 120 * ($s-2);
@@ -151,9 +151,9 @@ sub guess_placement_tg {
$y += 20 if $name eq "e3-4";
$y += 15 if $name eq "e5-4";
$yy -= 25 if $name eq "e7-1";
- $y += 10 if $name eq "e5-2";
- $yy -= 25 if $name eq "e5-2";
- $y += 20 if ($e >= 81 and $s == 2);
+ $yy -= 25 if $name eq "e5-1";
+ $yy -= 25 if $name eq "e3-1";
+ $y += 20 if ($e >= 79 and $s == 2);
$yy -= 20 if ($e >= 79 and $s == 1);
$yy -= 30 if ($e >= 81 and $s == 1);