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
+3 -4
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) function generate_entity_link($type, $entity, $text = NULL, $graph_type=NULL)
{ {
global $config; global $config, $entity_cache;
global $entity_cache;
if(is_numeric($entity)) if (is_numeric($entity))
{ {
$entity = get_entity_by_id_cache($type, $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); $link = generate_port_link($entity, $text, $graph_type);
break; break;
case "storage": 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')); $link = generate_link($text, array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'storage'));
break; break;
default: default:
-1
View File
@@ -308,7 +308,6 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
</li>'); </li>');
} }
if ($_SESSION['userlevel'] >= "7") if ($_SESSION['userlevel'] >= "7")
{ {
if (!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); } if (!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); }
+1 -2
View File
@@ -74,7 +74,7 @@ foreach ($glo_conditions as $type => $subtypes)
if (!empty($entities)) if (!empty($entities))
{ {
echo('<tr class=list><td></td><td colspan=9><strong>'); 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>"); 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>'); echo('</table>');
?> ?>
+1 -1
View File
@@ -170,7 +170,7 @@ function port_by_id_cache($port_id)
function table_from_entity_type($type) function table_from_entity_type($type)
{ {
/// Fuck you, english pluralisation. /// Fuck you, english pluralisation.
if($type == "storage") if ($type == "storage")
{ {
return $type; return $type;
} else { } else {
+1 -1
View File
@@ -97,7 +97,7 @@ $config['page_gen'] = 1;
$config['web_header'] = "header.inc.php"; # in html/includes $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['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_customers'] = 1; # Enable Customer Port Parsing
$config['int_transit'] = 1; # Enable Transit Types $config['int_transit'] = 1; # Enable Transit Types
+11 -11
View File
@@ -211,23 +211,23 @@ function addHost($host, $snmpver, $port = '161', $transport = 'udp')
{ {
// Try SNMPv2c // Try SNMPv2c
$snmpver = 'v2c'; $snmpver = 'v2c';
$ret = addHost($host, $snmpver); $ret = addHost($host, $snmpver);
if (!$ret) if (!$ret)
{ {
//Try SNMPv3 //Try SNMPv3
$snmpver = 'v3'; $snmpver = 'v3';
$ret = addHost($host, $snmpver); $ret = addHost($host, $snmpver);
if (!$ret) if (!$ret)
{ {
// Try SNMPv1 // Try SNMPv1
$snmpver = 'v1'; $snmpver = 'v1';
return addHost($host, $snmpver); return addHost($host, $snmpver);
} else { } else {
return $ret; return $ret;
} }
} else { } else {
return $ret; return $ret;
} }
} }
if ($snmpver === "v3") if ($snmpver === "v3")
+1 -1
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 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 # SNMPv2-MIB::sysDescr.0 = STRING: NRG SP C410DN 1.01 / NRG Network Printer C model
+6 -6
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.1.0 = STRING: "NSA 2400"
#SNMPv2-SMI::enterprises.8741.2.1.1.2.0 = STRING: "0017C599BD08" #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.3.0 = STRING: "SonicOS Enhanced 5.6.0.11-61o"
#SNMPv2-SMI::enterprises.8741.2.1.1.4.0 = STRING: "5.0.2.11" #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", "", ""),'" '); $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", "", ""),'" '); $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", "", ""),'" '); $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", "", ""),'" '); $romversion = trim(snmp_get($device, ".1.3.6.1.4.1.8741.2.1.1.4.0", "-OQv", "", ""),'" ');
$version="(Firmware $fwversion / Rom $romversion)"; $version = "(Firmware $fwversion / ROM $romversion)";
?> ?>
+1 -1
View File
@@ -324,7 +324,7 @@ foreach ($ports as $port)
$port['stats']['ifOutBits_rate'] = round($port['stats']['ifOutOctets_rate'] * 8); $port['stats']['ifOutBits_rate'] = round($port['stats']['ifOutOctets_rate'] * 8);
// If we have a valid ifSpeed we should populate the stats for checking. // 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']['ifInBits_perc'] = round($port['stats']['ifInBits_rate'] / $this_port['ifSpeed'] * 100);
$port['stats']['ifOutBits_perc'] = round($port['stats']['ifOutBits_rate'] / $this_port['ifSpeed'] * 100); $port['stats']['ifOutBits_perc'] = round($port['stats']['ifOutBits_rate'] / $this_port['ifSpeed'] * 100);
+4 -2
View File
@@ -56,12 +56,13 @@ if ($device['os_group'] == "unix")
include("unix-agent/packages.inc.php"); include("unix-agent/packages.inc.php");
include("unix-agent/munin-plugins.inc.php"); include("unix-agent/munin-plugins.inc.php");
foreach (array_keys($agent_data) as $key) foreach (array_keys($agent_data) as $key)
{ {
if (file_exists("includes/polling/unix-agent/$key.inc.php")) if (file_exists("includes/polling/unix-agent/$key.inc.php"))
{ {
if ($debug) { echo("Including: unix-agent/$key.inc.php"); } if ($debug) { echo("Including: unix-agent/$key.inc.php"); }
include("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 (file_exists("includes/polling/applications/$key.inc.php"))
{ {
if ($debug) { echo("Including: applications/$key.inc.php"); } if ($debug) { echo("Including: applications/$key.inc.php"); }
include("applications/$key.inc.php"); include("applications/$key.inc.php");
} }
} }
@@ -144,7 +146,7 @@ if ($device['os_group'] == "unix")
} }
} }
} }
if (!empty($agent_sensors)) if (!empty($agent_sensors))
{ {
echo("Sensors: "); echo("Sensors: ");
+1 -1
View File
@@ -14,7 +14,7 @@ if (count($disks))
list($blockdevice,$descr,$temperature,$unit) = explode('|',$disk,4); list($blockdevice,$descr,$temperature,$unit) = explode('|',$disk,4);
$diskcount++; $diskcount++;
discover_sensor($valid['sensor'], 'temperature', $device, '', $diskcount, 'hddtemp', "$blockdevice: $descr", '1', '1', NULL, NULL, NULL, NULL, $temperature, 'agent'); 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); $agent_sensors['temperature']['hddtemp'][$diskcount] = array('description' => "$blockdevice: $descr", 'current' => $temperature, 'index' => $diskcount);
} }
echo "\n"; echo "\n";