diff --git a/html/pages/device/showconfig.inc.php b/html/pages/device/showconfig.inc.php index ba2912e72..3e1310dbd 100644 --- a/html/pages/device/showconfig.inc.php +++ b/html/pages/device/showconfig.inc.php @@ -32,7 +32,7 @@ if ($_SESSION['userlevel'] >= "7") if (function_exists('svn_log')) { $sep = " | "; - $svnlogs = svn_log($file, SVN_REVISION_HEAD, NULL, 5); + $svnlogs = svn_log($file, SVN_REVISION_HEAD, NULL, 8); $revlist = array(); foreach ($svnlogs as $svnlog) { diff --git a/includes/discovery/current/apc.inc.php b/includes/discovery/current/apc.inc.php index 4f639c6bc..d8b395247 100644 --- a/includes/discovery/current/apc.inc.php +++ b/includes/discovery/current/apc.inc.php @@ -104,6 +104,56 @@ if ($device['os'] == "apc") unset($oids); + #Per Outlet Power Bar + $oids = snmp_walk($device, "1.3.6.1.4.1.318.1.1.26.9.4.3.1.1", "-t 30 -OsqnU", "PowerNet-MIB"); + if ($oids) + { + echo("APC PowerNet-MIB Outlets "); + if ($debug) { echo($oids."\n"); } + $oids = trim($oids); + $type = "apc"; + $precision = "10"; + + foreach (explode("\n", $oids) as $data) + { + $data = trim($data); + if ($data) + { + list($oid,$kind) = explode(" ", $data); + $split_oid = explode('.',$oid); + + $index = $split_oid[count($split_oid)-1]; + + $voltage_oid = "1.3.6.1.4.1.318.1.1.26.6.3.1.6"; #rPDU2PhaseStatusVoltage + + $current_oid = "1.3.6.1.4.1.318.1.1.26.9.4.3.1.6.".$index; #rPDU2OutletMeteredStatusCurrent + $limit_oid = "1.3.6.1.4.1.318.1.1.26.9.4.1.1.7.".$index; # rPDU2OutletMeteredConfigOverloadCurrentThreshold + $lowlimit_oid = "1.3.6.1.4.1.318.1.1.26.9.4.1.1.7.".$index; #rPDU2OutletMeteredConfigLowLoadCurrentThreshold + $warnlimit_oid = "1.3.6.1.4.1.318.1.1.26.9.4.1.1.6.".$index; #rPDU2OutletMeteredConfigNearOverloadCurrentThreshold + $name_oid = "1.3.6.1.4.1.318.1.1.26.9.4.3.1.3.".$index; #rPDU2OutletMeteredStatusName + + + $voltage = snmp_get($device, $voltage_oid, "-Oqv", ""); + + $current = snmp_get($device, $current_oid, "-Oqv", "") / $precision; + $limit = snmp_get($device, $limit_oid, "-Oqv", "") / $voltage; + $lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", "") / $voltage; + $warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", "") / $voltage; + $descr = "Outlet " . $index . " - " . snmp_get($device, $name_oid, "-Oqv", ""); + + discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current); + + } + } + + } + + + + unset($oids); + + + # ATS $oids = snmp_walk($device, "atsConfigPhaseTableIndex", "-OsqnU", "PowerNet-MIB"); if ($oids) diff --git a/includes/discovery/voltages/apc.inc.php b/includes/discovery/voltages/apc.inc.php index 8e22d4af6..aa2b4fbd7 100644 --- a/includes/discovery/voltages/apc.inc.php +++ b/includes/discovery/voltages/apc.inc.php @@ -86,6 +86,25 @@ if ($device['os'] == "apc") discover_sensor($valid['sensor'], 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } + + + $oids = snmp_walk($device, "1.3.6.1.4.1.318.1.1.26.6.3.1.6", "-OsqnU", "PowerNet-MIB"); + if ($debug) { echo($oids."\n"); } + if ($oids) + { + echo(" Voltage In "); + list($oid,$current) = explode(" ",$oids); + $divisor = 1; + $type = "apc"; + $index = "1"; + $descr = "Input"; + + discover_sensor($valid['sensor'], 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); + } + + + + } ?>