mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	Apply "Squiz" code style on old (pre-2014) files
This commit is contained in:
		@@ -1,33 +1,32 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
// Huawei VRP Processors
 | 
			
		||||
if($device['os'] == "vrp")
 | 
			
		||||
{
 | 
			
		||||
  echo("Huawei VRP ");
 | 
			
		||||
  $processors_array = snmpwalk_cache_multi_oid($device, "hwEntityCpuUsage", $processors_array, "HUAWEI-ENTITY-EXTENT-MIB" , '+'.$config['install_dir']."/mibs");
 | 
			
		||||
  $processors_array = snmpwalk_cache_multi_oid($device, "hwEntityMemSize", $processors_array, "HUAWEI-ENTITY-EXTENT-MIB" , '+'.$config['install_dir']."/mibs");
 | 
			
		||||
  $processors_array = snmpwalk_cache_multi_oid($device, "hwEntityBomEnDesc", $processors_array, "HUAWEI-ENTITY-EXTENT-MIB" , '+'.$config['install_dir']."/mibs");
 | 
			
		||||
  if ($debug) { print_r($processors_array); }
 | 
			
		||||
if ($device['os'] == 'vrp') {
 | 
			
		||||
    echo 'Huawei VRP ';
 | 
			
		||||
    $processors_array = snmpwalk_cache_multi_oid($device, 'hwEntityCpuUsage', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB', '+'.$config['install_dir'].'/mibs');
 | 
			
		||||
    $processors_array = snmpwalk_cache_multi_oid($device, 'hwEntityMemSize', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB', '+'.$config['install_dir'].'/mibs');
 | 
			
		||||
    $processors_array = snmpwalk_cache_multi_oid($device, 'hwEntityBomEnDesc', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB', '+'.$config['install_dir'].'/mibs');
 | 
			
		||||
    if ($debug) {
 | 
			
		||||
        print_r($processors_array);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (is_array($processors_array))
 | 
			
		||||
  {
 | 
			
		||||
    foreach ($processors_array as $index => $entry)
 | 
			
		||||
    {
 | 
			
		||||
      if ($entry['hwEntityMemSize'] != 0)
 | 
			
		||||
      {
 | 
			
		||||
        if ($debug) { echo($index . " " . $entry['hwEntityBomEnDesc'] . " -> " . $entry['hwEntityCpuUsage'] . " -> " . $entry['hwEntityMemSize']. "\n"); }
 | 
			
		||||
        $usage_oid = ".1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5." . $index;
 | 
			
		||||
        $descr = $entry['hwEntityBomEnDesc'];
 | 
			
		||||
        $usage = $entry['hwEntityCpuUsage'];
 | 
			
		||||
        if (!strstr($descr, "No") && !strstr($usage, "No") && $descr != "" )
 | 
			
		||||
    if (is_array($processors_array)) {
 | 
			
		||||
        foreach ($processors_array as $index => $entry)
 | 
			
		||||
        {
 | 
			
		||||
          discover_processor($valid['processor'], $device, $usage_oid, $index, "vrp", $descr, "1", $usage, NULL, NULL);
 | 
			
		||||
        }
 | 
			
		||||
      } // End if checks
 | 
			
		||||
    } // End Foreach
 | 
			
		||||
  } // End if array
 | 
			
		||||
} // End VRP Processors
 | 
			
		||||
            if ($entry['hwEntityMemSize'] != 0) { 
 | 
			
		||||
                if ($debug) {
 | 
			
		||||
                    echo $index.' '.$entry['hwEntityBomEnDesc'].' -> '.$entry['hwEntityCpuUsage'].' -> '.$entry['hwEntityMemSize']."\n";
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
unset ($processors_array);
 | 
			
		||||
                $usage_oid = '.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.'.$index;
 | 
			
		||||
                $descr     = $entry['hwEntityBomEnDesc'];
 | 
			
		||||
                $usage     = $entry['hwEntityCpuUsage'];
 | 
			
		||||
                if (!strstr($descr, 'No') && !strstr($usage, 'No') && $descr != '') {
 | 
			
		||||
                    discover_processor($valid['processor'], $device, $usage_oid, $index, 'vrp', $descr, '1', $usage, null, null);
 | 
			
		||||
                }
 | 
			
		||||
            } //end if
 | 
			
		||||
        } //end foreach
 | 
			
		||||
    } //end if
 | 
			
		||||
} //end if
 | 
			
		||||
 | 
			
		||||
?>
 | 
			
		||||
unset($processors_array);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user