mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 16:26:55 +02:00
syntaxer run
git-svn-id: http://www.observium.org/svn/observer/trunk@3218 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -343,10 +343,9 @@ function print_percentage_bar($width, $height, $percent, $left_text, $left_colou
|
||||
|
||||
function generate_entity_link($type, $entity, $text = NULL, $graph_type=NULL)
|
||||
{
|
||||
global $config;
|
||||
global $entity_cache;
|
||||
global $config, $entity_cache;
|
||||
|
||||
if(is_numeric($entity))
|
||||
if (is_numeric($entity))
|
||||
{
|
||||
$entity = get_entity_by_id_cache($type, $entity);
|
||||
}
|
||||
@@ -357,7 +356,7 @@ function generate_entity_link($type, $entity, $text = NULL, $graph_type=NULL)
|
||||
$link = generate_port_link($entity, $text, $graph_type);
|
||||
break;
|
||||
case "storage":
|
||||
if(empty($text)) { $text = $entity['storage_descr']; }
|
||||
if (empty($text)) { $text = $entity['storage_descr']; }
|
||||
$link = generate_link($text, array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'storage'));
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -308,7 +308,6 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
</li>');
|
||||
}
|
||||
|
||||
|
||||
if ($_SESSION['userlevel'] >= "7")
|
||||
{
|
||||
if (!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); }
|
||||
|
||||
@@ -74,7 +74,7 @@ foreach ($glo_conditions as $type => $subtypes)
|
||||
if (!empty($entities))
|
||||
{
|
||||
echo('<tr class=list><td></td><td colspan=9><strong>');
|
||||
foreach ($entities as $entity)
|
||||
foreach ($entities as $entity)
|
||||
{
|
||||
echo('<span style="padding:3px 5px; margin: 0px 3px; background-color: #e5e5e5;">'.generate_entity_link($type, $entity)."</span>");
|
||||
}
|
||||
@@ -85,7 +85,6 @@ foreach ($glo_conditions as $type => $subtypes)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo('</table>');
|
||||
|
||||
?>
|
||||
|
||||
+1
-1
@@ -170,7 +170,7 @@ function port_by_id_cache($port_id)
|
||||
function table_from_entity_type($type)
|
||||
{
|
||||
/// Fuck you, english pluralisation.
|
||||
if($type == "storage")
|
||||
if ($type == "storage")
|
||||
{
|
||||
return $type;
|
||||
} else {
|
||||
|
||||
@@ -97,7 +97,7 @@ $config['page_gen'] = 1;
|
||||
$config['web_header'] = "header.inc.php"; # in html/includes
|
||||
$config['login_message'] = "Unauthorised access or use shall render the user liable to criminal and/or civil prosecution.";
|
||||
|
||||
$config['old_graphs'] = 1; ## RRDfiles from before the great rra reform. This is default for a while.
|
||||
$config['old_graphs'] = 1; ## RRDfiles from before the great rra reform. This is default for a while.
|
||||
|
||||
$config['int_customers'] = 1; # Enable Customer Port Parsing
|
||||
$config['int_transit'] = 1; # Enable Transit Types
|
||||
|
||||
+11
-11
@@ -211,23 +211,23 @@ function addHost($host, $snmpver, $port = '161', $transport = 'udp')
|
||||
{
|
||||
// Try SNMPv2c
|
||||
$snmpver = 'v2c';
|
||||
$ret = addHost($host, $snmpver);
|
||||
if (!$ret)
|
||||
$ret = addHost($host, $snmpver);
|
||||
if (!$ret)
|
||||
{
|
||||
//Try SNMPv3
|
||||
$snmpver = 'v3';
|
||||
$ret = addHost($host, $snmpver);
|
||||
if (!$ret)
|
||||
$ret = addHost($host, $snmpver);
|
||||
if (!$ret)
|
||||
{
|
||||
// Try SNMPv1
|
||||
$snmpver = 'v1';
|
||||
return addHost($host, $snmpver);
|
||||
} else {
|
||||
return $ret;
|
||||
}
|
||||
} else {
|
||||
return $ret;
|
||||
}
|
||||
return addHost($host, $snmpver);
|
||||
} else {
|
||||
return $ret;
|
||||
}
|
||||
} else {
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
if ($snmpver === "v3")
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
#SNMPv2-SMI::enterprises.8741.2.1.1.3.0 = STRING: "SonicOS Enhanced 5.6.0.11-61o"
|
||||
#SNMPv2-SMI::enterprises.8741.2.1.1.4.0 = STRING: "5.0.2.11"
|
||||
|
||||
$hardware=trim(snmp_get($device, ".1.3.6.1.4.1.8741.2.1.1.1.0", "-OQv", "", ""),'" ');
|
||||
$serial=trim(snmp_get($device, ".1.3.6.1.4.1.8741.2.1.1.2.0", "-OQv", "", ""),'" ');
|
||||
$fwversion=trim(snmp_get($device, ".1.3.6.1.4.1.8741.2.1.1.3.0", "-OQv", "", ""),'" ');
|
||||
$romversion=trim(snmp_get($device, ".1.3.6.1.4.1.8741.2.1.1.4.0", "-OQv", "", ""),'" ');
|
||||
$version="(Firmware $fwversion / Rom $romversion)";
|
||||
$hardware = trim(snmp_get($device, ".1.3.6.1.4.1.8741.2.1.1.1.0", "-OQv", "", ""),'" ');
|
||||
$serial = trim(snmp_get($device, ".1.3.6.1.4.1.8741.2.1.1.2.0", "-OQv", "", ""),'" ');
|
||||
$fwversion = trim(snmp_get($device, ".1.3.6.1.4.1.8741.2.1.1.3.0", "-OQv", "", ""),'" ');
|
||||
$romversion = trim(snmp_get($device, ".1.3.6.1.4.1.8741.2.1.1.4.0", "-OQv", "", ""),'" ');
|
||||
$version = "(Firmware $fwversion / ROM $romversion)";
|
||||
|
||||
?>
|
||||
|
||||
@@ -324,7 +324,7 @@ foreach ($ports as $port)
|
||||
$port['stats']['ifOutBits_rate'] = round($port['stats']['ifOutOctets_rate'] * 8);
|
||||
|
||||
// If we have a valid ifSpeed we should populate the stats for checking.
|
||||
if(is_numeric($this_port['ifSpeed']))
|
||||
if (is_numeric($this_port['ifSpeed']))
|
||||
{
|
||||
$port['stats']['ifInBits_perc'] = round($port['stats']['ifInBits_rate'] / $this_port['ifSpeed'] * 100);
|
||||
$port['stats']['ifOutBits_perc'] = round($port['stats']['ifOutBits_rate'] / $this_port['ifSpeed'] * 100);
|
||||
|
||||
@@ -62,6 +62,7 @@ if ($device['os_group'] == "unix")
|
||||
if (file_exists("includes/polling/unix-agent/$key.inc.php"))
|
||||
{
|
||||
if ($debug) { echo("Including: unix-agent/$key.inc.php"); }
|
||||
|
||||
include("unix-agent/$key.inc.php");
|
||||
}
|
||||
}
|
||||
@@ -71,6 +72,7 @@ if ($device['os_group'] == "unix")
|
||||
if (file_exists("includes/polling/applications/$key.inc.php"))
|
||||
{
|
||||
if ($debug) { echo("Including: applications/$key.inc.php"); }
|
||||
|
||||
include("applications/$key.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user