mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
syntaxer run
git-svn-id: http://www.observium.org/svn/observer/trunk@3117 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -9,7 +9,7 @@ if ($config['enable_pseudowires'] && $device['os_group'] == "cisco")
|
||||
|
||||
/// Pre-cache the existing state of pseudowires for this device from the database
|
||||
$pws_db_raw = dbFetchRows("SELECT * FROM `pseudowires` WHERE `device_id` = ?", array($device['device_id']));
|
||||
foreach($pws_db_raw as $pw_db)
|
||||
foreach ($pws_db_raw as $pw_db)
|
||||
{
|
||||
$device['pws_db'][$pw_db['cpwVcID']] = $pw_db['pseudowire_id'];
|
||||
}
|
||||
@@ -24,8 +24,7 @@ if ($config['enable_pseudowires'] && $device['os_group'] == "cisco")
|
||||
/// For MPLS pseudowires
|
||||
$pws = snmpwalk_cache_oid($device, "cpwVcMplsPeerLdpID", $pws, "CISCO-IETF-PW-MPLS-MIB");
|
||||
|
||||
|
||||
foreach($pws as $pw_id => $pw)
|
||||
foreach ($pws as $pw_id => $pw)
|
||||
{
|
||||
list($cpw_remote_id) = explode(":", $pw['cpwVcMplsPeerLdpID']);
|
||||
$cpw_remote_device = @mysql_result(mysql_query("SELECT device_id FROM ipv4_addresses AS A, ports AS I WHERE A.ipv4_address = '".$cpw_remote_id."' AND A.interface_id = I.interface_id"),0);
|
||||
@@ -46,9 +45,9 @@ if ($config['enable_pseudowires'] && $device['os_group'] == "cisco")
|
||||
}
|
||||
|
||||
/// Cycle the list of pseudowires we cached earlier and make sure we saw them again.
|
||||
foreach($device['pws_db'] as $pw_id => $pseudowire_id)
|
||||
foreach ($device['pws_db'] as $pw_id => $pseudowire_id)
|
||||
{
|
||||
if(empty($device['pws'][$pw_id]))
|
||||
if (empty($device['pws'][$pw_id]))
|
||||
{
|
||||
dbDelete('vlans', "`pseudowire_id` = ?", array($pseudowire_id));
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ lhAlarmThrsh.0 = INTEGER: 30 rH%
|
||||
smDehumSetp.0 = INTEGER: 75 rH%
|
||||
smHumidSetp.0 = INTEGER: 35 rH%
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -11,7 +11,7 @@ if (!$os)
|
||||
## Check for QNAP Systems TurboNAS
|
||||
$entPhysicalMfgName = snmp_get($device, "ENTITY-MIB::entPhysicalMfgName.1", "-Osqnv");
|
||||
|
||||
if(strstr($sysObjectId, ".1.3.6.1.4.1.5528.100.20.10.2014")) { $os = "netbotz"; }
|
||||
if (strstr($sysObjectId, ".1.3.6.1.4.1.5528.100.20.10.2014")) { $os = "netbotz"; }
|
||||
elseif (strstr($sysDescr, "endian")) { $os = "endian"; }
|
||||
elseif (preg_match("/Cisco Small Business/", $sysDescr)) { $os = "ciscosmblinux"; }
|
||||
elseif (strpos($entPhysicalMfgName, "QNAP") !== FALSE) { $os = "qnap"; }
|
||||
@@ -25,7 +25,7 @@ if (!$os)
|
||||
{
|
||||
## Check for Carel PCOweb
|
||||
$roomTemp = trim(snmp_get($device,"roomTemp.0", "-OqvU", "CAREL-ug40cdz-MIB"));
|
||||
|
||||
|
||||
if (is_numeric($roomTemp))
|
||||
{
|
||||
$os = "pcoweb";
|
||||
|
||||
@@ -54,7 +54,7 @@ radcoolSpDX.0 = INTEGER: 280 degrees C
|
||||
delTempLimit.0 = INTEGER: 14 degrees C x10
|
||||
dtAutChgMLT.0 = INTEGER: 20 degrees C
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -4,7 +4,7 @@ echo("VLANs:\n");
|
||||
|
||||
/// Pre-cache the existing state of VLANs for this device from the database
|
||||
$vlans_db_raw = dbFetchRows("SELECT * FROM `vlans` WHERE `device_id` = ?", array($device['device_id']));
|
||||
foreach($vlans_db_raw as $vlan_db)
|
||||
foreach ($vlans_db_raw as $vlan_db)
|
||||
{
|
||||
$vlans_db[$vlan_db['vlan_domain']][$vlan_db['vlan_vlan']] = $vlan_db;
|
||||
}
|
||||
@@ -75,12 +75,11 @@ foreach ($device['vlans'] as $domain_id => $vlans)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach($vlans_db as $domain_id => $vlans)
|
||||
foreach ($vlans_db as $domain_id => $vlans)
|
||||
{
|
||||
foreach($vlans as $vlan_id => $vlan)
|
||||
foreach ($vlans as $vlan_id => $vlan)
|
||||
{
|
||||
if(empty($device['vlans'][$domain_id][$vlan_id]))
|
||||
if (empty($device['vlans'][$domain_id][$vlan_id]))
|
||||
{
|
||||
dbDelete('vlans', "`device_id` = ? AND vlan_domain = ? AND vlan_vlan = ?", array($device['device_id'], $domain_id, $vlan_id));
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ if ($device['os_group'] == "cisco")
|
||||
$vtpdomains = snmpwalk_cache_oid($device, "vlanManagementDomains", array(), "CISCO-VTP-MIB");
|
||||
$vlans = snmpwalk_cache_twopart_oid($device, "vtpVlanEntry", array(), "CISCO-VTP-MIB");
|
||||
|
||||
foreach($vtpdomains as $vtpdomain_id => $vtpdomain)
|
||||
foreach ($vtpdomains as $vtpdomain_id => $vtpdomain)
|
||||
{
|
||||
echo("VTP Domain ".$vtpdomain_id." ".$vtpdomain['managementDomainName']." ");
|
||||
foreach ($vlans[$vtpdomain_id] as $vlan_id => $vlan)
|
||||
|
||||
Reference in New Issue
Block a user