コード例 #1
0
ファイル: summary.test.php プロジェクト: purplepixie/freenats
function gtinfo($testid)
{
    global $NATS;
    $o = "Error fetching test";
    $test = $NATS->GetTest($testid);
    if ($test['class'] == "L") {
        $o = lText($test['testtype']);
        if ($test['testparam'] != "") {
            $o .= " (" . $test['testparam'] . ")";
        }
        if ($test['testname'] != "") {
            $o = $test['testname'];
        }
        $u = lUnit($test['testtype']);
        if ($u != "") {
            $o .= " (" . $u . ")";
        }
    } else {
        if ($test['name'] != "") {
            $o = $test['name'];
        } else {
            $o = $test['testtype'];
        }
    }
    /*
    if ($testid[0]=="L")
    	{ // local test
    	$q="SELECT testtype,testparam,testname FROM fnlocaltest WHERE localtestid=".ss(substr($testid,1,128));
    	$r=$NATS->DB->Query($q);
    	if ($row=$NATS->DB->Fetch_Array($r))
    		{
    		$o=lText($row['testtype']);
    		if ($row['testparam']!="") $o.=" (".$row['testparam'].")";
    		
    		if ($row['testname']!="") $o=$row['testname'];
    		
    		$u=lUnit($row['testtype']);
    		if ($u!="") $o.=" (".$u.")";
    		}
    	else $o="Error fetching test";
    	}
    */
    return $o;
}
コード例 #2
0
ファイル: report.php プロジェクト: purplepixie/freenats
 if (!($row = $NATS->DB->Fetch_Array($r))) {
     header("main.php?message=Error+opening+test+history");
     exit;
 }
 $tnode = $row['nodeid'];
 $ttype = $row['testtype'];
 if (isset($row['testparam'])) {
     $tparam = $row['testparam'];
 } else {
     $tparam = "";
 }
 $tlastrunx = $row['lastrunx'];
 $tunit = "";
 if ($tmode == "local") {
     $tname = lText($ttype);
     $tunit = lUnit($ttype);
     if ($tparam != "") {
         $tname .= " (" . $tparam . ")";
     }
     if ($row['testname'] != "") {
         $subtname = $tname;
         $tname = $row['testname'];
         $usesubname = true;
     } else {
         $usesubname = false;
     }
 } else {
     if ($tmode == "nodeside") {
         if ($row['testname'] != "") {
             $tname = $row['testname'];
         } else {
コード例 #3
0
                echo "<table border=\"0\">";
                foreach ($tests as $testid) {
                    echo "<tr><td align=\"left\" valign=\"top\">";
                    $test = $NATS->GetTest($testid);
                    echo "<b class=\"al" . $test['alertlevel'] . "\">";
                    echo $test['name'];
                    echo "</b>:";
                    echo "</td><td align=\"left\" valign=\"top\">";
                    if (is_numeric($test['lastvalue'])) {
                        echo round($test['lastvalue'], 2);
                    } else {
                        echo $test['lastvalue'];
                    }
                    $c = $testid[0];
                    if (is_numeric($c) || $c == "L") {
                        echo " " . lUnit($test['testtype']);
                    }
                    echo "</td></tr>\n";
                }
                echo "</table><br />\n";
                echo "<a href=\"node.php?nodeid=" . $nodeid . "\">" . $NATS->Lang->Item("mon.goto.node.page") . "</a><br />";
            }
        } else {
            echo $NATS->Lang->Item("mon.popup.error");
        }
        break;
    default:
        echo "Incorrect or invalid request type to popup framework";
        break;
}
echo "</div>";