function TopoLocErr($siz = 0) { global $noloc, $img, $debug, $manlbl, $bg2, $loclbl, $errlbl; if (!count($noloc)) { return; } echo "<br><p><h2>{$loclbl} {$errlbl}</h2>\n"; echo "<table class=\"content fixed\"><tr>\n"; $col = 0; foreach (array_keys($noloc) as $d) { $ip = $noloc[$d]['ip']; $ty = $noloc[$d]['ty']; $di = $noloc[$d]['ic']; $lo = $noloc[$d]['lo']; $co = $noloc[$d]['co']; $po = $noloc[$d]['po']; $mn = $noloc[$d]['mn']; $al = $noloc[$d]['al']; list($statbg, $stat) = StatusBg(1, $mn, $al, 'imga'); $tit = $stat ? $stat : $ty; $ud = urlencode($d); if ($col == $_SESSION['col']) { $col = 0; echo "\n</tr><tr>\n"; } if ($siz) { echo "<th class=\"{$statbg}\" valign=\"top\"><img src=\"img/dev/{$di}.png\" title=\"{$lo}, {$co}\"><br>{$d}</th>\n"; } else { echo "<td class=\"{$statbg}\" valign=\"top\"><div style=\"text-align:center;\">\n"; echo "<a href=\"Devices-Status.php?dev={$ud}\">"; echo "<img src=\"" . ($img ? DevPanel($ty, $di, $sz) . "\" width=\"" . (preg_match('/^ph|^wa|^ca/', $di) ? 40 : 100) . "\"" : "img/dev/{$di}.png\"") . " title=\"{$tit}\"></a>{$sk}<br><b>{$d}</b><br>\n"; echo Devcli($ip, $po); echo "<br>{$lo}<br><span class=\"gry\">{$co}</span></div></td>\n"; } $col++; } echo "</tr></table>\n"; }
<tr><th class="imga" width="80"> <a href=Devices-Status.php?dev=<?php echo $ud; ?> ><img src="img/dev/<?php echo $devimg[$rtr]; ?> .png" title="<?php echo $stalbl; ?> "></a> <br><?php echo $rtr; ?> </th><td class="txta"><?php echo Devcli($devip[$rtr], $devcli[$rtr]); ?> </td></tr> <tr><th class="<?php echo $modgroup[$self]; ?> 2"><?php echo $srvlbl; ?> </th><td class="txtb"><?php echo $devsrv[$rtr] ? $devsrv[$rtr] : " "; ?> </td></tr> <tr><th class="<?php echo $modgroup[$self]; ?>
<table class="full fixed"><tr><td class="helper"> <h2>Device <?= $sumlbl ?></h2> <table class="content"> <tr><th class="imga" width="80"> <a href="Devices-Status.php?dev=<?= $ud ?>"><img src="img/dev/<?= $img ?>.png" title="<?= $stalbl ?>"></a> <br><?= $dev ?></th><td class="txta"> <div style="float:right"> <a href="telnet://<?= $ip ?>"><img src="img/16/loko.png" title="Telnet"></a> <a href="ssh://<?= $ip ?>"><img src="img/16/lokc.png" title="SSH"></a> <a href="http://<?= $ip ?>" target="window"><img src="img/16/glob.png" title="HTTP"></a> <a href="https://<?= $ip ?>" target="window"><img src="img/16/glok.png" title="HTTPS"></a> </div> <?= (Devcli($ip,$cli)) ?></td></tr> <tr><th class="<?= $modgroup[$self] ?>2"><?= $srvlbl ?></th><td class="txtb"><?= ($sv)?$sv:" " ?></td></tr> <tr><th class="<?= $modgroup[$self] ?>2"><?= $loclbl ?></th><td class="txta"><?= $loc ?></td></tr> <tr><th class="<?= $modgroup[$self] ?>2"><?= $conlbl ?></th><td class="txtb"><?= $con ?></td></tr> <tr><th class="<?= $modgroup[$self] ?>2">SNMP</th><td class="txta">v<?= $rv ?> <?= $rc ?></td></tr> </table> </td><td class="helper"> <h2>Spanningtree <?= $sumlbl ?><?= ($vln)?" Vlan $vln":"" ?></h2> <table class="content"><tr> <th class="<?= $modgroup[$self] ?>2">Bridge <?= $adrlbl ?></th><td class="txta"> <?php $braddr = str_replace('"','', Get($ip, $rv, $rc, "1.3.6.1.2.1.17.1.1.0") ); if ($braddr){ $m = explode(":",$braddr);
window.open('inc/snmpwalk.php?d=<?= $debug ?>&ip=' + document.bld.ip.value + '&v=' + document.bld.ver.value.substr(0,1) + '&c=' + document.bld.co.value + '&oid=' + oid,'SNMP','scrollbars=1,menubar=0,resizable=1,width=500,height=600'); } //--> </script> <table class="content" ><tr class="<?= $modgroup[$self] ?>2"> <th width="50" rowspan="3" class="<?= $modgroup[$self] ?>1"><a href="<?= $self ?>.php"><img src="img/32/<?= $selfi ?>.png"></a></th> <td> <form name="bld"> <table width="100%"> <tr><th align="right">IP</th> <td><input type="text" name="ip" value="<?= $ip ?>" size="20" onfocus="select();" title="target's IP address"> <?= (Devcli($ip,22,1)) ?> <?= (Devcli($ip,23,1)) ?> </td> <th align="right">Community</th><td><input type="text" name="co" value="<?= $co ?>" size="20" onfocus="select();" title="target's SNMP community"></td></tr> <tr class="<?= $modgroup[$self] ?>1"><th colspan="4"> <img src="img/16/bcnl.png" align="right" onClick="setgen();" title="<?= $reslbl ?>"> <img src="img/16/idea.png" align="right" onClick="setgen('1');" title="Standard System OIDs"> <img src="img/16/dev.png" align="left" > <?= $manlbl ?> </th></tr> <tr><th align="right"> SysObjId</th><td> <input type="text" name="so" value="<?= $so ?>" size="30" title="SysObj ID -> <?= $fillbl ?> <?= $namlbl ?>" onfocus="select();" onchange="update();"> <br>
<?= (Devcli($ip,$cliport)) ?> </td> </tr> <?php if($ip != $oi and $oi){ ?> <tr> <th class="<?= $modgroup[$self] ?>2"><?= $orilbl ?> IP</th><td class="txtb"> <div style="float:right"> <a href="telnet://<?= $oi ?>"><img src="img/16/loko.png" title="Telnet"></a> <a href="ssh://<?= $oi ?>"><img src="img/16/lokc.png" title="SSH"></a> <a href="http://<?= $oi ?>" target="window"><img src="img/16/glob.png" title="HTTP"></a> <a href="https://<?= $oi ?>" target="window"><img src="img/16/glok.png" title="HTTPS"></a> <a href="Nodes-Toolbox.php?Dest=<?= $oi ?>"><img src="img/16/dril.png" title="Toolbox"></a> </div> <?= (Devcli($oi,$cliport)) ?> </td> </tr> <?}?> <tr> <th class="<?= $modgroup[$self] ?>2"><?= $srvlbl ?></th><td class="txta"> <div style="float:right"> <?php if($dev[6] > 3) { ?> <a href="Topology-Routes.php?rtr=<?= $ud ?>"><img src="img/16/rout.png" title="Topology-Routes"></a> <a href="Topology-Multicast.php?dev=<?= $ud ?>"><img src="img/16/cam.png" title="Topology-Multicast <?= $lstlbl ?>"></a> <?} if($dev[6] & 2) { ?> <a href="Topology-Spanningtree.php?dev=<?= $ud ?>"><img src="img/16/traf.png" title="Topology-Spanningtree"></a> <?}?>
<tr><th class="imga" width="80"> <a href="Devices-Status.php?dev=<?php echo $ud; ?> "><img src="img/dev/<?php echo $dev[18]; ?> .png" title="<?php echo $stalbl; ?> "></a> <br><?php echo $dev[0]; ?> </th><td class="txta"><?php echo Devcli($ip, $dev[16]); ?> </td></tr> <tr><th class="<?php echo $modgroup[$self]; ?> 2"><?php echo $srvlbl; ?> </th><td class="txtb"><?php echo $sv ? $sv : " "; ?> </td></tr> <tr><th class="<?php echo $modgroup[$self]; ?>
$ucfg = rawurlencode($cfg[0]); $charr = explode("\n",$cfg[2]); $charr = preg_replace("/^#(.*)$/","<span class='gry'>#$1</span>",$charr); $charr = preg_replace("/(^\s*[0-9]{1,3}\-.*)$/","<span class='drd'>$1</span>",$charr); $charr = preg_replace("/(^\s*[0-9]{1,3}\+.*)$/","<span class='olv'>$1</span>",$charr); ?> <table class="content"><tr class="<?= $modgroup[$self] ?>2"> <th><img src="img/32/note.png"><br><?= $cfglbl ?> (<?= date($_SESSION['date'],$cfg[3]) ?>)</th> <th><img src="img/32/news.png"><br><?= $chglbl ?></th></tr> <tr class="txta"><td valign="top"> <a href="?shc=<?= $ucfg ?>&sln=<?=!$sln ?>&smo=<?= $smo ?>"><img src="img/16/form.png" title="Line #"></a> <a href="?shc=<?= $ucfg ?>&sln=<?= $sln ?>&smo=<?=!$smo ?>"><img src="img/16/say.png" title="motd"></a> <a href="System-Export.php?act=c&exptbl=configs&query=SELECT+config+FROM+configs+where+DEVICE%3D%22<?= $ucfg ?>%22&type=plain"><img src="img/16/flop.png" title="<?= (($verb1)?"$explbl $cfglbl":"$cfglbl $explbl") ?>"></a> <a href="Devices-Status.php?dev=<?= $ucfg ?>"><img src="img/16/sys.png" title="Device-Status"></a> <a href="Devices-Doctor.php?dev=<?= $ucfg ?>"><img src="img/16/cinf.png" title="<?= $cfglbl ?> <?= $sumlbl ?>"></a> <?= (Devcli($cfg[4],$cfg[5],2)) ?> <?php if($isadmin) echo "<a href=$_SERVER[PHP_SELF]?dco=$ucfg><img src=\"img/16/bcnl.png\" onclick=\"return confirm('$dellbl $cfglbl?')\" title=\"$dellbl $cfglbl!\"></a>\n"; ?> <div class="code"> <?php $lnr = 0; foreach ( explode("\n",$cfg[1]) as $cl ){ if ($sln) $lnr++; echo Shoconf($cl,$smo,$lnr); } echo "</div></td><td valign=top>"; ?> <form method="post" action="System-Files.php">
function MonUptime($ina, $opa, $sta, $lim, $ord) { global $link, $modgroup, $self, $inflbl, $uptlbl, $tgtlbl, $stslbl, $tim, $place, $locsep, $loclbl, $srtlbl, $conlbl; ?> <h2><?php echo $uptlbl; ?> <?php echo $stslbl; ?> </h2> <table class="content"><tr class="<?php echo $modgroup[$self]; ?> 2"> <th colspan="3" width="33%"><img src="img/16/dev.png"><br>Device</th> <th><img src="img/16/find.png"><br><?php echo $inflbl; ?> </th> <th><img src="img/16/clock.png"><br><?php echo $uptlbl; ?> </th> </tr> <?php if ($ord) { $ocol = 'name'; $srt = "{$srtlbl}: {$tgtlbl}"; } else { $ocol = 'uptime desc'; $srt = "{$srtlbl}: Uptime"; } $query = GenQuery('monitoring', 's', 'name,uptime/360000,devip,cliport,location,contact,icon', $ocol, $lim, array('test', $ina), array('=', $opa), array('uptime', $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[4]); TblRow($bg); echo "<th class=\"{$bi}\"><a href=Devices-Status.php?dev=" . urlencode($r[0]) . "><img src=\"img/dev/{$r['6']}.png\"></a></th><td><b>" . substr($r[0], 0, $_SESSION['lsiz']) . "</b></td></th>\n"; echo "<td>" . Devcli(long2ip($r[2]), $r[3]) . "</td><td><img src=\"img/16/user.png\" title=\"{$conlbl}\"> {$r['5']}<br><img src=\"img/16/home.png\" title=\"{$loclbl}\"> {$l['0']} {$l['1']} {$l['2']}"; echo "<td> " . Bar(intval($r[1] / 24), -2) . intval($r[1] / 24) . " {$tim['d']} " . intval($r[1] % 24) . " {$tim['h']}</td></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 }
}else{ $statbg = $bi; $stat = ''; } TblCell($dev[0],'',"class=\"$statbg\" width=\"100px\"","<a href=\"Devices-Status.php?dev=$ud\"><img src=\"img/dev/$dev[18].png\" title=\"$dev[3] $stat\"></a>$stk $most<br>","th-img"); } if( in_array("imgNS",$col) ){ TblCell('','',"bgcolor=\"white\"","<a href=\"Devices-Status.php?dev=$ud\"><img width=\"".(preg_match('/^ph|^wa|^ca/',$dev[18])?40:100)."\" src=\"".DevPanel($dev[3],$dev[18],$dev[28])."\" title=\"$dev[3]\"></a>$stk $most","th-img"); } if(in_array("devip",$col)){ $dvip = Devcli( $ip, $dev[16] ); if( !in_array("device",$col) ){$dvip .= " ($dev[0])";} TblCell($dvip); } if(in_array("origip",$col)){ TblCell( Devcli($oi,$dev[16]) ); } if(in_array("serial",$col)){ TblCell($dev[2]); } if(in_array("type",$col)){ list($vn,$ic) = DevVendor($dev[25],substr($dev[18],2,1) ); TblCell( $dev[3],"?in[]=type&op[]==&st[]=".urlencode($dev[3]),'',"<a href=\"http://www.google.com/search?q=".urlencode($dev[3])."&btnI=1\" target=\"window\"><img src=\"img/oui/$ic.png\" title=\"$vn\"></a> "); } if(in_array("services",$col)){ TblCell( Syssrv($dev[6])." ($dev[6])","?in[]=services&op[]==&st[]=$dev[6]"); } if(in_array("description",$col)){ TblCell($dev[7]); } if(in_array("devos",$col)){
</th> </tr> <?php $row = 0; foreach (array_keys($ofd) as $k) { if ($row % 2) { $bg = "txta"; $bi = "imga"; } else { $bg = "txtb"; $bi = "imgb"; } TblRow($bg); $ud = urlencode($k); TblCell($k, "", "class=\"{$bi}\" width=\"100px\"", "<a href=\"Devices-Status.php?dev={$ud}\"><img src=\"img/dev/" . $ofd[$k]['ico'] . ".png\" title=\"" . $ofd[$k]['typ'] . "\"></a>" . $ofd[$k]['stk'] . "<br>", "th-img"); TblCell($ofd[$k]['id'] . " " . $ofd[$k]['ma'] . " " . $ofd[$k]['hw'] . " " . Devcli($ofd[$k]['ip'], $ofd[$k]['po'])); echo "<td>\n"; $url = "http://{$flc}:8080/wm/staticflowentrypusher/list/" . $ofd[$k]['id'] . "/json"; if ($debug) { echo "<div class=\"textpad code noti\">{$url}<p>\n"; echo "</div>"; } $jfl = file_get_contents($url); if ($jfl) { $flows = json_decode($jfl, 1); if ($debug) { echo "<div class=\"textpad code good\">"; print_r($flows); echo "</div>"; } echo "<table class=\"full\">\n";