Esempio n. 1
0
         }
         if (!strpos($fmt, 'g')) {
             echo "</td></tr>\n";
         }
         DbFreeResult($res);
     } else {
         print DbError($link);
     }
 } else {
     $query = GenQuery('events', 's', 'count(*)', '', '', array('time', 'time', $in[0]), array('>=', '<', $op[0]), array($istart, $iend, $st[0]), array('AND', 'AND'), 'LEFT JOIN devices USING (device)');
     $res = DbQuery($query, $link);
     if ($res) {
         $m = DbFetchRow($res);
         if ($m[0]) {
             if (!strpos($fmt, 'g')) {
                 echo Bar($m[0], 0, $fmt) . " {$m['0']}";
             }
         }
         $dsval[$alllbl][$row] = $m[0];
         if (!strpos($fmt, 'g')) {
             echo " </td></tr>\n";
         }
         $tmsg += $m[0];
         DbFreeResult($res);
     } else {
         print DbError($link);
     }
 }
 $istart = $iend;
 $row++;
 flush();
Esempio n. 2
0
	$row = 0;
	$nno = 0;
	$query	= GenQuery('nodes','s','*',$ord);
	$res	= @DbQuery($query,$link);
	while( ($n = @DbFetchRow($res)) ){
		if($macs["$n[6];;$n[7]"] > 1 or $all){
			$m = substr($n[2],0,8);
			if(in_array("$m", $wlap,1) ){
				if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";}
				$row++;
				$name	= preg_replace("/^(.*?)\.(.*)/","$1", $n[0]);
				$ip	= long2ip($n[1]);
				$img	= Nimg("$n[2];$n[3]");
				$fs	= date("j.M G:i",$n[4]);
				$ls	= date("j.M G:i",$n[5]);
				$pbar	= Bar($macs[$n[6]][$n[7]],5);
				$ud	= rawurlencode($n[6]);
				list($fc,$lc)	= Agecol($n[4],$n[5],$row);
				echo "<tr class=\"$bg\"><th class=\"$bi\">\n";
				echo "<a href=Nodes-Status.php?mac=$n[2]><img src=\"img/oui/$img\" title=\"$n[3] ($n[2])\"></a></th>\n";
				echo "<td>$name</td><td>$ip</td><td>$m</td><td>$n[6]</td><td><a href=Nodes-List.php?ina=device&opa==&sta=$ud&cop=AND&inb=ifname&opb==&stb=$n[7]&>$n[7]</a></td><td>$pbar".$macs["$n[6];;$n[7]"]."</td>\n";
				echo "<td bgcolor=#$fc>$fs</td><td bgcolor=#$lc>$ls</td>";
				echo "</tr>\n";
			}
		}
		$nno++;
	}
?>
</table>
<table class="content">
<tr class="<?php 
        ?>
