syntaxer run

git-svn-id: http://www.observium.org/svn/observer/trunk@2580 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-09-26 16:06:18 +00:00
parent 6a8f2362a2
commit 6b8cba3d24
11 changed files with 43 additions and 43 deletions

View File

@@ -126,10 +126,10 @@ function get_userlist()
global $config, $ds;
$filter = '(' . $config['auth_ldap_prefix'] . '*)';
$search = ldap_search($ds, trim($config['auth_ldap_suffix'],','), $filter);
$entries = ldap_get_entries($ds, $search);
if ($entries['count'])
{
foreach ($entries as $entry)
@@ -137,14 +137,14 @@ function get_userlist()
$username = $entry['uid'][0];
$realname = $entry['cn'][0];
$user_id = $entry['uidnumber'][0];
if (!isset($config['auth_ldap_group']) || ldap_compare($ds,$config['auth_ldap_group'],'memberUid',$username))
{
$userlist[] = array('username' => $username, 'realname' => $realname, 'user_id' => $user_id);
}
}
}
return $userlist;
}

View File

@@ -251,7 +251,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
</a>
</li>');
}
echo("</ul>");
echo("</ul>");
}
if (device_permitted($device['device_id']) || $check_device == $vars['device']) {

View File

@@ -11,7 +11,7 @@ $graphs = array('powerdns_latency' => 'Latency',
'powerdns_queries_udp' => 'Detail UDP IPv4/IPv6 Queries and Answers');
foreach ($graphs as $key => $text) {
$graph_type = $key;
$graph_type = $key;
$graph_array['height'] = "100";
$graph_array['width'] = "215";
$graph_array['to'] = $now;

View File

@@ -247,7 +247,7 @@ if($format == "graph")
{
$graph_type = "device_".$subformat;
if($_SESSION['widescreen']) { $width=270; } else { $width=315; }
if ($_SESSION['widescreen']) { $width=270; } else { $width=315; }
echo("<div style='display: block; padding: 1px; margin: 2px; min-width: ".($width+78)."px; max-width:".($width+78)."px; min-height:170px; max-height:170px; text-align: center; float: left; background-color: #f5f5f5;'>
<a href='device/device=".$device['device_id']."/' onmouseover=\"return overlib('\

View File

@@ -82,7 +82,7 @@ if (!$auth)
echo("<hr />");
if($vars['legend'] == "no")
if ($vars['legend'] == "no")
{
echo(generate_link("Show Legend",$vars, array('page' => "graphs", 'legend' => NULL)));
} else {

View File

@@ -36,7 +36,7 @@ foreach ($ports as $port)
$link = generate_url($link_array);
$overlib_content = generate_overlib_content($graph_array, $port['hostname'] . " - " . $port['label']);
$graph_array['title'] = "yes";
$graph_array['width'] = 315; $graph_array['height'] = 119;
$graph_array['width'] = 315; $graph_array['height'] = 119;
$graph = generate_graph_tag($graph_array);
echo("<div style='display: block; padding: 1px; margin: 2px; min-width: 393px; max-width:393px; min-height:180px; max-height:180px; text-align: center; float: left; background-color: #f5f5f5;'>");

View File

@@ -55,7 +55,7 @@ else
echo(" | ");
if ($vars['state'] == "down")
if ($vars['state'] == "down")
{
echo("<span class='pagemenu-selected'>");
echo(generate_link("Down",$vars, array('state' => NULL)));
@@ -66,7 +66,7 @@ else
## End BGP Menu
if(!isset($vars['view'])) { $vars['view'] = 'details'; }
if (!isset($vars['view'])) { $vars['view'] = 'details'; }
echo('<div style="float: right;">');
@@ -133,19 +133,19 @@ else
$i = "1";
if ($vars['type'] == "external")
if ($vars['type'] == "external")
{
$where = "AND D.bgpLocalAs != B.bgpPeerRemoteAs";
} elseif ($vars['type'] == "internal") {
$where = "AND D.bgpLocalAs = B.bgpPeerRemoteAs";
}
if($vars['adminstatus'] == "stop")
if ($vars['adminstatus'] == "stop")
{
$where .= " AND (B.bgpPeerAdminStatus = 'stop')";
}
if($vars['state'] == "down")
if ($vars['state'] == "down")
{
$where .= " AND (B.bgpPeerState != 'established')";
}

View File

@@ -71,19 +71,19 @@ $config['snmp']['transports'] = array('udp', 'udp6', 'tcp', 'tcp6');
### Autodiscovery Settings
$config['autodiscovery']['xdp'] = true; ## Autodiscover hosts via discovery protocols
$config['autodiscovery']['xdp'] = true; ## Autodiscover hosts via discovery protocols
$config['autodiscovery']['ospf'] = true; ## Autodiscover hosts via OSPF
$config['autodiscovery']['bgp'] = true; ## Autodiscover hosts via BGP
$config['autodiscovery']['snmpscan'] = true; ## autodiscover hosts via SNMP scanning
$config['autodiscovery']['bgp'] = true; ## Autodiscover hosts via BGP
$config['autodiscovery']['snmpscan'] = true; ## autodiscover hosts via SNMP scanning
$config['discover_services'] = false; ## Autodiscover services via SNMP on devices of type "server"
$config['discover_services'] = false; ## Autodiscover services via SNMP on devices of type "server"
### Alerting Settings
$config['alerts']['email']['default'] = NULL; ## Default alert recipient
$config['alerts']['email']['default_only'] = FALSE; ## Only use default recipient
$config['alerts']['email']['enable'] = TRUE; ## Enable email alerts
$config['alerts']['bgp']['whitelist'] = NULL; ## Populate as an array() with ASNs to alert on.
$config['alerts']['bgp']['whitelist'] = NULL; ## Populate as an array() with ASNs to alert on.
$config['uptime_warning'] = "84600"; ## Time in seconds to display a "Device Rebooted" Alert. 0 to disable warnings.
@@ -149,8 +149,8 @@ $config['enable_eigrp'] = 1; # Enable EIGRP session collection a
$config['enable_syslog'] = 0; # Enable Syslog
$config['enable_inventory'] = 1; # Enable Inventory
$config['enable_pseudowires'] = 1; # Enable Pseudowires
$config['enable_vrfs'] = 1; # Enable VRFs
$config['enable_printers'] = 0; # Enable Printer support
$config['enable_vrfs'] = 1; # Enable VRFs
$config['enable_printers'] = 0; # Enable Printer support
### Ports extension modules
@@ -164,14 +164,14 @@ $config['enable_ports_poe'] = 0; # Enable PoE stats collection
### Billing System Configuration
$config['enable_billing'] = 0; # Enable Billing
$config['billing']['customer_autoadd'] = 0; # Enable Auto-add bill per customer
$config['billing']['circuit_autoadd'] = 0; # Enable Auto-add bill per circuit_id
$config['billing']['bill_autoadd'] = 0; # Enable Auto-add bill per bill_id
$config['billing']['customer_autoadd'] = 0; # Enable Auto-add bill per customer
$config['billing']['circuit_autoadd'] = 0; # Enable Auto-add bill per circuit_id
$config['billing']['bill_autoadd'] = 0; # Enable Auto-add bill per bill_id
### External Integration
#$config['rancid_configs'][] = '/var/lib/rancid/network/configs/';
$config['rancid_ignorecomments'] = 0; # Ignore lines starting with #
#$config['rancid_configs'][] = '/var/lib/rancid/network/configs/';
$config['rancid_ignorecomments'] = 0; # Ignore lines starting with #
#$config['collectd_dir'] = '/var/lib/collectd/rrd';
# NFSen RRD dir.
@@ -351,8 +351,6 @@ $config['poller_modules']['cisco-cef'] = 1;
$config['poller_modules']['cisco-mac-accounting'] = 1;
$config['poller_modules']['cipsec-tunnels'] = 1;
#include("includes/polling/altiga-ssl.inc.php");
## List of discovery modules. Need to be in this array to be
## considered for execution.

View File

@@ -7,18 +7,20 @@ if($device['os'] == "vrp")
$mempools_array = snmpwalk_cache_multi_oid($device, "hwEntityMemUsage", $mempools_array, "HUAWEI-ENTITY-EXTENT-MIB" , $config['install_dir']."/mibs");
$mempools_array = snmpwalk_cache_multi_oid($device, "hwEntityMemSize", $mempools_array, "HUAWEI-ENTITY-EXTENT-MIB" , $config['install_dir']."/mibs");
$mempools_array = snmpwalk_cache_multi_oid($device, "hwEntityBomEnDesc", $mempools_array, "HUAWEI-ENTITY-EXTENT-MIB" , $config['install_dir']."/mibs");
if($debug) { print_r($mempools_array); }
if ($debug) { print_r($mempools_array); }
if(is_array($mempools_array)) {
foreach($mempools_array as $index => $entry) {
if($entry['hwEntityMemSize'] != 0 ) {
if (is_array($mempools_array))
{
foreach($mempools_array as $index => $entry)
{
if ($entry['hwEntityMemSize'] != 0 )
{
if ($debug) { echo($index . " " . $entry['hwEntityBomEnDesc'] . " -> " . $entry['hwEntityMemUsage'] . " -> " . $entry['hwEntityMemSize'] . "\n"); }
echo($index . " " . $entry['hwEntityBomEnDesc'] . " -> " . $entry['hwEntityMemUsage'] . " -> " . $entry['hwEntityMemSize'] . "\n");
$usage_oid = ".1.3.6.1.4.1.2011.5.25.31.1.1.1.1.7." . $index;
$descr = $entry['hwEntityBomEnDesc'];
$usage = $entry['hwEntityMemUsage'];
if(!strstr($descr, "No") && !strstr($usage, "No") && $descr != "" ) {
if (!strstr($descr, "No") && !strstr($usage, "No") && $descr != "" )
{
discover_mempool($valid_mempool, $device, $index, "vrp", $descr, "1", NULL, NULL);
}
} ## End if checks
@@ -26,6 +28,6 @@ if($device['os'] == "vrp")
} ## End if array
} ## End VRP mempools
unset ($mempools_array);
unset ($mempools_array);
?>

View File

@@ -11,17 +11,17 @@ if($device['os'] == "vrp")
if (is_array($processors_array))
{
foreach ($processors_array as $index => $entry)
foreach ($processors_array as $index => $entry)
{
if ( $entry['hwEntityMemSize'] != 0 )
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 (!strstr($descr, "No") && !strstr($usage, "No") && $descr != "" )
{
discover_processor($valid['processor'], $device, $usage_oid, $index, "vrp", $descr, "1", $usage, NULL, NULL);
discover_processor($valid['processor'], $device, $usage_oid, $index, "vrp", $descr, "1", $usage, NULL, NULL);
}
} ## End if checks
} ## End Foreach

View File

@@ -1,15 +1,15 @@
<?php
$oid = $mempool['mempool_index'];
$oid = $mempool['mempool_index'];
if($debug) {echo("Huawei VRP Mempool");}
if(!is_array($mempool_cache['vrp'])) {
if($debug) {echo("caching");}
if ($debug) {echo("caching");}
$mempool_cache['vrp'] = array();
$mempool_cache['vrp'] = snmpwalk_cache_multi_oid($device, "hwEntityMemSize", $mempool_cache['vrp'], "HUAWEI-ENTITY-EXTENT-MIB" , $config['install_dir']."/mibs");
$mempool_cache['vrp'] = snmpwalk_cache_multi_oid($device, "hwEntityMemUsage", $mempool_cache['vrp'], "HUAWEI-ENTITY-EXTENT-MIB" , $config['install_dir']."/mibs");
if($debug) {print_r($mempool_cache);}
if ($debug) {print_r($mempool_cache);}
}
$entry = $mempool_cache['vrp'][$mempool[mempool_index]];