TblCell($noa, "", 'style="border-bottom:solid 1px #444" align="right"'); echo "</tr>\n"; TblRow('txtb'); TblCell($totlbl, '', 'align="right"', '', 'th'); echo "<td></td><td >"; if (isset($_GET['print'])) { echo $cul; } else { echo "Currency <select size=\"1\" name=\"cu\" onchange=\"this.form.submit();\">\n"; echo "<option value=\"u\"" . ($cu == "u" ? " selected" : "") . ">USD\n"; echo "<option value=\"e\"" . ($cu == "e" ? " selected" : "") . ">EUR\n"; echo "<option value=\"c\"" . ($cu == "c" ? " selected" : "") . ">CHF\n"; echo "</select>\n"; } echo "</td>"; TblCell($tot, '', 'style="border-bottom:double 4px #444" align="right"', '', 'th'); ?> </tr> </table> <table style='position:relative;top:80px;left:20px;'> <tr><td>email</td><td>rickli@nedi.ch</td></tr> <tr><td>phone</td><td>+41 41 511 98 41</td></tr> <tr><td>swift</td><td>ZKBKCHZZ80A</td></tr> <tr><td>iban</td><td><?php echo $ibn; ?> </td></tr> </table> </div>
$un = rawurlencode($l[3]); if ($row % 2) { $bg = "txta"; $bi = "imga"; } else { $bg = "txtb"; $bi = "imgb"; } $row++; TblRow($bg); list($tc, $tc) = Agecol($l[10], $l[10], $row % 2); TblCell($l[1], "?dv={$ud}", "nowrap", "<a href=\"Devices-Status.php?dev={$ud}\"><img src=\"img/16/sys.png\"></a>"); echo "<td>{$l['2']}</td>\n"; echo "<th>{$l['6']}</th>\n"; echo "<td align=right>" . DecFix($l[5]) . "</td>\n"; TblCell($l[3], "?dv={$un}", "nowrap", "<a href=\"Devices-Status.php?dev={$un}\"><img src=\"img/16/sys.png\"></a>"); echo "<td>{$l['4']} (Vl{$l['9']} {$l['8']})</td><td>{$l['7']}</td><td bgcolor=\"{$tc}\" width=\"100\" nowrap>" . date($datfmt, $l[10]) . "</td>\n"; echo "<th><a href=\"?del={$l['0']}&dv={$ud}\"><img src=\"img/16/bcnl.png\" onclick=\"return confirm('Link {$l['0']} {$dellbl}?');\" title=\"{$l['0']} {$dellbl}\"></a></th></tr>\n"; $nli++; } DbFreeResult($res); } else { print DbError($link); } ?> </table> <table class="content" > <tr class="<?php echo $modgroup[$self]; ?> 2"><td><?php
$bi = "imgb"; } $dsnet = $dnet + $s * $snoff; $snet = long2ip($dsnet); list($ntimg, $ntit) = Nettype($snet); $fsho = long2ip($dsnet + 1); $sbc = long2ip($dsnet + $dwsmsk); $lsho = long2ip($dsnet + $dwsmsk - 1); $nsho += $snoff - 2; TblRow($bg); TblCell($s, '', "class=\"{$bi}\" width=\"50px\"", "<img src=\"img/{$ntimg}\" title=\"{$ntit}\">", 'th'); TblCell("{$snet}/{$spfix}", '', 'class="prp code"'); TblCell("{$fsho}", '', 'class="drd code"'); TblCell("{$lsho}", '', 'class="drd code"'); TblCell("{$sbc}", '', 'class="prp code"'); TblCell("{$nsho}", '', 'class="blu code"'); echo "</tr>\n"; } } elseif ($pfix > $spfix) { $snet = long2ip($dip & $dsmsk); $dsnet = ip2long($snet); $bsnet = ip2bin($snet); $hsnet = "0x" . str_pad(ip2hex($snet), 8, 0); $sbc = long2ip($dsnet + $dwsmsk); $dsbc = ip2long($sbc); $bsbc = ip2bin($sbc); $hsbc = "0x" . ip2hex($sbc); ?> <h2>Supernet</h2> <table class="content" > <tr class="<?php
$row = 0; if (!$lic){$lic = 1000000;} # Yepp, not really oo... while( ($con = DbFetchRow($res)) ){ if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";} $row++; $ud = rawurlencode($con[0]); TblRow($bg); TblCell($con[0],"","class=\"$bi\" width=\"50px\"","<a href=\"Devices-Status.php?dev=$ud\"><img src=\"img/dev/$con[9].png\" title=\"$con[7]\"></a><br>","th-img"); TblCell( Devcli($con[6],$con[10]) ); TblCell($con[8]); TblCell( substr(implode("\n",preg_grep("/$sta/i",explode("\n",$con[1]) ) ),0,$lic),"?shc=$ud","class=\"code\"" ); TblCell($con[4]); TblCell( substr(implode("\n",preg_grep("/$sta/i",explode("\n",$con[2]) ) ),0,$lic),"","class=\"code\"" ); TblCell($con[5]); list($u1c,$u2c) = Agecol($con[3],$con[3],$row % 2); TblCell( date($_SESSION['date'],$con[3]),"","bgcolor=\"#$u1c\" nowrap" ); echo "</tr>\n"; } DbFreeResult($res); }else{ print DbError($link); } ?> </table> <table class="content"> <tr class="<?= $modgroup[$self] ?>2"><td><?= $row ?> Devices</td></tr> </table> <?php } }elseif($shc){
} 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"; } echo "</tr>\n";
TblCell($item[0], '', "class=\"{$bi}\" width=\"50px\"", "<a href=\"?chg=" . urlencode($item[1]) . "&lst={$lst}&val={$uv}\"><img src=\"img/16/" . $cico[$item[0]] . ".png\" title=" . $stco[$item[0]] . "></a>", "th-imx"); TblCell($item[1], "", "class=\"mrn code\""); TblCell($item[2], "?lst=ty&val=" . urlencode($item[2])); TblCell($item[3]); TblCell($item[4], "?lst=lo&val=" . urlencode($item[4])); TblCell($item[5], "?lst=ps&val=" . urlencode($item[5])); TblCell($item[6]); TblCell($item[7]); TblCell($item[8] ? date($dats, $item[8]) : '-'); TblCell($item[9], "?lst=mp&val=" . urlencode($item[9])); TblCell($item[10] ? date($dats, $item[10]) : '-'); TblCell($item[11] ? date($dats, $item[11]) : '-'); TblCell($item[12] ? date($dats, $item[12]) : '-', "?lst=lw&val=" . date($dats, $item[12]), "nowrap " . WtyBg($item[12])); TblCell($item[13]); TblCell($item[14], "?lst=us&val=" . urlencode($item[14])); TblCell(date($dats, $item[15]), '', "bgcolor=\"#{$a1c}\""); echo "</tr>\n"; } DbFreeResult($res); } else { print DbError($link); } ?> </table> <table class="content"> <tr class="<?php echo $modgroup[$self]; ?> 2"><td><?php echo $row; ?>
$ifquery = GenQuery('interfaces','s','*','','',array('device','ifidx'),array('=','='),array($dev[0],$rootif),array('AND') ); $ifres = DbQuery($ifquery,$link); if(DbNumRows($ifres) == 1){ $if = DbFetchRow($ifres); $it = "RP:<span class=\"grn\">$if[1] <i>$if[7]</i></span>"; }else{ $it = "Rootport n/a!"; } }else{ $it = "<span class=\"drd\">Root</span>"; } TblCell("$prilbl:<span class=\"prp\">$stppri</span> $it TC:<span class=\"blu\">$numchg</span> $tcstr","","","<a href=\"Topology-Spanningtree.php?dev=$ud\"><img src=\"img/16/traf.png\" title=\"Topology-Spanningtree\"></a>"); } } }else{ TblCell("-"); } } if( in_array("gfNS",$col) and !isset($_GET['xls']) ){ echo "<td>"; $gsiz = ($_SESSION['gsiz'] == 4)?2:1; if( substr($dev[27],1,1) == "C" ) echo "<a href=\"Devices-Graph.php?dv=$ud&if[]=cpu\"><img src=\"inc/drawrrd.php?dv=$ud&t=cpu&s=$gsiz\" title=\"$dev[20]% CPU $lodlbl\">\n"; if($dev[21]) echo "<a href=\"Devices-Graph.php?dv=$ud&if[]=mem\"><img src=\"inc/drawrrd.php?dv=$ud&t=mem&s=$gsiz\" title=\"".(($dev[21] > 100)?DecFix($dev[21]).'B':$dev[21].'%')." $memlbl $frelbl\">\n"; if($dev[22]) echo "<a href=\"Devices-Graph.php?dv=$ud&if[]=tmp\"><img src=\"inc/drawrrd.php?dv=$ud&t=tmp&s=$gsiz\" title=\"$tmplbl ".(($_SESSION['far'])?($dev[22]*1.8+32)."F":"$dev[22]C")."\">\n"; if($dev[23]){ if($dev[24] and $dev[24] != 'MemIO'){ list($ct,$cy,$cu) = explode(";", $dev[24]); }else{ $ct = "$memlbl IO"; $cu = "Bytes $frelbl"; }
TblCell(DecFix($l[5])); } if (in_array("linktype", $col)) { TblCell($l[6], "?in[]=linktype&op[]==&st[]={$l['6']}"); } if (in_array("linkdesc", $col)) { TblCell($l[7]); } if (in_array("nbrduplex", $col)) { TblCell($l[8]); } if (in_array("nbrvlanid", $col)) { TblCell($l[9]); } if (in_array("time", $col)) { TblCell(date($datfmt, $l[10]), "?in[]=time&op[]==&st[]={$l['10']}", "bgcolor=\"#{$tc}\""); } echo "</tr>\n"; } DbFreeResult($res); } else { print DbError($link); } ?> </table> <table class="content"> <tr class="<?php echo $modgroup[$self]; ?> 2"><td><?php echo $row;
</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";
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]");} if(in_array("nodtype",$col)) {TblCell($n[19],"?in[]=nodtype&op[]==&st[]=$n[19]");} if(in_array("nodos",$col)) {TblCell($n[20],"?in[]=nodos&op[]==&st[]=$n[20]");} if(in_array("osupdate",$col)){ list($o1c,$o2c) = Agecol($n[21],$n[21],$row % 2); TblCell( date($datfmt,$n[21]),"?in[]=osupdate&op[]==&st[]=$n[21]","nowrap bgcolor=\"#$o1c\""); } if(in_array("noduser",$col)) {TblCell($n[22],"?in[]=noduser&op[]==&st[]=$n[22]");} if( !isset($_GET['xls']) ){ if(in_array("sshNS",$col)){ echo "<td><a href=ssh://$ip><img src=\"img/16/lokc.png\"></a>\n"; echo (($wasup)?CheckTCP($ip,'22',''):"-") ."</td>"; } if(in_array("telNS",$col)){ echo "<td><a href=telnet://$ip><img src=\"img/16/loko.png\"></a>\n"; echo (($wasup)?CheckTCP($ip,'23',''):"-") ."</td>"; } if(in_array("wwwNS",$col)){ echo "<td><a href=http://$ip target=window><img src=\"img/16/glob.png\"></a>\n"; echo (($wasup)?CheckTCP($ip,'80',"GET / HTTP/1.0\r\n\r\n"):"-") ."</td>"; } if(in_array("nbtNS",$col)){
TblCell($m[12], "?in[]=contact&op[]==&st[]=" . urlencode($m[12])); } if (in_array("firstdis", $col)) { TblCell(date($datfmt, $m[8]), "?in[]=firstdis&op[]==&st[]={$m['9']}", "bgcolor=\"#{$fc}\""); } if (in_array("lastdis", $col)) { TblCell(date($datfmt, $m[9]), "?in[]=lastdis&op[]==&st[]={$m['10']}", "bgcolor=\"#{$lc}\""); } if (in_array("ifname", $col)) { TblCell($m[1], "?in[]=ifname&op[]==&st[]=" . urlencode($m[1])); } if (in_array("vrfname", $col)) { TblCell($m[5], "?in[]=vrfname&op[]==&st[]=" . urlencode($m[5])); } if (in_array("status", $col)) { TblCell($m[6], "?in[]=status&op[]==&st[]=" . urlencode($m[6])); } echo "</tr>\n"; } DbFreeResult($res); } else { print DbError($link); } ?> </table> <table class="content"> <tr class="<?php echo $modgroup[$self]; ?> 2"><td><?php echo $row;