Index: includes/definitions/mibs/nortel.inc.php
===================================================================
--- includes/definitions/mibs/nortel.inc.php (revision 10788)
+++ includes/definitions/mibs/nortel.inc.php (working copy)
@@ -70,7 +70,28 @@
$config['mibs'][$mib]['states'][$type][11] = array('name' => 'notConfig', 'event' => 'ignore');
$config['mibs'][$mib]['states'][$type][12] = array('name' => 'obsoleted', 'event' => 'alert');
+$type = 's5-chassis-mib-s5ChasBrdLedsStateBase';
+$config['mibs'][$mib]['states'][$type][1] = array('name' => 'off', 'event' => 'ignore');
+$config['mibs'][$mib]['states'][$type][2] = array('name' => 'green', 'event' => 'ok');
+$config['mibs'][$mib]['states'][$type][3] = array('name' => 'yellow', 'event' => 'alert');
+$config['mibs'][$mib]['states'][$type][4] = array('name' => 'blinkinggreen', 'event' => 'ok');
+$config['mibs'][$mib]['states'][$type][5] = array('name' => 'blinkingyellow', 'event' => 'alert');
+$type = 's5-chassis-mib-s5ChasBrdLedsStateUp';
+$config['mibs'][$mib]['states'][$type][1] = array('name' => 'off', 'event' => 'ignore');
+$config['mibs'][$mib]['states'][$type][2] = array('name' => 'green', 'event' => 'ok');
+$config['mibs'][$mib]['states'][$type][3] = array('name' => 'yellow', 'event' => 'alert');
+$config['mibs'][$mib]['states'][$type][4] = array('name' => 'blinkinggreen', 'event' => 'ok');
+$config['mibs'][$mib]['states'][$type][5] = array('name' => 'blinkingyellow', 'event' => 'alert');
+
+$type = 's5-chassis-mib-s5ChasBrdLedsStateDown';
+$config['mibs'][$mib]['states'][$type][1] = array('name' => 'off', 'event' => 'ignore');
+$config['mibs'][$mib]['states'][$type][2] = array('name' => 'green', 'event' => 'ok');
+$config['mibs'][$mib]['states'][$type][3] = array('name' => 'yellow', 'event' => 'alert');
+$config['mibs'][$mib]['states'][$type][4] = array('name' => 'blinkinggreen', 'event' => 'ok');
+$config['mibs'][$mib]['states'][$type][5] = array('name' => 'blinkingyellow', 'event' => 'alert');
+
+
$mib = 'RAPID-CITY';
$config['mibs'][$mib]['enable'] = 1;
$config['mibs'][$mib]['identity_num'] = array('.1.3.6.1.4.1.2272', // RAPID-CITY::rapidCity (MODULE-IDENTITY)
Index: includes/discovery/status/s5-chassis-mib.inc.php
===================================================================
--- includes/discovery/status/s5-chassis-mib.inc.php (nonexistent)
+++ includes/discovery/status/s5-chassis-mib.inc.php (working copy)
@@ -0,0 +1,114 @@
+<?php
+
+/**
+ * Observium
+ *
+ * This file is part of Observium.
+ *
+ * @package observium
+ * @subpackage discovery
+ * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
+ *
+ */
+
+$led_array = snmpwalk_cache_oid($device, 's5ChasBrdLeds', array(), $mib);
+
+
+// S5-CHASSIS-MIB::s5ChasGrpDescr.8 = STRING: Unit Group
+// S5-CHASSIS-MIB::s5ChasGrpNumEnts.8 = INTEGER: 3
+
+// S5-CHASSIS-MIB::s5ChasBrdLeds.10 = Hex-STRING: 00 00 11 01 11 00 11 00 10 20 00 00 00 00 00 50
+// 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+// 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+// 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 50
+// 00 00 00 00
+// S5-CHASSIS-MIB::s5ChasBrdLeds.20 = Hex-STRING: 00 00 11 21 11 00 11 00 10 00 00 00 00 00 00 00
+// 00 00 00 00 00 00 00 00 01 00 00 00 00 00 05 00
+// 00 00 00 02 00 00 00 00 00 05 00 00 00 00 00 00
+// 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+// 00 00 00 00
+// S5-CHASSIS-MIB::s5ChasBrdLeds.30 = Hex-STRING: 00 00 11 01 11 00 11 00 10 00 00 00 00 00 00 00
+// 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+// 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+// 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 50
+// 00 00 00 00
+
+/*
+FROM MIB:
+1.3.6.1.4.1.45.1.6.3.4.1.1.2 's5ChasBrdLeds'
+
+"A bit array that contains the value of the front panel LEDs and the annunciator. This is a packed bit string; each LED is encoded into 4 bits (a nibble). The first nibble is stored in the high order bits of the first octet. The second nibble is stored in the low order bits the first octet, etc. However, the current mapping is that the first three nibbles are reserved, the fourth nibble has the value of the 'annunciator', and the 'normal' LEDs start with the fifth nibble. If the LED values are not available, a zero length string is returned. The following shows the meaning of each bit (bit 0 is the least significant bit) when it has a value of one:
+
+ bit meaning
+ --- -------
+ 0 green light
+ 1 yellow light
+ 2 blinking
+ 3 reserved"
+
+ Front Panel LED Nibble in BitString (s5ChasBrdLeds)
+ ERS 5500 ERS 5600 ERS 3600 ERS 4900
+Power 5 5 5 ?
+Cascade Up 6 6 6 5
+Status 7 7 7 ?
+Cascade Down 8 8 8 6
+RPSU 9 9 9 ?
+Base Unit 10 10 10 7
+
+*/
+if (is_array($led_array))
+{
+ foreach ($led_array as $index => $entry)
+ {
+ $nibblestring = preg_replace('![^0-9]!', '', implode('', explode(' ', $entry['s5ChasBrdLeds'])));
+ $nibblearray = array();
+
+ for ($i = 0; $i < strlen($nibblestring); ++$i)
+ {
+ $nibble = array();
+ $nibble['nibble'] = str_pad(base_convert($nibblestring[$i], 16, 2), 4, 0, STR_PAD_LEFT);
+ $bit0 = $nibblestring[$i] & 1;
+ $bit1 = $nibblestring[$i] >> 1 & 1;
+ $bit2 = $nibblestring[$i] >> 2 & 1;
+ $status = "";
+ if($bit0 == 0 && $bit1 == 0)
+ {
+ $status = "off";
+ } else if($bit0 == 1 && $bit2 == 0)
+ {
+ $status = "green";
+ } else if($bit1 == 1 && $bit2 == 0)
+ {
+ $status = "yellow";
+ } else if($bit0 == 1 && $bit2 == 1)
+ {
+ $status = "greenblinking";
+ } else if($bit1 == 1 && $bit2 == 1)
+ {
+ $status = "yellowblinking";
+ }
+ $nibble['status'] = $status;
+ $nibblearray[] = $nibble;
+ }
+
+ // ERS 4950
+ if($device['sysObjectID'] == '.1.3.6.1.4.1.45.3.82.4')
+ {
+ $led_base = $nibblearray[6]['status'];
+ $led_up = $nibblearray[4]['status'];
+ $led_down = $nibblearray[5]['status'];
+ } else
+ {
+ $led_base = $nibblearray[9]['status'];
+ $led_up = $nibblearray[5]['status'];
+ $led_down = $nibblearray[7]['status'];
+ }
+ discover_status_ng($device, $mib, 's5ChasBrdLeds', '1.3.6.1.4.1.45.1.6.3.4.1.1.2.'.$index, $index, 's5-chassis-mib-s5ChasBrdLedsStateBase', "Unit ".($index/10)." - LED Base", $led_base, array('entPhysicalClass' => 'led', 'entPhysicalIndex' => $index));
+ discover_status_ng($device, $mib, 's5ChasBrdLeds', '1.3.6.1.4.1.45.1.6.3.4.1.1.2.'.$index, $index, 's5-chassis-mib-s5ChasBrdLedsStateUp', "Unit ".($index/10)." - LED Cascade Up", $led_up, array('entPhysicalClass' => 'led', 'entPhysicalIndex' => $index));
+ discover_status_ng($device, $mib, 's5ChasBrdLeds', '1.3.6.1.4.1.45.1.6.3.4.1.1.2.'.$index, $index, 's5-chassis-mib-s5ChasBrdLedsStateDown', "Unit ".($index/10)." - LED Cascade Down", $led_down, array('entPhysicalClass' => 'led', 'entPhysicalIndex' => $index));
+ }
+}
+
+unset ($led_array, $index, $led_base, $led_up, $led_down, $status, $bit0, $bit1, $bit2, $nibble, $nibblearray, $nibblestring);
+
+// EOF
Index: includes/polling/status/s5-chassis-mib-s5ChasBrdLedsState.inc.php
===================================================================
--- includes/polling/status/s5-chassis-mib-s5ChasBrdLedsState.inc.php (nonexistent)
+++ includes/polling/status/s5-chassis-mib-s5ChasBrdLedsState.inc.php (working copy)
@@ -0,0 +1,77 @@
+<?php
+
+/**
+ * Observium
+ *
+ * This file is part of Observium.
+ *
+ * @package observium
+ * @subpackage discovery
+ * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
+ *
+ */
+
+//$led_array = snmpwalk_cache_oid($device, 's5ChasBrdLeds', array(), $mib);
+print_debug("TESTING");
+$index = $status_db['status_oid'];
+echo "TESTING: Index: \r\n";
+echo $index;
+
+
+/*
+if (is_array($led_array))
+{
+ foreach ($led_array as $index => $entry)
+ {
+ $nibblestring = preg_replace('![^0-9]!', '', implode('', explode(' ', $entry['s5ChasBrdLeds'])));
+ $nibblearray = array();
+
+ for ($i = 0; $i < strlen($nibblestring); ++$i)
+ {
+ $nibble = array();
+ $nibble['nibble'] = str_pad(base_convert($nibblestring[$i], 16, 2), 4, 0, STR_PAD_LEFT);
+ $bit0 = $nibblestring[$i] & 1;
+ $bit1 = $nibblestring[$i] >> 1 & 1;
+ $bit2 = $nibblestring[$i] >> 2 & 1;
+ $status = "";
+ if($bit0 == 0 && $bit1 == 0)
+ {
+ $status = "off";
+ } else if($bit0 == 1 && $bit2 == 0)
+ {
+ $status = "green";
+ } else if($bit1 == 1 && $bit2 == 0)
+ {
+ $status = "yellow";
+ } else if($bit0 == 1 && $bit2 == 1)
+ {
+ $status = "greenblinking";
+ } else if($bit1 == 1 && $bit2 == 1)
+ {
+ $status = "yellowblinking";
+ }
+ $nibble['status'] = $status;
+ $nibblearray[] = $nibble;
+ }
+
+ // ERS 4950
+ if($device['sysObjectID'] == '.1.3.6.1.4.1.45.3.82.4')
+ {
+ $led_base = $nibblearray[6]['status'];
+ $led_up = $nibblearray[4]['status'];
+ $led_down = $nibblearray[5]['status'];
+ } else
+ {
+ $led_base = $nibblearray[9]['status'];
+ $led_up = $nibblearray[5]['status'];
+ $led_down = $nibblearray[7]['status'];
+ }
+ discover_status_ng($device, $mib, 's5ChasBrdLedsBase', '1.3.6.1.4.1.45.1.6.3.4.1.1.2', $index, 's5ChasBrdLedsState', "Unit ".($index/10)." - LED Base", $led_base, NULL);
+ discover_status_ng($device, $mib, 's5ChasBrdLedsUp', '1.3.6.1.4.1.45.1.6.3.4.1.1.2', $index, 's5ChasBrdLedsState', "Unit ".($index/10)." - LED Cascade Up", $led_up, array('entPhysicalClass' => 'stack', 'entPhysicalIndex' => $index));
+ discover_status_ng($device, $mib, 's5ChasBrdLedsDown', '1.3.6.1.4.1.45.1.6.3.4.1.1.2', $index, 's5ChasBrdLedsState', "Unit ".($index/10)." - LED Cascade Down", $led_down, array('entPhysicalClass' => 'stack', 'entPhysicalIndex' => $index));
+ }
+}
+*/
+unset ($led_array, $index, $led_base, $led_up, $led_down, $status, $bit0, $bit1, $bit2, $nibble, $nibblearray, $nibblestring);
+
+// EOF
Index: includes/polling/status/s5-chassis-mib-s5ChasBrdLedsStateBase.inc.php
===================================================================
--- includes/polling/status/s5-chassis-mib-s5ChasBrdLedsStateBase.inc.php (nonexistent)
+++ includes/polling/status/s5-chassis-mib-s5ChasBrdLedsStateBase.inc.php (working copy)
@@ -0,0 +1,65 @@
+<?php
+
+/**
+ * Observium
+ *
+ * This file is part of Observium.
+ *
+ * @package observium
+ * @subpackage discovery
+ * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
+ *
+ */
+
+$index = $status_db['status_oid'];
+$leds = snmp_get($device, $index, '-Ovq', 'S5-CHASSIS-MIB');
+
+$nibblestring = preg_replace('![^0-9]!', '', implode('', explode(' ', $leds)));
+$nibblearray = array();
+
+for ($i = 0; $i < strlen($nibblestring); ++$i)
+{
+ $nibble = array();
+ $nibble['nibble'] = str_pad(base_convert($nibblestring[$i], 16, 2), 4, 0, STR_PAD_LEFT);
+ $bit0 = $nibblestring[$i] & 1;
+ $bit1 = $nibblestring[$i] >> 1 & 1;
+ $bit2 = $nibblestring[$i] >> 2 & 1;
+ $status = "";
+ if($bit0 == 0 && $bit1 == 0)
+ {
+ $status = "off";
+ } else if($bit0 == 1 && $bit2 == 0)
+ {
+ $status = "green";
+ } else if($bit1 == 1 && $bit2 == 0)
+ {
+ $status = "yellow";
+ } else if($bit0 == 1 && $bit2 == 1)
+ {
+ $status = "greenblinking";
+ } else if($bit1 == 1 && $bit2 == 1)
+ {
+ $status = "yellowblinking";
+ }
+ $nibble['status'] = $status;
+ $nibblearray[] = $nibble;
+}
+
+// ERS 4950
+if($device['sysObjectID'] == '.1.3.6.1.4.1.45.3.82.4')
+{
+ $led_base = $nibblearray[6]['status'];
+ $led_up = $nibblearray[4]['status'];
+ $led_down = $nibblearray[5]['status'];
+} else
+{
+ $led_base = $nibblearray[9]['status'];
+ $led_up = $nibblearray[5]['status'];
+ $led_down = $nibblearray[7]['status'];
+}
+
+$status_value = $led_base;
+
+unset ($leds, $index, $led_base, $led_up, $led_down, $status, $bit0, $bit1, $bit2, $nibble, $nibblearray, $nibblestring);
+
+// EOF
Index: includes/polling/status/s5-chassis-mib-s5ChasBrdLedsStateDown.inc.php
===================================================================
--- includes/polling/status/s5-chassis-mib-s5ChasBrdLedsStateDown.inc.php (nonexistent)
+++ includes/polling/status/s5-chassis-mib-s5ChasBrdLedsStateDown.inc.php (working copy)
@@ -0,0 +1,65 @@
+<?php
+
+/**
+ * Observium
+ *
+ * This file is part of Observium.
+ *
+ * @package observium
+ * @subpackage discovery
+ * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
+ *
+ */
+
+$index = $status_db['status_oid'];
+$leds = snmp_get($device, $index, '-Ovq', 'S5-CHASSIS-MIB');
+
+$nibblestring = preg_replace('![^0-9]!', '', implode('', explode(' ', $leds)));
+$nibblearray = array();
+
+for ($i = 0; $i < strlen($nibblestring); ++$i)
+{
+ $nibble = array();
+ $nibble['nibble'] = str_pad(base_convert($nibblestring[$i], 16, 2), 4, 0, STR_PAD_LEFT);
+ $bit0 = $nibblestring[$i] & 1;
+ $bit1 = $nibblestring[$i] >> 1 & 1;
+ $bit2 = $nibblestring[$i] >> 2 & 1;
+ $status = "";
+ if($bit0 == 0 && $bit1 == 0)
+ {
+ $status = "off";
+ } else if($bit0 == 1 && $bit2 == 0)
+ {
+ $status = "green";
+ } else if($bit1 == 1 && $bit2 == 0)
+ {
+ $status = "yellow";
+ } else if($bit0 == 1 && $bit2 == 1)
+ {
+ $status = "greenblinking";
+ } else if($bit1 == 1 && $bit2 == 1)
+ {
+ $status = "yellowblinking";
+ }
+ $nibble['status'] = $status;
+ $nibblearray[] = $nibble;
+}
+
+// ERS 4950
+if($device['sysObjectID'] == '.1.3.6.1.4.1.45.3.82.4')
+{
+ $led_base = $nibblearray[6]['status'];
+ $led_up = $nibblearray[4]['status'];
+ $led_down = $nibblearray[5]['status'];
+} else
+{
+ $led_base = $nibblearray[9]['status'];
+ $led_up = $nibblearray[5]['status'];
+ $led_down = $nibblearray[7]['status'];
+}
+
+$status_value = $led_down;
+
+unset ($leds, $index, $led_base, $led_up, $led_down, $status, $bit0, $bit1, $bit2, $nibble, $nibblearray, $nibblestring);
+
+// EOF
Index: includes/polling/status/s5-chassis-mib-s5ChasBrdLedsStateUp.inc.php
===================================================================
--- includes/polling/status/s5-chassis-mib-s5ChasBrdLedsStateUp.inc.php (nonexistent)
+++ includes/polling/status/s5-chassis-mib-s5ChasBrdLedsStateUp.inc.php (working copy)
@@ -0,0 +1,65 @@
+<?php
+
+/**
+ * Observium
+ *
+ * This file is part of Observium.
+ *
+ * @package observium
+ * @subpackage discovery
+ * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
+ *
+ */
+
+$index = $status_db['status_oid'];
+$leds = snmp_get($device, $index, '-Ovq', 'S5-CHASSIS-MIB');
+
+$nibblestring = preg_replace('![^0-9]!', '', implode('', explode(' ', $leds)));
+$nibblearray = array();
+
+for ($i = 0; $i < strlen($nibblestring); ++$i)
+{
+ $nibble = array();
+ $nibble['nibble'] = str_pad(base_convert($nibblestring[$i], 16, 2), 4, 0, STR_PAD_LEFT);
+ $bit0 = $nibblestring[$i] & 1;
+ $bit1 = $nibblestring[$i] >> 1 & 1;
+ $bit2 = $nibblestring[$i] >> 2 & 1;
+ $status = "";
+ if($bit0 == 0 && $bit1 == 0)
+ {
+ $status = "off";
+ } else if($bit0 == 1 && $bit2 == 0)
+ {
+ $status = "green";
+ } else if($bit1 == 1 && $bit2 == 0)
+ {
+ $status = "yellow";
+ } else if($bit0 == 1 && $bit2 == 1)
+ {
+ $status = "greenblinking";
+ } else if($bit1 == 1 && $bit2 == 1)
+ {
+ $status = "yellowblinking";
+ }
+ $nibble['status'] = $status;
+ $nibblearray[] = $nibble;
+}
+
+// ERS 4950
+if($device['sysObjectID'] == '.1.3.6.1.4.1.45.3.82.4')
+{
+ $led_base = $nibblearray[6]['status'];
+ $led_up = $nibblearray[4]['status'];
+ $led_down = $nibblearray[5]['status'];
+} else
+{
+ $led_base = $nibblearray[9]['status'];
+ $led_up = $nibblearray[5]['status'];
+ $led_down = $nibblearray[7]['status'];
+}
+
+$status_value = $led_up;
+
+unset ($leds, $index, $led_base, $led_up, $led_down, $status, $bit0, $bit1, $bit2, $nibble, $nibblearray, $nibblestring);
+
+// EOF
Index: includes/polling/status/s5-chassis-mib.inc.php
===================================================================
--- includes/polling/status/s5-chassis-mib.inc.php (nonexistent)
+++ includes/polling/status/s5-chassis-mib.inc.php (working copy)
@@ -0,0 +1,78 @@
+<?php
+
+/**
+ * Observium
+ *
+ * This file is part of Observium.
+ *
+ * @package observium
+ * @subpackage discovery
+ * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
+ *
+ */
+
+//$led_array = snmpwalk_cache_oid($device, 's5ChasBrdLeds', array(), $mib);
+print_debug("TESTING");
+print_r($status_db);
+$index = $status_db['status_oid'];
+echo "TESTING: Index: \r\n";
+echo $index;
+exit();
+
+/*
+if (is_array($led_array))
+{
+ foreach ($led_array as $index => $entry)
+ {
+ $nibblestring = preg_replace('![^0-9]!', '', implode('', explode(' ', $entry['s5ChasBrdLeds'])));
+ $nibblearray = array();
+
+ for ($i = 0; $i < strlen($nibblestring); ++$i)
+ {
+ $nibble = array();
+ $nibble['nibble'] = str_pad(base_convert($nibblestring[$i], 16, 2), 4, 0, STR_PAD_LEFT);
+ $bit0 = $nibblestring[$i] & 1;
+ $bit1 = $nibblestring[$i] >> 1 & 1;
+ $bit2 = $nibblestring[$i] >> 2 & 1;
+ $status = "";
+ if($bit0 == 0 && $bit1 == 0)
+ {
+ $status = "off";
+ } else if($bit0 == 1 && $bit2 == 0)
+ {
+ $status = "green";
+ } else if($bit1 == 1 && $bit2 == 0)
+ {
+ $status = "yellow";
+ } else if($bit0 == 1 && $bit2 == 1)
+ {
+ $status = "greenblinking";
+ } else if($bit1 == 1 && $bit2 == 1)
+ {
+ $status = "yellowblinking";
+ }
+ $nibble['status'] = $status;
+ $nibblearray[] = $nibble;
+ }
+
+ // ERS 4950
+ if($device['sysObjectID'] == '.1.3.6.1.4.1.45.3.82.4')
+ {
+ $led_base = $nibblearray[6]['status'];
+ $led_up = $nibblearray[4]['status'];
+ $led_down = $nibblearray[5]['status'];
+ } else
+ {
+ $led_base = $nibblearray[9]['status'];
+ $led_up = $nibblearray[5]['status'];
+ $led_down = $nibblearray[7]['status'];
+ }
+ discover_status_ng($device, $mib, 's5ChasBrdLedsBase', '1.3.6.1.4.1.45.1.6.3.4.1.1.2', $index, 's5ChasBrdLedsState', "Unit ".($index/10)." - LED Base", $led_base, NULL);
+ discover_status_ng($device, $mib, 's5ChasBrdLedsUp', '1.3.6.1.4.1.45.1.6.3.4.1.1.2', $index, 's5ChasBrdLedsState', "Unit ".($index/10)." - LED Cascade Up", $led_up, array('entPhysicalClass' => 'stack', 'entPhysicalIndex' => $index));
+ discover_status_ng($device, $mib, 's5ChasBrdLedsDown', '1.3.6.1.4.1.45.1.6.3.4.1.1.2', $index, 's5ChasBrdLedsState', "Unit ".($index/10)." - LED Cascade Down", $led_down, array('entPhysicalClass' => 'stack', 'entPhysicalIndex' => $index));
+ }
+}
+*/
+unset ($led_array, $index, $led_base, $led_up, $led_down, $status, $bit0, $bit1, $bit2, $nibble, $nibblearray, $nibblestring);
+
+// EOF