syntaxer run

git-svn-id: http://www.observium.org/svn/observer/trunk@3218 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-05-20 23:14:08 +00:00
parent e4fa05f51d
commit 86348b92bb
11 changed files with 30 additions and 31 deletions

View File

@@ -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:

View File

@@ -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']); }

View File

@@ -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>');
?>

View File

@@ -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 {

View File

@@ -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

View File

@@ -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")

View File

@@ -1,4 +1,4 @@
<?php
<?php
# SNMPv2-MIB::sysDescr.0 = STRING: NRG MP C4500 1.60 / NRG Network Printer C model / NRG Network Scanner C model / NRG Network Facsimile C model
# SNMPv2-MIB::sysDescr.0 = STRING: NRG SP C410DN 1.01 / NRG Network Printer C model

View File

@@ -1,4 +1,4 @@
<?php
<?php
#SNMPv2-SMI::enterprises.8741.2.1.1.1.0 = STRING: "NSA 2400"
#SNMPv2-SMI::enterprises.8741.2.1.1.2.0 = STRING: "0017C599BD08"
@@ -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)";
?>

View File

@@ -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);

View File

@@ -56,12 +56,13 @@ if ($device['os_group'] == "unix")
include("unix-agent/packages.inc.php");
include("unix-agent/munin-plugins.inc.php");
foreach (array_keys($agent_data) as $key)
{
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");
}
}
@@ -144,7 +146,7 @@ if ($device['os_group'] == "unix")
}
}
}
if (!empty($agent_sensors))
{
echo("Sensors: ");

View File

@@ -14,7 +14,7 @@ if (count($disks))
list($blockdevice,$descr,$temperature,$unit) = explode('|',$disk,4);
$diskcount++;
discover_sensor($valid['sensor'], 'temperature', $device, '', $diskcount, 'hddtemp', "$blockdevice: $descr", '1', '1', NULL, NULL, NULL, NULL, $temperature, 'agent');
$agent_sensors['temperature']['hddtemp'][$diskcount] = array('description' => "$blockdevice: $descr", 'current' => $temperature, 'index' => $diskcount);
}
echo "\n";