Roman Dmitriev пре 2 година
родитељ
комит
943b9f11b7
2 измењених фајлова са 10 додато и 5 уклоњено
  1. 1 0
      html/admin/devices/switchstatus.php
  2. 9 5
      html/inc/common.php

+ 1 - 0
html/admin/devices/switchstatus.php

@@ -189,6 +189,7 @@ print_editdevice_submenu($page_url, $id, $device['device_type'], $user_info['log
             if ($snmp_ok) {
                 //sfp information
                 $sfp_status = get_sfp_status($device['vendor_id'], $row['snmp_index'], $device['ip'], $device['community'], $device['snmp_version'], $modules_oids);
+
                 //poe information
                 if (isset($ports_poe_state)) {
                     if ($port_poe_by_snmp) { 

+ 9 - 5
html/inc/common.php

@@ -3064,9 +3064,10 @@ function get_ports_poe_detail($vendor_id, $ip, $community='public', $version='2'
                 $key = trim($key);
                 $p_power = parse_snmp_value($value);
                 $port = NULL;
-                $result[$port]['power']=0;
                 if (preg_match('/\.(\d{1,10})$/', $key, $matches)) {
                     $port = preg_replace('/^\./', '', $matches[0]);
+                    $result[$port]['power']=0;
+                    $result[$port]['power_display']='';
                     switch ($vendor_id) {
                         case 9://mikrotik
                             $p_power = round($p_power / 10, 2);
@@ -3095,9 +3096,10 @@ function get_ports_poe_detail($vendor_id, $ip, $community='public', $version='2'
                 $key = trim($key);
                 $p_current = parse_snmp_value($value);
                 $port = NULL;
-                $result[$port]['current']=0;
                 if (preg_match('/\.(\d{1,10})$/', $key, $matches)) {
                     $port = preg_replace('/^\./', '', $matches[0]);
+                    $result[$port]['current']=0;
+                    $result[$port]['current_display']='';
                     if ($p_current > 0) { 
                         $result[$port]['current'] = $p_current; 
                         $result[$port]['current_display'] = 'C: ' . $p_current . ' mA'; 
@@ -3115,9 +3117,10 @@ function get_ports_poe_detail($vendor_id, $ip, $community='public', $version='2'
                 $key = trim($key);
                 $p_volt = parse_snmp_value($value);
                 $port = NULL;
-                $result[$port]['volt'] = 0;
                 if (preg_match('/\.(\d{1,10})$/', $key, $matches)) {
                     $port = preg_replace('/^\./', '', $matches[0]);
+                    $result[$port]['volt'] = 0;
+                    $result[$port]['volt_display'] ='';
                     switch ($vendor_id) {
                         case 2:
                         case 8:
@@ -3148,9 +3151,10 @@ function get_ports_poe_detail($vendor_id, $ip, $community='public', $version='2'
                 $key = trim($key);
                 $p_class = parse_snmp_value($value);
                 $port = NULL;
-                $result[$port]['class'] = 0;
                 if (preg_match('/\.(\d{1,10})$/', $key, $matches)) {
                     $port = preg_replace('/^\./', '', $matches[0]);
+                    $result[$port]['class'] = 0;
+                    $result[$port]['class_display']='';
                     switch ($vendor_id) {
                         case 69:
                             if ($p_class > 0 and $result[$port]['power'] > 0) {
@@ -3177,7 +3181,7 @@ function get_ports_poe_detail($vendor_id, $ip, $community='public', $version='2'
         if (!isset($port['volt'])) { $port['volt'] = 0; }
         if (!isset($port['class'])) { $port['class'] = 0; }
     }
-    
+
     unset($port);
 
     return $result;