From 0b99608227d53c9eebb01fd7f98d1618cbb7a2cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Lyngst=C3=B8l?= Date: Sun, 16 Apr 2017 01:47:57 +0200 Subject: TG17 monster commit --- include/config.pm | 20 +++++++++++++++++++- include/nms.pm | 7 ++++++- include/nms/util.pm | 14 +++++++------- 3 files changed, 32 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/config.pm b/include/config.pm index 2a65c94..ec4a634 100755 --- a/include/config.pm +++ b/include/config.pm @@ -50,7 +50,25 @@ 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'] ]; 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 1cc34e9..511da33 100644 --- a/include/nms/util.pm +++ b/include/nms/util.pm @@ -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); -- cgit v1.2.3