Beispiel #1
0
function MonLatency($ina, $opa, $sta, $lim, $ord)
{
    global $link, $modgroup, $self, $srtlbl, $tgtlbl, $latlbl, $latw, $loclbl, $locsep, $conlbl, $stslbl, $laslbl, $avglbl, $maxlbl;
    ?>
<h2><?php 
    echo $latlbl;
    ?>
 <?php 
    echo $stslbl;
    ?>
</h2>

<table class="content"><tr class="<?php 
    echo $modgroup[$self];
    ?>
2">
<th colspan="2" width="20%"><img src="img/16/trgt.png"><br><?php 
    echo $tgtlbl;
    ?>
</th>
<th width="40"><img src="img/16/bchk.png"><br><?php 
    echo $tstlbl;
    ?>
</th>
<th><img src="img/16/bbrt.png"><br><?php 
    echo $laslbl;
    ?>
</th>
<th><img src="img/16/form.png"><br><?php 
    echo $avglbl;
    ?>
</th>
<th><img src="img/16/brup.png"><br><?php 
    echo $maxlbl;
    ?>
</th>
</tr>
<?php 
    if ($ord) {
        $ocol = "name";
        $srt = "{$srtlbl}: {$tgtlbl}";
    } else {
        $ocol = "latavg desc";
        $srt = "{$srtlbl}: {$avglbl} {$latlbl}";
    }
    $query = GenQuery('monitoring', 's', 'name,test,latency,latmax,latavg,location,contact,class,icon', $ocol, $lim, array('latency', $ina), array('>', $opa), array('0', $sta), array('AND'), 'LEFT JOIN devices USING (device)');
    $res = DbQuery($query, $link);
    if ($res) {
        $row = 0;
        while ($r = DbFetchRow($res)) {
            if ($row % 2) {
                $bg = "txta";
                $bi = "imga";
            } else {
                $bg = "txtb";
                $bi = "imgb";
            }
            $row++;
            $l = explode($locsep, $r[5]);
            TblRow($bg);
            echo "<th class=\"{$bi}\"><img src=\"img/" . ($r[7] == "dev" ? "dev/{$r['8']}" : "32/node") . ".png\" title=\"{$conlbl}: {$r['6']}, {$loclbl}: {$l['0']} {$l['1']} {$l['2']}\"></th>\n";
            echo "<td><a href=\"Monitoring-Setup.php?in[]=name&op[]=%3D&st[]=" . urlencode($r[0]) . "\">{$r['0']}</a></td><th class=\"{$bi}\">" . TestImg($r[1]) . "</th><td>";
            echo Bar($r[2], $latw, 'mi') . " {$r[2]}ms</td><td>" . Bar($r[4], $latw, 'mi') . " {$r[4]}ms</td><td>" . Bar($r[3], $latw, 'mi') . " {$r[3]}ms</tr>\n";
        }
    }
    ?>
</table>
<table class="content" >
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2"><td><?php 
    echo $row;
    ?>
 Devices, <?php 
    echo $srt;
    ?>
</td></tr>
</table>
<p>
<?php 
}
Beispiel #2
0
	}
	if (file_exists("log/devtools.php")) {						# Based on Steffen's idea
		include_once ("log/devtools.php");
	}

}
?>
</div>
<div style="float:right">
<?php  if($rver and $guiauth != 'none'){ ?>
<a href="Other-Defgen.php?so=<?= $sysobj ?>&ip=<?= $ip ?>&co=<?= $dev[15] ?>"><img src="img/16/geom.png" title="<?= (($verb1)?"$edilbl Def $fillbl":"Def $fillbl $edilbl") ?>"></a>
<?php
}
if($isadmin){
	if( is_array($mon) ){
		$most = TestImg($mon[3]);
	}else{
		if ($mon == 1 and $dev[1]){
			if($dev[14] & 3){
				$mma  = explode('/', $mema);
				if($dev[21] > 100){
					$most = AddRecord('monitoring',"name='$dev[0]'",'name,monip,test,device,memalert',"'$dev[0]','$dev[1]','uptime','$dev[0]','$mma[0]'");
				}else{
					$most = AddRecord('monitoring',"name='$dev[0]'","name,monip,test,device,memalert","'$dev[0]','$dev[1]','uptime','$dev[0]','$mma[1]'");
				}
			}else{
				echo AddRecord('monitoring',"name='$dev[0]'",'name,monip,test,device',"'$dev[0]','$dev[1]','ping','$dev[0]'");
			}
		}else{
			echo "<a href=\"?dev=$ud&mon=1\"><img src=\"img/16/bino.png\" title=\"Monitor $addlbl\"></a>";
		}
Beispiel #3
0
				}
				if(in_array("totpoe",$col)){
					TblCell($dev[31].'W','','align="right"');
				}
				if( in_array("cfgchange",$col) ){
					TblCell( $dev[32],"?in[]=cfgchange&op[]==&st[]=".urlencode($dev[32]) );
				}
				if( in_array("cfgstatus",$col) ){
					TblCell( $dev[33],"?in[]=cfgstatus&op[]==&st[]=".urlencode($dev[33]),'',DevCfg($dev[33]),'td-img' );
				}
				if( in_array("time",$col) ){
					$cbup = ($dev[36])?"$buplbl:".date($datfmt,$dev[36]).", $sizlbl:".DecFix($dev[34])."B".", $chglbl:".DecFix($dev[35])."B":'';
					TblCell($cbup,"Devices-Config.php?shc=$ud");
				}
				if( in_array("test",$col) ){
					TblCell("$loslbl:$dev[36] OK:$dev[37]","Monitoring-Setup.php?in[]=name&op[]==&st[]=$ud","class=\"$bi\"",TestImg($dev[34]),'td-img');
				}
				if(in_array("poNS",$col)){
					$pop = NodPop( array('device'),array('='),array($dev[0]),array() );
					if($pop){
						TblCell($pop,"Nodes-List.php?in[]=device&op[]==&st[]=$ud",'',Bar($pop,100,'si').' ','td-img');
					}else{
						TblCell();
					}
				}
				if( in_array("logNS",$col) and !isset($_GET['xls']) ){
					$log = array();
					$log[$dev[4]] = "bblf;$fislbl $dsclbl";
					$log[$dev[5]] = "bbrt;$laslbl $dsclbl";
#TODO add if only timestamps are used in DB?					$log[$dev[32]] = 'dril';
					$lqry = GenQuery('configs','s','time','','',array('device'),array('='),array($dev[0]) );