示例#1
0
     $template->GetTemplate();
     $manufacturer->ManufacturerID = $template->ManufacturerID;
     $manufacturer->GetManufacturerByID();
     $tooltip .= __($row["Label"]) . ": [{$manufacturer->Name}] {$template->Model}<br>\n";
     break;
 case "NumOutlets":
     $template = new CDUTemplate();
     $powerConn = new PowerConnection();
     $template->TemplateID = $pdu->TemplateID;
     $template->GetTemplate();
     $powerConn->PDUID = $pdu->PDUID;
     $connList = $powerConn->GetConnectionsByPDU();
     $tooltip .= __($row["Label"]) . ": " . count($connList) . "/" . ($template->NumOutlets + 1) . "<br>\n";
     break;
 case "Uptime":
     $tooltip .= __($row["Label"]) . ": " . $pdu->GetSmartCDUUptime() . "<br>\n";
     break;
 case "PanelID":
     $pan = new PowerPanel();
     $pan->PanelID = $pdu->PanelID;
     $pan->GetPanel();
     $tooltip .= __($row["Label"]) . ": {$pan->PanelLabel}<br>\n";
     break;
 case "PanelVoltage":
     $pan = new PowerPanel();
     $pan->PanelID = $pdu->PanelID;
     $pan->GetPanel();
     $tooltip .= __($row["Label"]) . ": " . $pan->PanelVoltage . " / " . intval($pan->PanelVoltage / 1.73) . "<br>\n";
     break;
 case "PanelPole":
     $tooltip .= __($row["Label"]) . ": " . $pdu->GetAllBreakerPoles() . "<br>\n";
示例#2
0
    }
    // Show the end user something to make them feel good about it being correct
    if (!$error) {
        foreach ($snmpHost->realWalk('1.3.6.1.2.1.1') as $oid => $value) {
            print "{$oid} => {$value} <br>\n";
        }
    } else {
        print __("Something isn't working correctly");
    }
    exit;
}
// Get CDU uptime
if (isset($_POST['cduuptime'])) {
    $pdu = new PowerDistribution();
    $pdu->PDUID = $_POST['DeviceID'];
    echo $pdu->GetSmartCDUUptime();
    exit;
}
// Get log entries
if (isset($_POST['logging'])) {
    $dev->DeviceID = $_POST['devid'];
    $actions = array();
    if ($dev->GetDevice()) {
        $actions = LogActions::GetLog($dev, false);
    }
    header('Content-Type: application/json');
    echo json_encode($actions);
    exit;
}
// Get cabinet height
if (isset($_POST['cab'])) {