>
<th width=40><img src=img/16/info.png><br>Level</th>
<th><img src=img/16/say.png><br>Messages</th>
<?php 
        $row = 0;
        while ($msg = @DbFetchRow($res)) {
            if ($row % 2) {
                $bg = $bgb;
                $bi = $bib;
            } else {
                $bg = $bga;
                $bi = $bia;
            }
            $row++;
            $mbar = Bar($msg[1], 0, 1);
            echo "<tr bgcolor=#{$bg}>\n";
            echo "<th bgcolor=#{$bi}><a href=Monitoring-Messages.php?lvl={$msg['0']}><img src=img/16/" . $mico[$msg[0]] . ".png border=0 title=" . $mlvl[$msg[0]] . "></a></th><td>{$mbar} {$msg['1']}</td></tr>\n";
        }
        echo "</table>\n";
    } else {
        echo '<p><h5>No Messages</h5>';
    }
    @DbFreeResult($res);
} else {
    print @DbError($link);
}
?>
</th><td></td><th width=77% valign=top>
<h2>Recent Vital Messages</h2>
<table bgcolor=#666666 <?php 
Esempio n. 4
0
function StatusSlow($slow)
{
    global $latw, $tgtlbl, $latlbl, $modgroup, $self;
    if (count($slow)) {
        ?>
<p>
<table class="content"><tr class="<?php 
        echo $modgroup[$self];
        ?>
2">
<th><img src="img/16/trgt.png"><br><?php 
        echo $tgtlbl;
        ?>
</th><th><img src="img/16/clock.png"><br><?php 
        echo $latlbl;
        ?>
</th>
<?php 
        $row = 0;
        foreach (array_keys($slow) as $t) {
            if ($row % 2) {
                $bg = "txta";
                $bi = "imga";
            } else {
                $bg = "txtb";
                $bi = "imgb";
            }
            $row++;
            echo "<tr>";
            if ($_SESSION['gsiz'] != 6) {
                echo "<th class=\"{$bi}\"><a href=\"Monitoring-Setup.php?in[]=name&op[]=%3D&st[]=" . urlencode($t) . "\"><img src=\"img/16/bino.png\"></a></th>\n";
            }
            echo "<td class=\"{$bg}\">" . substr($t, 0, $_SESSION['lsiz']) . "</td><td>" . Bar($slow[$t]['st'], $latw, 'si') . " " . $slow[$t]['st'] . "ms</td></tr>\n";
        }
        ?>
</table>
<?php 
    }
}
                $bg = $bga;
                $bi = $bia;
            } else {
                $bg = $bgb;
                $bi = $bib;
            }
            $row++;
            $devup[$d]['fs'] = isset($devup[$d]['fs']) ? $devup[$d]['fs'] : 0;
            $devup[$d]['ls'] = isset($devup[$d]['ls']) ? $devup[$d]['ls'] : 0;
            if (!$devup[$d]['fs']) {
                $devup[$d]['fs'] = 0;
            }
            if (!$devup[$d]['ls']) {
                $devup[$d]['ls'] = 0;
            }
            $fbar = Bar($devup[$d]['fs'], 100000);
            $lbar = Bar($devup[$d]['ls'], 1);
            $fd = rawurlencode(date("m/d/Y H:i:s", $d));
            echo "<tr bgcolor=#{$bg}>\n";
            echo "<th bgcolor=#{$bg1}>" . date($datfmt, $d) . "</th>\n";
            echo "<td>{$fbar} <a href=Devices-List.php?ina=firstseen&opa==&sta={$fd}>" . $devup[$d]['fs'] . "</a> first seen<br>\n";
            echo "{$lbar} <a href=Devices-List.php?ina=lastseen&opa==&sta={$fd}>" . $devup[$d]['ls'] . "</a> last seen</td></tr>\n";
            if ($row == $lim) {
                break;
            }
        }
        echo "</table><table bgcolor=#666666 {$tabtag}>\n";
        echo "<tr bgcolor=#{$bg2}><td>{$row} updates from {$ndev} devices in total</td></tr></table>\n";
    }
}
include_once "inc/footer.php";
        if ($row % 2) {
            $bg = $bga;
            $bi = $bia;
        } else {
            $bg = $bgb;
            $bi = $bib;
        }
        $row++;
        $nodup[$d]['fs'] = isset($nodup[$d]['fs']) ? $nodup[$d]['fs'] : 0;
        $nodup[$d]['ls'] = isset($nodup[$d]['ls']) ? $nodup[$d]['ls'] : 0;
        $nodup[$d]['iu'] = isset($nodup[$d]['iu']) ? $nodup[$d]['iu'] : 0;
        $nodup[$d]['au'] = isset($nodup[$d]['au']) ? $nodup[$d]['au'] : 0;
        $fbar = Bar($nodup[$d]['fs'], 100000);
        $lbar = Bar($nodup[$d]['ls'], 1);
        $ibar = Bar($nodup[$d]['iu'], 0);
        $abar = Bar($nodup[$d]['au'], 0);
        $fd = rawurlencode(date("m/d/Y H:i:s", $d));
        echo "<tr bgcolor=#{$bg}>\n";
        echo "<th bgcolor=#{$bg1}>" . date("j.M G:i:s", $d) . "\n";
        echo "<td>{$fbar} <a href=Nodes-List.php?ina=firstseen&opa==&sta=" . $fd . ">" . $nodup[$d]['fs'] . "</a> first seen<br>\n";
        echo "{$lbar} <a href=Nodes-List.php?ina=lastseen&opa==&sta=" . $fd . ">" . $nodup[$d]['ls'] . "</a> last seen <br>\n";
        echo "{$abar} <a href=Nodes-List.php?ina=ipupdate&opa==&sta=" . $fd . ">" . $nodup[$d]['au'] . "</a> IP Updates<br>\n";
        echo "{$ibar} <a href=Nodes-List.php?ina=ifupdate&opa==&sta=" . $fd . ">" . $nodup[$d]['iu'] . "</a> IF Updates</td></tr>\n";
        if ($row == $lim) {
            break;
        }
    }
    echo "</table><table bgcolor=#666666 {$tabtag} >\n";
    echo "<tr bgcolor=#{$bg2}><td>{$row} updates from {$tnod} nodes in total</td></tr></table>\n";
}
include_once "inc/footer.php";
Esempio n. 7
0
            if (in_array("firstdis", $col)) {
                TblCell(date($datfmt, $v[4]), "?in[]=firstdis&op[]==&st[]={$v['4']}", "bgcolor=\"#{$fc}\"");
            }
            if (in_array("lastdis", $col)) {
                TblCell(date($datfmt, $v[5]), "?in[]=lastdis&op[]==&st[]={$v['5']}", "bgcolor=\"#{$lc}\"");
            }
            if (in_array("location", $col)) {
                TblCell($v[6], "?in[]=location&op[]==&st[]=" . urlencode($v[6]));
            }
            if (in_array("contact", $col)) {
                TblCell($v[7], "?in[]=contact&op[]==&st[]=" . urlencode($v[7]));
            }
            if (in_array("poNS", $col)) {
                $pop = NodPop(array('device', 'vlanid'), array('=', '='), array($v[0], $v[1]), array('AND'));
                if ($pop) {
                    TblCell($pop, "Nodes-List.php?in[]=device&in[]=vlanid&op[]==&op[]==&st[]={$ud}&st[]={$v['1']}&co[]=AND", '', Bar($pop, 100, 'si'), 'td-img');
                } else {
                    TblCell();
                }
            }
            echo "</tr>\n";
        }
        DbFreeResult($res);
    } else {
        print DbError($link);
    }
    ?>
</table>
<table class="content">
<tr class="<?php 
    echo $modgroup[$self];
