add loadbalancer device type, netscaler = loadbalancer, patch by mgm

git-svn-id: http://www.observium.org/svn/observer/trunk@2844 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-01-20 13:15:05 +00:00
parent 242504f70f
commit 3407022cb0
5 changed files with 15 additions and 20 deletions

View File

@@ -75,8 +75,6 @@ if (bill_permitted($bill_id))
if (!$vars['view']) { $vars['view'] = "quick"; }
if ($_GET['opta'] == "admin_history") { $vars['view'] = $_GET['opta']; }
if ($vars['view'] == "quick") { echo("<span class='pagemenu-selected'>"); }
echo('<a href="'.generate_url($vars, array('view' => 'quick')).'">Quick Graphs</a>');

View File

@@ -117,7 +117,7 @@ if ($lldp_array)
$lldp = $lldp_instance[$entry_instance];
$remote_device_id = @mysql_result(mysql_query("SELECT `device_id` FROM `devices` WHERE `sysName` = '".$lldp['lldpRemSysName']."' OR `hostname`='".$lldp['lldpRemSysName']."'"), 0);
if (!$remote_device_id)
if (!$remote_device_id && is_valid_hostname($lldp['lldpRemSysName']))
{
$remote_device_id = discover_new_device($lldp['lldpRemSysName']);
if ($remote_device_id)

View File

@@ -1,10 +1,5 @@
<?php
# FIXME Removed 28/4/2011 - this can go, right?
#unset($ports);
#$ports = snmp_cache_ifIndex($device); /// Cache Port List
# /FIXME
// Build SNMP Cache Array
$data_oids = array('ifName','ifDescr','ifAlias', 'ifAdminStatus', 'ifOperStatus', 'ifMtu', 'ifSpeed', 'ifHighSpeed', 'ifType', 'ifPhysAddress',
'ifPromiscuousMode','ifConnectorPresent','ifDuplex', 'ifTrunk', 'ifVlan');
@@ -182,14 +177,7 @@ foreach ($ports as $port)
if (strpos($this_port['ifPhysAddress'], ":"))
{
list($a_a, $a_b, $a_c, $a_d, $a_e, $a_f) = explode(":", $this_port['ifPhysAddress']);
$ah_a = zeropad($a_a);
$ah_b = zeropad($a_b);
$ah_c = zeropad($a_c);
$ah_d = zeropad($a_d);
$ah_e = zeropad($a_e);
$ah_f = zeropad($a_f);
#$this_port['ifPhysAddress'] = $ah_a.":".$ah_b.":".$ah_c.":".$ah_d.":".$ah_e.":".$ah_f;
$this_port['ifPhysAddress'] = $ah_a.$ah_b.$ah_c.$ah_d.$ah_e.$ah_f;
$this_port['ifPhysAddress'] = zeropad($ah_a).zeropad($ah_b).zeropad($ah_c).zeropad($ah_d).zeropad($ah_e).zeropad($ah_f);
}
if (is_numeric($this_port['ifHCInBroadcastPkts']) && is_numeric($this_port['ifHCOutBroadcastPkts']) && is_numeric($this_port['ifHCInMulticastPkts']) && is_numeric($this_port['ifHCOutMulticastPkts']))
@@ -221,7 +209,11 @@ foreach ($ports as $port)
$this_port['ifTrunk'] = $this_port['vlanTrunkPortEncapsulationOperType'];
if (isset($this_port['vlanTrunkPortNativeVlan'])) { $this_port['ifVlan'] = $this_port['vlanTrunkPortNativeVlan']; }
}
$this_port['ifVlan'] = $this_port['vmVlan'];
if (isset($this_port['vmVlan']))
{
$this_port['ifVlan'] = $this_port['vmVlan'];
}
/// Set VLAN and Trunk from Q-BRIDGE-MIB
if (!isset($this_port['ifVlan']) && isset($this_port['dot1qPvid']))

View File

@@ -9,8 +9,8 @@ if ($config['enable_printers'])
echo("Checking toner " . $toner['toner_descr'] . "... ");
$tonerperc = round(snmp_get($device, $toner['toner_oid'], "-OUqnv") / $toner['toner_capacity'] * 100);
if ($tonerperc > 100) { $tonerperc = 100; }
# FIXME also repoll capacity, or tonerperc can be incorrect; then line below can go too
if ($tonerperc > 100) { $tonerperc = 100; } # ^
$old_tonerrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("toner-" . $toner['toner_descr'] . ".rrd");
$tonerrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("toner-" . $toner['toner_index'] . ".rrd");

View File

@@ -412,7 +412,7 @@ $config['os'][$os]['over'][2]['text'] = "Memory Usage";
$os = "netscaler";
$config['os'][$os]['text'] = "Citrix Netscaler";
$config['os'][$os]['type'] = "network";
$config['os'][$os]['type'] = "loadbalancer";
$config['os'][$os]['icon'] = "citrix";
$config['os'][$os]['over'][0]['graph'] = "device_bits";
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
@@ -1016,6 +1016,11 @@ $config['device_types'][$i]['text'] = 'Environment';
$config['device_types'][$i]['type'] = 'environment';
$config['device_types'][$i]['icon'] = 'environment.png';
$i++;
$config['device_types'][$i]['text'] = 'Load Balancers';
$config['device_types'][$i]['type'] = 'loadbalancer';
$config['device_types'][$i]['icon'] = 'loadbalancer.png';
if (isset($config['enable_printers']) && $config['enable_printers'])
{
$i++;