>
<th width=80><img src=img/32/impt.png><br>Level</th>
<th><img src=img/32/eyes.png><br>Events</th>
<?php 
        $row = 0;
        while ($msg = @DbFetchRow($res)) {
            if ($row == "1") {
                $row = "0";
                $bg = $bga;
                $bi = $bia;
            } else {
                $row = "1";
                $bg = $bgb;
                $bi = $bib;
            }
            $mbar = Bar($msg[1], 0);
            echo "<tr bgcolor=#{$bg}>\n";
            echo "<th bgcolor=#{$bi}><a href=Monitoring-Messages.php?lvl={$msg['0']}><img src=img/32/" . $mico[$msg[0]] . ".png border=0 title=" . $mlvl[$msg[0]] . "></a></th><td>{$mbar} {$msg['1']}</td></tr>\n";
        }
        echo "<tr bgcolor=#{$bg2}><td colspan=2>{$nlev} Levels ({$query})</td></tr></table>\n";
    } else {
        echo '<h5>No Messages</h5>';
    }
    @DbFreeResult($res);
} else {
    print @DbError($link);
}
echo '</td></tr></table>';
if ($cpos !== false and !$cty) {
    Cities();
} elseif ($bpos !== false and !$bld) {
            if (in_array("device", $col)) {
                echo "<td><a href=Devices-Status.php?dev={$ud}>{$v['0']}</a></td>\n";
            }
            if (in_array("vlanid", $col)) {
                echo "<td>{$v['1']}</td>";
            }
            if (in_array("vlanname", $col)) {
                echo "<td>{$v['2']}</td>";
            }
            if (in_array("pop", $col)) {
                $nquery = GenQuery('nodes', 'g', 'vlanid', '', '', array('device', 'vlanid'), array('=', '='), array($v[0], $v[1]), array('AND'));
                $np = @DbQuery($nquery, $link);
                $nnp = @DbNumRows($np);
                if ($nnp == 1) {
                    $vpop = @DbFetchRow($np);
                    $pbar = Bar($vpop[1], 110);
                    echo "<td>{$pbar} <a href=Nodes-List.php?ina=device&opa==&sta={$v['0']}&inb=vlanid&opb==&stb={$v['1']}&cop=AND>{$vpop['1']}</td>";
                } else {
                    echo "<td></td>";
                }
                @DbFreeResult($np);
            }
            echo "</tr>\n";
        }
        @DbFreeResult($res);
    } else {
        print @DbError($link);
    }
    echo "</table><table bgcolor=#666666 {$tabtag} >\n";
    echo "<tr bgcolor=#{$bg2}><td>{$row} Vlans ({$query})</td></tr></table>\n";
}
Esempio n. 10
0
					foreach ($log as $t => $v){
						if($pt){
							$d = round(($t-$pt)/86400);
							if($d){
								echo Bar( $d,0,'mi',"$d $tim[d]");
							}
						}
						$pt = $t;
						$lb = explode(";", $v);
						echo " <img src=\"img/16/$lb[0].png\" title=\"$lb[1] ".date($datfmt,$t)."\">";
					}
					echo "</td>\n";
				}
				if( in_array("iiNS",$col) ){
					$ii = IfFree($dev[0]);
					TblCell($ii,"Devices-Interfaces.php?in[]=device&op[]==&st[]=$ud&co[]=AND&in[]=ifstat&op[]=<&st[]=3&co[]=AND&in[]=iftype&op[]=~&st[]=^(6|7|117)$&col[]=imBL&col[]=ifname&col[]=device&col[]=linktype&col[]=ifdesc&col[]=alias&col[]=lastchg&col[]=inoct&col[]=outoct&ord=lastchg",'',Bar($ii,-5,'si').' ','td-img');
				}
				if( in_array("stpNS",$col) and !isset($_GET['xls']) ){
					if($dev[14] and $dev[5] > time() - $rrdstep*2){
						$stppri	= str_replace('"','', Get($ip, $dev[14] & 3, $dev[15], "1.3.6.1.2.1.17.2.2.0") );
						if( preg_match("/^No Such|^$/",$stppri) ){
							TblCell("?");
						}else{
							$numchg	= str_replace('"','', Get($ip, $dev[14] & 3, $dev[15], "1.3.6.1.2.1.17.2.4.0") );
							if( preg_match("/^No Such|^$/",$numchg) ){
								TblCell("TC:?");
							}else{
								$laschg	= str_replace('"','', Get($ip, $dev[14] & 3, $dev[15], "1.3.6.1.2.1.17.2.3.0") );
								sscanf($laschg, "%d:%d:%0d:%0d.%d",$tcd,$tch,$tcm,$tcs,$ticks);
								$tcstr  = sprintf("%dD-%d:%02d:%02d",$tcd,$tch,$tcm,$tcs);
								$rport	= str_replace('"','', Get($ip, $dev[14] & 3, $dev[15], "1.3.6.1.2.1.17.2.7.0") );
<h2>Least Used Devices</h2><p>
<table class="content"><tr class="<?php 
echo $modgroup[$self];
?>
2">
<th colspan=2 width=25%><img src="img/32/dev.png"><br>Device</th>
<th><img src="img/32/dumy.png"><br>Total Interfaces</th>
<th><img src="img/32/cnic.png"><br>Used Interfaces</th>
<?
	asort($ainorm);
	$row = 0;
	foreach ($ainorm as $dv => $up){
		if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";}
		$row++;
		$ubar	= Bar($up,48);
		$ud	= rawurlencode($dv);
		echo "<tr class=\"$bg\"><th class=\"$bi\">\n";
		echo "$row</th><td><a href=Devices-Status.php?dev=$ud&shp=on>$dv</a></td>\n";
		echo "<td align=center>".$numif[$dv]."</td><td>$ubar $up % (".$nactif[$dv].")</td></tr>\n";
		if($row == $lim){break;}
	}
	?>
</table>
<table class="content" >
<tr class="<?php 
echo $modgroup[$self];
?>
2"><td><?php 
echo $row;
?>
Esempio n. 12
0
     echo "<td>{$l['8']}</td>";
 }
 if (in_array("dvNS", $col)) {
     $lor = TopoLoc($l[1], $l[2], $l[3]);
     $pop = DevPop(array('location'), array('like'), array($lor));
     if ($pop) {
         TblCell($pop, "Devices-List.php?in[]=location&op[]=like&st[]=" . urlencode($lor), '', Bar($pop, 100, 'si'), 'td-img');
     } else {
         TblCell();
     }
 }
 if (in_array("poNS", $col)) {
     $lor = TopoLoc($l[1], $l[2], $l[3]);
     $pop = NodPop(array('location'), array('like'), array($lor), array());
     if ($pop) {
         TblCell($pop, "Nodes-List.php?in[]=location&op[]=like&st[]=" . urlencode($lor), '', Bar($pop, 100, 'si'), 'td-img');
     } else {
         TblCell();
     }
 }
 if (in_array("filNS", $col)) {
     echo "<td>";
     $fp = 'topo';
     if ($l[1]) {
         $fp .= '/' . preg_replace('/\\W/', '', $l[1]);
     }
     if ($l[2]) {
         $fp .= '/' . preg_replace('/\\W/', '', $l[2]);
     }
     if ($l[3]) {
         $fp .= '/' . preg_replace('/\\W/', '', $l[3]);
Esempio n. 13
0
        ?>
</th>
<?php 
        $row = 0;
        while ($r = DbFetchRow($res)) {
            if ($row % 2) {
                $bg = "txta";
                $bi = "imga";
            } else {
                $bg = "txtb";
                $bi = "imgb";
            }
            $row++;
            $s = substr($r[0], 0, $_SESSION['lsiz']);
            # Shorten labels
            $mbar = Bar($r[2], 0, 'si');
            echo "<tr class=\"{$bg}\"><th class=\"{$bi}\" nowrap><a href=\"Devices-Status.php?dev=" . urlencode($r[0]) . "\">{$s}</th>\n";
            echo "<td nowrap>{$mbar} <a href=\"{$r['1']}://" . urlencode($r[0]) . "/Monitoring-Events.php?in[]=level&op[]=>&st[]=150&co[]=AND&in[]=time&op[]=>&st[]={$firstmsg}\">{$r['2']}</a></td>\n";
            echo "<th nowrap>\n";
            echo "<a href=\"{$r['1']}://" . urlencode($r[0]) . "/Monitoring-Health.php\"><img src=\"img/16/hlth.png\" title=\"{$r['0']} Health\"></a>\n";
            echo "<a href=\"{$r['1']}://" . urlencode($r[0]) . "/Monitoring-Setup.php\"><img src=\"img/16/bino.png\" title=\"{$r['0']} {$monlbl} {$cfglbl}\"></a>\n";
            echo "<a href=\"{$r['1']}://" . urlencode($r[0]) . "/Reports-Combination.php?in[]=&op[]=~&st[]=&rep=mon\"><img src=\"img/16/chrt.png\" title=\"{$r['0']} {$inclbl} {$sumlbl}\"></a>\n";
            echo "<a href=\"{$r['1']}://" . urlencode($r[0]) . "/Reports-Monitoring.php?rep[]=lat&rep[]=evt\"><img src=\"img/16/dbin.png\" title=\"{$r['0']} {$monlbl} {$stslbl}\"></a>\n";
            echo "<a href=\"{$r['1']}://" . urlencode($r[0]) . "/System-Services.php\"><img src=\"img/16/cog.png\" title=\"{$r['0']} {$srvlbl}\"></a>\n";
            echo "</th></tr>\n";
        }
        echo "</table>\n";
    } else {
        echo "<p><h5>{$nonlbl}</h5>";
    }
    DbFreeResult($res);
     } else {
         arsort($aginc);
     }
     $row = 0;
     foreach ($aginc as $na => $nainc) {
         if ($row % 2) {
             $bg = $bga;
             $bi = $bia;
         } else {
             $bg = $bgb;
             $bi = $bib;
         }
         $row++;
         $ibar = Bar($nainc);
         $adly = intval($agdly[$na] / $nainc / 3600);
         $dbar = Bar($adly, 24);
         echo "<tr bgcolor=#{$bg}>";
         echo "<th bgcolor=#{$bi}><img src=" . Smilie($na) . " title=\"Hello I'm {$na}\"'><p>{$na}</th>\n";
         echo "<td>{$ibar} {$nainc}</td><td>{$dbar} {$adly} hours</td></tr>\n";
         if ($row == $lim) {
             break;
         }
     }
     echo "</table><table bgcolor=#666666 {$tabtag} >\n";
     echo "<tr bgcolor=#{$bg2}><td>{$row} of {$tdev} devices with incidents shown</td></tr></table>\n";
 }
 if (in_array("cal", $rep)) {
     $heuer = $now['year'];
     if ($lim == 20) {
         $heuer -= 1;
     } elseif ($lim == 50) {
Esempio n. 15
0
function NodSum($ina, $opa, $sta, $lim, $ord)
{
    global $link, $modgroup, $self, $rrdstep, $stco, $sumlbl, $srtlbl, $venlbl, $qtylbl, $alllbl, $chglbl, $totlbl, $deslbl, $fislbl, $laslbl, $emplbl, $namlbl, $metlbl, $nonlbl, $loslbl, $qutlbl, $faslbl, $vallbl, $mullbl;
    $lasdis = time() - $rrdstep * 2;
    $query = GenQuery('nodes', 's', "count(*),sum(case when nodip = 0 then 1 else 0 end),sum(case when name = '' then 1 else 0 end),sum(case when firstseen = lastseen then 1 else 0 end),sum(case when iplost > 0 then 1 else 0 end),sum(case when ifmetric < 256 then 1 else 0 end),sum(case when firstseen > {$lasdis} then 1 else 0 end),sum(case when lastseen > {$lasdis} then 1 else 0 end),sum(case when ipchanges > 0 then 1 else 0 end),sum(case when ifchanges > 0 then 1 else 0 end),sum(case when arpval > 1 then 1 else 0 end)", '', '', array($ina), array($opa), array($sta), array(), 'LEFT JOIN devices USING (device)');
    $res = DbQuery($query, $link);
    if ($res) {
        $r = DbFetchRow($res);
    } else {
        print DbError($link);
        die;
    }
    ?>
<table class="full fixed"><tr><td class="helper">

<h2>Node <?php 
    echo $sumlbl;
    ?>
 </h2>
<table class="content"><tr class="<?php 
    echo $modgroup[$self];
    ?>
2">
<th width="33%" colspan="2"><img src="img/16/find.png" title="Nodes <?php 
    echo $stslbl;
    ?>
">
<br><?php 
    echo $deslbl;
    ?>
</th><th><img src="img/16/nods.png"><br>Nodes</th>
<tr class="txtb"><th class="imgb"><img src="img/16/add.png" title="<?php 
    echo $fislbl;
    ?>
 > <?php 
    echo date($_SESSION['date'], $lasdis);
    ?>
"></th><td><b><?php 
    echo $stco['10'];
    ?>
</b></td><td><?php 
    echo Bar($r[6], 0, 'mi');
    ?>
 <a href="Nodes-List.php?in[]=firstseen&op[]=>&st[]=<?php 
    echo $lasdis;
    ?>
&ord=nodip"><?php 
    echo $r[6];
    ?>
</a></td></tr>
<tr class="txta"><th class="imga"><img src="img/16/exit.png" title="<?php 
    echo $laslbl;
    ?>
 > <?php 
    echo date($_SESSION['date'], $lasdis);
    ?>
"></th><td><b><?php 
    echo $stco['100'];
    ?>
</b></td><td><?php 
    echo Bar($r[7], 0, 'mi');
    ?>
 <a href="Nodes-List.php?in[]=lastseen&op[]=>&st[]=<?php 
    echo $lasdis;
    ?>
&ord=nodip"><?php 
    echo $r[7];
    ?>
</a></td></tr>
<tr class="txtb"><th class="imgb"><img src="img/16/wlan.png" title="IF <?php 
    echo $metlbl;
    ?>
 < 256"></th><td><b>Wlan</th></b><td><?php 
    echo Bar($r[5], 0, 'mi');
    ?>
 <a href="Nodes-List.php?in[]=ifmetric&op[]=<&st[]=256&ord=ifmetric+desc"> <?php 
    echo $r[5];
    ?>
</a></td></tr>
<tr class="txta"><th class="imga"><img src="img/16/calc.png" title="IP <?php 
    echo $chglbl;
    ?>
 > 0"></th><td><b>IP <?php 
    echo $chglbl;
    ?>
</b></td><td><?php 
    echo Bar($r[8], 0, 'mi');
    ?>
 <a href="Nodes-List.php?in[]=ipchanges&op[]=>&st[]=0&ord=ipchanges+desc"><?php 
    echo $r[8];
    ?>
</a></td></tr>
<tr class="txtb"><th class="imgb"><img src="img/16/walk.png" title="IF <?php 
    echo $chglbl;
    ?>
 > 0"></th><td><b>IF <?php 
    echo $chglbl;
    ?>
</b></td><td><?php 
    echo Bar($r[9], 0, 'mi');
    ?>
 <a href="Nodes-List.php?in[]=ifchanges&op[]=>&st[]=0&ord=ifchanges+desc"><?php 
    echo $r[9];
    ?>
</a></td></tr>
<tr class="txta"><th class="imga"><img src="img/16/abc.png"  title=" <?php 
    echo $namlbl;
    ?>
 = ''"></th><td><b><?php 
    echo $namlbl;
    ?>
 <?php 
    echo $emplbl;
    ?>
</b></td><td><?php 
    echo Bar($r[2], 0, 'mi');
    ?>
 <a href="Nodes-List.php?in[]=name&op[]=~&st[]=^$&ord=nodip"><?php 
    echo $r[2];
    ?>
</a></td></tr>
<tr class="txtb"><th class="imgb"><img src="img/16/glob.png" title="IP = 0"></th><td><b><?php 
    echo $nonlbl;
    ?>
 IP</b></td><td><?php 
    echo Bar($r[1], 0, 'mi');
    ?>
 <a href="Nodes-List.php?in[]=nodip&op[]==&st[]=0"> <?php 
    echo $r[1];
    ?>
</a></td></tr>
<tr class="txta"><th class="imga"><img src="img/16/grph.png" title="IP <?php 
    echo $loslbl;
    ?>
 > 0"></th><td><b><?php 
    echo $qutlbl;
    ?>
</b></td><td><?php 
    echo Bar($r[4], 0, 'mi');
    ?>
 <a href="Nodes-List.php?in[]=iplost&op[]=%3E&st[]=0&ord=iplost+desc"><?php 
    echo $r[4];
    ?>
</a></td></tr>
<tr class="txtb"><th class="imgb"><img src="img/16/flas.png" title="<?php 
    echo $fislbl;
    ?>
 = <?php 
    echo $laslbl;
    ?>
"></th><td><b><?php 
    echo $faslbl;
    ?>
</b></td><td><?php 
    echo Bar($r[3], 0, 'mi');
    ?>
 <a href="Nodes-List.php?in[]=firstseen&co[]==&in[]=lastseen&ord=firstseen"><?php 
    echo $r[3];
    ?>
</a></td></tr>
<tr class="txta"><th class="imga"><img src="img/16/hat.png" title="ARP <?php 
    echo $vallbl;
    ?>
 > 1"></th><td><b><?php 
    echo $mullbl;
    ?>
 ARP</b></td><td><?php 
    echo Bar($r[10], 0, 'mi');
    ?>
 <a href="Nodes-List.php?in[]=arpval&op[]=>&st[]=1"><?php 
    echo $r[10];
    ?>
</a></td></tr>
<tr class="txtb"><th class="imgb"><img src="img/16/nods.png" title="<?php 
    echo $alllbl;
    ?>
 Nodes"></th><td><b><?php 
    echo $totlbl;
    ?>
</b></td><td><?php 
    echo Bar($r[0], 0, 'mi');
    ?>
 <?php 
    echo $r[0];
    ?>
</td></tr>
</table>

</td><td class="helper">

<h2>OUI <?php 
    echo $venlbl;
    ?>
 </h2>
<table class="content"><tr class="<?php 
    echo $modgroup[$self];
    ?>
2">
<th colspan="2" width="50%"><img src="img/16/card.png"><br><?php 
    echo $venlbl;
    ?>
</th>
<th><img src="img/16/nods.png"><br>Nodes</th>
<?php 
    if ($ord) {
        $ocol = 'oui';
        $srt = "{$srtlbl}: {$venlbl}";
    } else {
        $ocol = 'cnt desc';
        $srt = "{$srtlbl}: {$qtylbl}";
    }
    $query = GenQuery('nodes', 'g', 'oui', $ocol, $lim, array($ina), array($opa), array($sta), array(), '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++;
            $uo = urlencode($r[0]);
            echo "<tr class=\"{$bg}\"><th class=\"{$bi}\"><img src=\"img/oui/" . Nimg($r[0]) . ".png\"></th>\n";
            echo "<td><a href=\"http://www.google.com/search?q={$uo}&btnI=1\">{$r['0']}</a></td><td>" . Bar($r[1], 0, 'mi') . " <a href=\"Nodes-List.php?in[]=oui&op[]==&st[]={$uo}\">{$r['1']}</a></td></tr>\n";
        }
    }
    ?>
</table>
<table class="content" >
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2"><td><?php 
    echo $row;
    ?>
 <?php 
    echo $venlbl;
    ?>
, <?php 
    echo $srt;
    ?>
</td></tr>
</table>

</td></tr></table>
<p>
<?php 
}
Esempio n. 16
0
			}
			$curif = ($lcs < $rrdstep)?'class="gry"':'';
			echo "<td>$ifi[$i]</td><td align=\"center\"$curif>$ifv[$i]</td>\n";
			echo "<td align=\"right\"$curif nowrap>".DecFix($ifs[$i])."</td><td align=\"center\"$curif>$ifd[$i]</td>\n";
			echo "<td align=\"right\" $blc nowrap>$iflch</td>\n";

			if($pop){
				if($niflog[$in]){
					$bnl = sprintf("%02x","40" + $off);
					echo "<td bgcolor=\"#$bg3$bg3$bnl\" title=\"$niflog[$in]\" nowrap>";
				}else{
					echo "<td nowrap>";
				}

				if($ncount[$in]){
					echo Bar($ncount[$in],8,'mi') . " <a href=Nodes-List.php?in[]=device&op[]==&st[]=$ud&co[]=AND&in[]=ifname&op[]==&st[]=$ui title=\"Nodes-List\">$ncount[$in]</a>\n";
				}
				echo "</td>\n";
			}

			if($shg and $_SESSION['gsiz']){
				echo "<td nowrap align=\"center\">\n";
				IfGraphs($ud, $ui, $ifs[$i], $_SESSION['gsiz']);
				echo "</td>\n";
			}else{

				if ($ino[$i] > 70){								# Ignore the first 70  bytes...
					$rio[$i] = ($ifs[$i])?round($dio[$i] / $ifs[$i] / $rrdstep * 800,1):0;
					$bio = "title=\"$rio[$i]%\" bgcolor=\"#".(($rio[$i] > $trfa)?sprintf("%02x","40" + $off):$bg3)."$bg3".sprintf("%02x","40" + $off)."\"";
					if ($die[$i]){
						$ier = $die[$i] * $die[$i] * 8/(($dio[$i])?$dio[$i]:1);
Esempio n. 17
0
	echo "<th class=\"$bi\"> ";
	if($inactive){											# Only allow activate inactive DBs
?>
<a href="?sel=<?= urlencode($ss[0]) ?>">
<img src="img/16/bcls.png" title="DB <?= $sellbl ?>">
</a>
<?php 
	}else{
		echo "<img src=\"img/16/walk.png\" title=\"DB $stco[100]\">";
	}
?>
</th>
<td><b><?= $ss[0] ?></b></td>
<td><?= Bar($devs[0],'lvl100','mi') ?> <?= $devs[0] ?></td>
<td><?= Bar($cfgs[0],'lvl150','mi') ?> <?= $cfgs[0] ?></td>
<td><?= Bar($nods[0],'lvl50','mi') ?> <?= $nods[0] ?></td>
<td><?= date($_SESSION['date'],$fdis[0]) ?></td>

<th width="80">
<?php 
	if( $isadmin and $inactive and strpos($ss[0],"_") ){						# Only allow to delete inactive snapshots
?>
<a href="?del=<?= urlencode($ss[0]) ?>">
<img src="img/16/bcnl.png" onclick="return confirm('<?= $dellbl ?>, <?= $cfmmsg ?>')" title="<?= (($verb1)?"$dellbl Snapshot":"Snapshot $dellbl") ?>">
</a>
</td></tr>

<?php 
	}
	echo "</td></tr>\n";
}
Esempio n. 18
0
 list($ifimg, $iftit) = Iftype($ift[$i]);
 echo "<tr bgcolor=#{$bg}>";
 echo "<th bgcolor=#{$rs}{$gs}{$bg3}><img src=img/{$ifimg} title=\"{$i} - {$iftit}\" vspace=8></th>\n";
 echo "<td><b>{$in}</b></td>\n";
 echo "<td align=center>{$ifv[$i]}</td><td>{$ifi[$i]}</td>\n";
 echo "<td align=right>{$ifs[$i]}</td><td align=center>{$ifd[$i]}</td>\n";
 echo "<td align=right bgcolor=#{$blc}{$bg3}{$bg3}>{$iflch}</td>\n";
 if ($shp) {
     if ($niflog[$in]) {
         $bnl = sprintf("%02x", "40" + $off);
         echo "<td bgcolor=#{$bg3}{$bg3}{$boo} title=\"Last node tracked " . date($datfmt, $niflog[$in]) . "\" nowrap>";
     } else {
         echo "<td nowrap>";
     }
     if ($ncount[$in]) {
         echo Bar($ncount[$in], 8) . " <a href=Nodes-List.php?ina=device&opa==&sta={$ud}&cop=AND&inb=ifname&opb==&stb={$ui} title=\"{$ud}-{$in} Nodes-List\">{$ncount[$in]}</a>\n";
     }
     echo "</td>\n";
 }
 if ($shg) {
     if ($ud and $ui) {
         // Still needed?
         echo "<td nowrap align=center>\n";
         echo "<a href=Devices-Graph.php?dv={$ud}&if%5B%5D={$ui} title=\"{$in} Devices-Graph\">\n";
         echo "<img src=inc/drawrrd.php?dv={$ud}&if%5B%5D={$ui}&s=s&t=trf border=0>\n";
         echo "<img src=inc/drawrrd.php?dv={$ud}&if%5B%5D={$ui}&s=s&t=err border=0></a>\n";
     } else {
         echo "<td>Tell Remo, if you see this!!!</td>";
     }
 } else {
     echo "<td bgcolor=#{$bg3}{$bg3}{$bio} align=right>" . $ino[$i] . "</td>\n";
Esempio n. 19
0
 if (in_array("comment", $col)) {
     TblCell($if[28]);
 }
 if (in_array("trafalert", $col)) {
     TblCell($if[29] . '%');
 }
 if (in_array("bcastalert", $col)) {
     TblCell($if[30] . '/s');
 }
 if (in_array("macflood", $col)) {
     TblCell($if[31]);
 }
 if (in_array("poNS", $col) and !isset($_GET['xls'])) {
     $pop = NodPop(array('device', 'ifname'), array('=', '='), array($if[0], $if[1]), array('AND'));
     if ($pop) {
         echo "<td nowrap>" . Bar($pop, 24, 'mi') . " <a href=Nodes-List.php?in[]=device&op[]==&st[]={$ud}&in[]=ifname&op[]==&st[]={$if['1']}&co[]=AND\">{$pop}</td>";
     } else {
         TblCell();
     }
     DbFreeResult($np);
 }
 if (in_array("gfNS", $col) and !isset($_GET['xls'])) {
     echo "<td nowrap align=\"center\">\n";
     IfGraphs($ud, $ui, $if[9], $_SESSION['gsiz']);
     echo "</td>\n";
 }
 if (in_array("rdrNS", $col) and !isset($_GET['xls'])) {
     echo "<td nowrap align=\"center\">\n";
     IfRadar("rt{$row}", $_SESSION['gsiz'], '248', $if[12], $if[14], $if[13], $if[15], $if[20], $if[21], $if[24]);
     IfRadar("rl{$row}", $_SESSION['gsiz'], '284', $if[16], $if[18], $if[17], $if[19], $if[22], $if[23], $if[25]);
     echo "</td>\n";
Esempio n. 20
0
<?php 
$query = GenQuery('stock', 'g', 'location');
$res = @DbQuery($query, $link);
if ($res) {
    $row = 0;
    while ($dev = @DbFetchRow($res)) {
        if ($row % 2) {
            $bg = $bgb;
            $bi = $bib;
        } else {
            $bg = $bga;
            $bi = $bia;
        }
        $row++;
        $stbar = Bar($dev[1], 0);
        echo "<tr bgcolor=#{$bg}>\n";
        echo "<td>{$dev['0']}</td><td>\n";
        echo "{$stbar} {$dev['1']}</td></tr>\n";
    }
}
?>
</table><table bgcolor=#666666 <?php 
echo $tabtag;
?>
 >
<tr bgcolor=#<?php 
echo $bg2;
?>
><td><?php 
echo $row;
Esempio n. 21
0
</th>
<?php 
$query = GenQuery('stock', 'g', 'state');
$res = DbQuery($query, $link);
if ($res) {
    $row = 0;
    while ($item = DbFetchRow($res)) {
        if ($row % 2) {
            $bg = "txta";
            $bi = "imga";
        } else {
            $bg = "txtb";
            $bi = "imgb";
        }
        $row++;
        $stbar = Bar($item[1], 0, 'mi');
        echo "<tr class=\"{$bg}\">\n";
        echo "<th class=\"{$bi}\" width=\"50px\"><img src=\"img/16/" . $cico[$item[0]] . ".png\" title=" . $stco[$item[0]] . "></th>\n";
        echo "<td><a href=\"?lst=st&val={$item['0']}\">" . $stco[$item[0]] . "</a></td><td>{$stbar} {$item['1']}</td></tr>\n";
    }
}
?>
</table>
<table class="content">
<tr class="<?php 
echo $modgroup[$self];
?>
2"><td><?php 
echo $row;
?>
 <?php 
<?php 
        if ($ord) {
            asort($topup);
        } else {
            arsort($topup);
        }
        $row = 0;
        foreach ($topup as $dv => $ticks) {
            if ($row % 2) {
                $bg = $bga;
                $bi = $bia;
            } else {
                $bg = $bgb;
                $bi = $bib;
            }
            $row++;
            $ud = rawurlencode($dv);
            $upt = $ticks / 8640000;
            $ubar = Bar($upt, 365);
            echo "<tr bgcolor=#{$bg}>";
            echo "<th bgcolor=#{$bi}><a href=Devices-Status.php?dev={$ud}><img src=img/dev/{$dico[$dv]}.png border=0 title=\"{$dtyp[$dv]}\"><p></a>{$dv}</th>\n";
            echo "<td><a href=telnet://{$dip[$dv]}>{$dip[$dv]}</td><td>{$dcon[$dv]}</td><td>{$ubar} " . sprintf("%01.2f", $upt) . " Days</td></tr>\n";
            if ($row == $lim) {
                break;
            }
        }
        echo "</table><table bgcolor=#666666 {$tabtag} >\n";
        echo "<tr bgcolor=#{$bg2}><td>{$row} uptime sources</td></tr></table>\n";
    }
}
include_once "inc/footer.php";
 if ($ord) {
     ksort($nummo);
 } else {
     arsort($nummo);
 }
 $row = 0;
 foreach ($nummo as $mdl => $n) {
     if ($row % 2) {
         $bg = $bga;
         $bi = $bia;
     } else {
         $bg = $bgb;
         $bi = $bib;
     }
     $row++;
     $tbar = Bar($n, 0);
     $um = rawurlencode($mdl);
     echo "<tr bgcolor=#{$bg}>\n";
     echo "<th bgcolor=#{$bi} width=10%><a href=Devices-Modules.php?ina=model&opa==&sta={$um}><b>{$mdl}</b></a></th>\n";
     echo "<td>{$modes[$mdl]}</td><td>";
     foreach ($modev[$mdl] as $dv => $ndv) {
         $ud = rawurlencode($dv);
         echo "<a href=Devices-Status.php?dev={$ud}>{$dv}</a>:<b>{$ndv}</b> ";
     }
     echo "</td>\n";
     echo "<td>{$tbar} {$n}</td></tr>\n";
     if ($row == $lim) {
         break;
     }
 }
 echo "</table><table bgcolor=#666666 {$tabtag} >\n";
<?php 
            $row = 0;
            foreach (array_keys($nets) as $dn) {
                if ($row % 2) {
                    $bg = $bga;
                    $bi = $bia;
                } else {
                    $bg = $bgb;
                    $bi = $bib;
                }
                $row++;
                $net = long2ip($dn);
                list($pfix, $mask, $bmsk) = Masker($nets[$dn]);
                list($ntimg, $ntit) = Nettype($net);
                $pbar = Bar($pop[$dn], 110);
                $abar = Bar($age[$dn]);
                $dvs = "";
                foreach (array_keys($devs[$dn]) as $dv) {
                    $du = rawurlencode($dv);
                    $dvs .= "<a href=Devices-Status.php?dev={$du}>{$dv}</a> " . $devs[$dn][$dv] . "<br>\n";
                }
                echo "<tr bgcolor=#{$bg}>";
                echo "<td bgcolor={$bi} width=20 align=center><img src=img/16/{$ntimg} title={$ntit}></td>\n";
                echo "<td><a href=Devices-Map.php?ina=network&flt={$net}%2F{$pfix}&draw=1>{$net}/{$pfix}</a></td>\n";
                echo "<td>{$dvs}</td><td>{$pbar} <a href=Nodes-List.php?ina=ip&opa==&sta={$net}/{$pfix}&ord=ip>{$pop[$dn]}</a></td>\n";
                echo "<td>{$abar} {$age[$dn]} days</td>\n";
                echo "</tr>\n";
            }
            echo "</table><table bgcolor=#666666 {$tabtag} >\n";
            echo "<tr bgcolor=#{$bg2}><td>{$row} networks ({$query})</td></tr></table>\n";
        } else {
		}
		foreach (snmprealwalk($ip,$dev[15],'.1.3.6.1.4.1.9.10.2.1.1.2.1.23') as $ix => $val){
			$last[substr(strstr($ix,'9.10.2.1.1.2.1.'),18)] = $val;
		}

		$nmrout = 0;

		ksort($prun);
		$row = 0;
		foreach($prun as $mr => $pr){
			if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";}
			$row++;
			$i		= explode(".", $mr);
			if($pr == 1){$primg = "bstp";}else{$primg = "brgt";}
			sscanf($last[$mr], "%d:%d:%0d:%0d.%d",$lud,$luh,$lum,$lus,$ticks);
			$bpsbar = Bar( intval($bps[$mr]/1000),0);
			$ip = "$i[4].$i[5].$i[6].$i[7]";
			echo "<tr class=\"$bg\">\n";
			echo "<td><a href=Nodes-List.php?ina=ip&opa==&sta=$ip>$ip</td><td><img src=\"img/16/$primg.png\" title=\"prune status\">$i[0].$i[1].$i[2].$i[3]</td>\n";
			echo "<td>$bpsbar".$bps[$mr]."</td>\n";
			printf("<td>%d D %d:%02d:%02d</td>",$lud,$luh,$lum,$lus);
			echo "</tr>\n";
		}
	}
	?>
</table>
<table class="content">
<tr class="<?php 
echo $modgroup[$self];
?>
2"><td><?php 
            if (!$nmsg) {
                echo "<img src=img/16/fogy.png title=\"All Messages\"> ";
            }
            $tmsg += $nmsg;
            echo "{$nmsg}</td></tr>\n";
            @DbFreeResult($res);
        } else {
            print @DbError($link);
        }
    } else {
        $query = GenQuery('messages', 's', 'id', '', '', array('time', 'time'), array('>=', '<'), array($istart, $iend), array('AND'));
        $res = @DbQuery($query, $link);
        if ($res) {
            $m = @DbNumRows($res);
            $mbar = "";
            if ($m) {
                $mbar = Bar($m, 0);
            }
            echo "<img src=img/16/fogy.png title=\"All Messages\">{$mbar} {$m}</td></tr>\n";
            $tmsg += $m;
            @DbFreeResult($res);
        } else {
            print @DbError($link);
        }
    }
    $istart = $iend;
    flush();
}
echo "</table><table bgcolor=#666666 {$tabtag} >\n";
echo "<tr bgcolor=#{$bg2}><td>Total of {$tmsg} messages shown</td></tr></table>\n";
include_once "inc/footer.php";
Esempio n. 27
0
			if(in_array("type",$col)){	TblCell( $n[23],"?in[]=type&op[]==&st[]=".urlencode($n[23]) );}
			if(in_array("location",$col)){	TblCell( $n[24],"?in[]=location&op[]==&st[]=".urlencode($n[24]) );}
			if(in_array("contact",$col)){	TblCell( $n[25],"?in[]=contact&op[]==&st[]=".urlencode($n[25]) );}

			if( in_array("ifname",$col) ){
				list($ifimg,$iftit) = Iftype($n[26]);
				list($ifbg,$ifst)   = Ifdbstat($n[29]);
				TblCell($n[7],"?in[]=device&op[]==&in[]=ifname&op[]==&st[]=$ud&co[]=AND&st[]=$ui","class=\"$ifbg\"","<img src=\"img/$ifimg\" title=\"$iftit, $ifst\">",'td-img');
			}
			if(in_array("ifdesc",$col)){	TblCell($n[27]);}
			if(in_array("alias",$col)){	TblCell($n[28]);}
			if(in_array("speed",$col)){	TblCell( DecFix($n[30]),"","align=\"right\"" );}
			if(in_array("duplex",$col))	{TblCell($n[31]);}
			if(in_array("vlanid",$col))	{TblCell( ($n[9] < 255)?"SSID:$n[8]":$n[8],"?in[]=vlanid&op[]==&st[]=$n[8]","align=\"right\"");}
			if(in_array("pvid",$col))	{TblCell( ($n[9] < 255)?"CH:$n[32]":$n[32],"?in[]=vlanid&op[]==&st[]=$n[8]","align=\"right\"");}
			if(in_array("ifmetric",$col)){	TblCell( (($n[9] < 255)?Bar($n[9],-30,'mi')." $n[9]db":"$n[9]"),"?in[]=ifmetric&op[]==&st[]=$n[9]","nowrap" );}
			if(in_array("ifupdate",$col)){
				list($i1c,$i2c) = Agecol($n[10],$n[10],$row % 2);
				TblCell( date($datfmt,$n[10]),"","nowrap bgcolor=\"#$i1c\"");
			}
			if(in_array("ifchanges",$col)){	TblCell($n[11],"?in[]=ifchanges&op[]==&st[]=$n[11]");}
			if(in_array("lastchg",$col)){
				list($i1l,$i2l) = Agecol($n[33],$n[33],$row % 2);
				TblCell(date($datfmt,$n[33]),"?in[]=lastchg&op[]==&st[]=$n[33]","nowrap bgcolor=\"#$i1l\"");
			}
			if(in_array("dinerr",$col))	{TblCell($n[34]);}
			if(in_array("douterr",$col))	{TblCell($n[35]);}
			if(in_array("dindis",$col))	{TblCell($n[36]);}
			if(in_array("doutdis",$col))	{TblCell($n[37]);}
			if(in_array("tcpports",$col))	{TblCell($n[17],"?in[]=tcpports&op[]==&st[]=$n[17]");}
			if(in_array("udpports",$col))	{TblCell($n[18],"?in[]=udpports&op[]==&st[]=$n[18]");}