2009-08-07 11:58:41 +00:00
< table border = 0 cellpadding = 10 cellspacing = 10 width = 100 %>
< tr >
< td bgcolor = #e5e5e5 valign=top>
< ? php
$nodes = array ();
$sql = mysql_query ( " SELECT * FROM `devices` AS D, `devices_attribs` AS A WHERE D.status = '1' AND A.device_id = D.device_id AND A.attrib_type = 'uptime' AND A.attrib_value > '0' AND A.attrib_value < '86400' " );
while ( $device = mysql_fetch_array ( $sql )){
unset ( $already );
$i = 0 ;
while ( $i <= count ( $nodes )) {
$thisnode = $device [ 'device_id' ];
if ( $nodes [ $i ] == $thisnode ) {
$already = " yes " ;
}
$i ++ ;
}
if ( ! $already ) { $nodes [] = $device [ 'device_id' ]; }
}
$sql = mysql_query ( " SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0' " );
while ( $device = mysql_fetch_array ( $sql )){
2010-08-01 14:17:06 +00:00
if ( device_permitted ( $device [ 'device_id' ])) {
2009-08-07 11:58:41 +00:00
echo ( " <div style='text-align: center; margin: 2px; border: solid 2px #d0D0D0; float: left; margin-right: 2px; padding: 3px; width: 118px; height: 85px; background: #ffbbbb;'>
2010-08-02 22:09:52 +00:00
< strong > " .generate_device_link( $device , shorthost( $device['hostname'] )). " </ strong >< br />
2009-08-07 11:58:41 +00:00
< span style = 'font-size: 14px; font-weight: bold; margin: 5px; color: #c00;' > Device Down </ span >< br />
< span class = body - date - 1 > " .truncate( $device['location'] , 35). " </ span >
</ div > " );
}
}
if ( $config [ 'warn' ][ 'ifdown' ]) {
2010-02-20 17:22:22 +00:00
$sql = mysql_query ( " SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0' " );
2009-08-07 11:58:41 +00:00
while ( $interface = mysql_fetch_array ( $sql )){
2010-08-01 14:17:06 +00:00
if ( port_permitted ( $interface [ 'interface_id' ])) {
2009-08-07 11:58:41 +00:00
echo ( " <div style='text-align: center; margin: 2px; border: solid 2px #D0D0D0; float: left; margin-right: 2px; padding: 3px; width: 118px; height: 85px; background: #ffddaa;'>
2010-08-02 22:09:52 +00:00
< strong > " .generate_device_link( $interface , shorthost( $interface['hostname'] )). " </ strong >< br />
2009-08-07 11:58:41 +00:00
< span style = 'font-size: 14px; font-weight: bold; margin: 5px; color: #c00;' > Port Down </ span >< br />
2010-08-02 22:09:52 +00:00
< strong > " .generate_port_link( $interface , makeshortif( $interface['ifDescr'] )). " </ strong >< br />
2009-08-07 11:58:41 +00:00
< span class = body - date - 1 > " .truncate( $interface['ifAlias'] , 15). " </ span >
</ div > " );
}
}
}
2010-02-21 19:32:08 +00:00
$sql = mysql_query ( " SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0' " );
2009-08-07 11:58:41 +00:00
while ( $service = mysql_fetch_array ( $sql )){
2010-08-01 14:17:06 +00:00
if ( device_permitted ( $service [ 'device_id' ])) {
2009-08-07 11:58:41 +00:00
echo ( " <div style='text-align: center; margin: 2px; border: solid 2px #D0D0D0; float: left; margin-right: 2px; padding: 3px; width: 118px; height: 85px; background: #ffddaa;'>
2010-08-02 22:09:52 +00:00
< strong > " .generate_device_link( $service , shorthost( $service['hostname'] )). " </ strong >< br />
2009-08-07 11:58:41 +00:00
< span style = 'font-size: 14px; font-weight: bold; margin: 5px; color: #c00;' > Service Down </ span >< br />
< strong > " . $service['service_type'] . " </ strong >< br />
< span class = body - date - 1 > " .truncate( $interface['ifAlias'] , 15). " </ span >
</ center ></ div > " );
}
}
$sql = mysql_query ( " SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerAdminStatus = 'start' AND bgpPeerState != 'established' AND B.device_id = D.device_id " );
while ( $peer = mysql_fetch_array ( $sql )){
2010-08-01 14:17:06 +00:00
if ( device_permitted ( $peer [ 'device_id' ])) {
2009-08-07 11:58:41 +00:00
echo ( " <div style='text-align: center; margin: 2px; border: solid 2px #D0D0D0; float: left; margin-right: 2px; padding: 3px; width: 118px; height: 85px; background: #ffddaa;'>
2010-08-02 22:09:52 +00:00
< strong > " .generate_device_link( $peer , shorthost( $peer['hostname'] )). " </ strong >< br />
2009-08-07 11:58:41 +00:00
< span style = 'font-size: 14px; font-weight: bold; margin: 5px; color: #c00;' > BGP Down </ span >< br />
< strong > " . $peer['bgpPeerIdentifier'] . " </ strong >< br />
< span class = body - date - 1 > AS " . $peer['bgpPeerRemoteAs'] . " " .truncate( $peer['astext'] , 10). " </ span >
</ div > " );
}
}
$sql = mysql_query ( " SELECT * FROM devices_attribs AS A, `devices` AS D WHERE A.attrib_value < '84600' AND A.attrib_type = 'uptime' AND A.device_id = D.device_id AND ignore = '0' AND disabled = '0' " );
while ( $device = mysql_fetch_array ( $sql )){
2010-08-01 14:17:06 +00:00
if ( device_permitted ( $device [ 'device_id' ]) && $device [ 'attrib_value' ] < " 84600 " && $device [ 'attrib_type' ] == " uptime " ) {
2009-08-07 11:58:41 +00:00
echo ( " <div style='text-align: center; margin: 2px; border: solid 2px #D0D0D0; float: left; margin-right: 2px; padding: 3px; width: 118px; height: 85px; background: #ddffdd;'>
2010-08-02 22:09:52 +00:00
< strong > " .generate_device_link( $device , shorthost( $device['hostname'] )). " </ strong >< br />
2009-08-07 11:58:41 +00:00
< span style = 'font-size: 14px; font-weight: bold; margin: 5px; color: #090;' > Device < br /> Rebooted </ span >< br />
< span class = body - date - 1 > " .formatUptime( $device['attrib_value'] ). " </ span >
</ div > " );
}
}
echo ( "
< div style = 'clear: both;' > $errorboxes </ div > < div style = 'margin: 0px; clear: both;' >
< h3 > Recent Syslog Messages </ h3 >
" );
2010-02-19 01:40:38 +00:00
$sql = " SELECT *, DATE_FORMAT(timestamp, '%D %b %T') AS date from syslog,devices WHERE syslog.device_id = devices.device_id ORDER BY seq DESC LIMIT 20 " ;
2009-08-07 11:58:41 +00:00
$query = mysql_query ( $sql );
echo ( " <table cellspacing=0 cellpadding=2 width=100%> " );
while ( $entry = mysql_fetch_array ( $query )) { include ( " includes/print-syslog.inc " ); }
echo ( " </table> " );
echo ( " </div>
</ td >
< td bgcolor = #e5e5e5 width=470 valign=top>");
/// this stuff can be customised to show whatever you want....
if ( $_SESSION [ 'userlevel' ] >= '5' )
{
2010-02-20 17:22:22 +00:00
$sql = " select * from ports as I, devices as D WHERE `ifAlias` like 'Transit: %' AND I.device_id = D.device_id ORDER BY I.ifAlias " ;
2009-08-07 11:58:41 +00:00
$query = mysql_query ( $sql );
unset ( $seperator );
while ( $interface = mysql_fetch_array ( $query )) {
2010-02-20 17:22:22 +00:00
$ports [ 'transit' ] .= $seperator . $interface [ 'interface_id' ];
2009-08-07 11:58:41 +00:00
$seperator = " , " ;
}
2010-02-20 17:22:22 +00:00
$sql = " select * from ports as I, devices as D WHERE `ifAlias` like 'Peering: %' AND I.device_id = D.device_id ORDER BY I.ifAlias " ;
2009-08-07 11:58:41 +00:00
$query = mysql_query ( $sql );
unset ( $seperator );
while ( $interface = mysql_fetch_array ( $query )) {
2010-02-20 17:22:22 +00:00
$ports [ 'peering' ] .= $seperator . $interface [ 'interface_id' ];
2009-08-07 11:58:41 +00:00
$seperator = " , " ;
}
2010-02-20 17:22:22 +00:00
$ports [ 'broadband' ] = " 3294,3295,688,3534 " ;
$ports [ 'wave_broadband' ] = " 827 " ;
2009-08-07 11:58:41 +00:00
2010-02-20 17:22:22 +00:00
$ports [ 'new_broadband' ] = " 3659,4149,4121,4108,3676,4135 " ;
2009-08-07 11:58:41 +00:00
echo ( " <div style=' margin-bottom: 5px;'> " );
2010-02-20 17:22:22 +00:00
if ( $ports [ 'peering' ] && $ports [ 'transit' ]) {
2009-08-07 11:58:41 +00:00
echo ( " <div style='width: 235px; '>
< a href = 'internet/' onmouseover = \ " return overlib(' \
2010-08-13 14:22:05 +00:00
< img src = \ 'graph.php?type=multiport_bits_duo&id=".$ports[' peering ']."&idb=".$ports[' transit ' ] . " &from= " . $day . " &to= " . $now . " &width=400&height=150 \ '> \
< img src = \ 'graph.php?type=multiport_bits_duo&id=".$ports[' peering ']."&idb=".$ports[' transit ' ] . " &from= " . $week . " &to= " . $now . " &width=400&height=150 \ '> \
2009-08-07 11:58:41 +00:00
', CENTER, LEFT, FGCOLOR, ' #e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
" <div style='font-size: 16px; font-weight: bold; color: #555555;'>Aggregate Internet Traffic</div> " .
2010-08-13 14:22:05 +00:00
" <img src='graph.php?type=multiport_bits_duo&id= " . $ports [ 'peering' ] . " &idb= " . $ports [ 'transit' ] .
2009-08-07 11:58:41 +00:00
" &from= " . $day . " &to= " . $now . " &width=385&height=100&legend=no'></a></div> " );
}
echo ( " </div> " );
echo ( " <div style=' margin-bottom: 5px;'> " );
2010-02-20 17:22:22 +00:00
if ( $ports [ 'transit' ]) {
2009-08-07 11:58:41 +00:00
echo ( " <div style='width: 235px; float: left;'>
< a href = 'iftype/transit/' onmouseover = \ " return overlib(' \
2010-07-27 12:54:29 +00:00
< img src = \ 'graph.php?type=multiport_bits&id=".$ports[' transit ' ] . " &from= " . $day . " &to= " . $now . " &width=400&height=150 \ '> \
< img src = \ 'graph.php?type=multiport_bits&id=".$ports[' transit ' ] . " &from= " . $week . " &to= " . $now . " &width=400&height=150 \ '> \
2009-08-07 11:58:41 +00:00
', CENTER, LEFT, FGCOLOR, ' #e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
" <div style='font-size: 16px; font-weight: bold; color: #555555;'>Internet Transit</div> " .
2010-07-27 12:54:29 +00:00
" <img src='graph.php?type=multiport_bits&id= " . $ports [ 'transit' ] .
2009-08-07 11:58:41 +00:00
" &from= " . $day . " &to= " . $now . " &width=155&height=100&legend=no'></a></div> " );
}
2010-02-20 17:22:22 +00:00
if ( $ports [ 'peering' ]) {
2009-08-07 11:58:41 +00:00
echo ( " <div style='width: 235px; float: right;'>
< a href = 'iftype/peering/' onmouseover = \ " return overlib(' \
2010-07-27 12:54:29 +00:00
< img src = \ 'graph.php?type=multiport_bits&id=".$ports[' peering ' ] . " &from= " . $day . " &to= " . $now . " &width=400&height=150 \ '> \
< img src = \ 'graph.php?type=multiport_bits&id=".$ports[' peering ' ] . " &from= " . $week . " &to= " . $now . " &width=400&height=150 \ '> \
2009-08-07 11:58:41 +00:00
', CENTER, LEFT, FGCOLOR, ' #e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
" <div style='font-size: 16px; font-weight: bold; color: #555555;'>Internet Peering</div> " .
2010-07-27 12:54:29 +00:00
" <img src='graph.php?type=multiport_bits&id= " . $ports [ 'peering' ] .
2009-08-07 11:58:41 +00:00
" &from= " . $day . " &to= " . $now . " &width=155&height=100&legend=no'></a></div> " );
}
echo ( " </div> " );
echo ( " <div style=' margin-bottom: 5px;'> " );
2010-02-20 17:22:22 +00:00
if ( $ports [ 'broadband' ] && $ports [ 'wave_broadband' ] && $ports [ 'new_broadband' ]) {
2009-08-07 11:58:41 +00:00
echo ( " <div style='width: 466px; '>
< a href = 'broadband/' onmouseover = \ " return overlib(' \
2010-08-13 14:22:05 +00:00
< img src = \ 'graph.php?type=multiport_bits_trio&id=".$ports[' broadband ']."&idb=".$ports[' new_broadband ']."&idc=".$ports[' wave_broadband ' ] . " &from= " . $day . " &to= " . $now . " &width=400&height=150&inverse=c \ '> \
< img src = \ 'graph.php?type=multiport_bits_trio&id=".$ports[' broadband ']."&idb=".$ports[' new_broadband ']."&idc=".$ports[' wave_broadband ' ] . " &from= " . $week . " &to= " . $now . " &width=400&height=150&inverse=c \ '> \
2009-08-07 11:58:41 +00:00
', CENTER, LEFT, FGCOLOR, ' #e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
" <div style='font-size: 16px; font-weight: bold; color: #555555;'>Aggregate Broadband Traffic</div> " .
2010-08-13 14:22:05 +00:00
" <img src='graph.php?type=multiport_bits_trio&id= " . $ports [ 'broadband' ] . " &idb= " . $ports [ 'new_broadband' ] . " &idc= " . $ports [ 'wave_broadband' ] .
2009-08-07 11:58:41 +00:00
" &from= " . $day . " &to= " . $now . " &width=385&height=100&legend=no&inverse=c'></a></div> " );
}
echo ( " <div style=' margin-bottom: 5px;'> " );
2010-02-20 17:22:22 +00:00
if ( $ports [ 'broadband' ]) {
2009-08-07 11:58:41 +00:00
echo ( " <div style='width: 235px; float: left;'>
< a onmouseover = \ " return overlib(' \
2010-07-27 12:54:29 +00:00
< img src = \ 'graph.php?type=multiport_bits&id=".$ports[' broadband ' ] . " &from= " . $day . " &to= " . $now . " &width=400&height=150 \ '> \
< img src = \ 'graph.php?type=multiport_bits&id=".$ports[' broadband ' ] . " &from= " . $week . " &to= " . $now . " &width=400&height=150 \ '> \
2009-08-07 11:58:41 +00:00
', LEFT, FGCOLOR, ' #e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
" <div style='font-size: 16px; font-weight: bold; color: #555555;'>Jersey Broadband ATM</div> " .
2010-07-27 12:54:29 +00:00
" <img src='graph.php?type=multiport_bits&id= " . $ports [ 'broadband' ] .
2009-08-07 11:58:41 +00:00
" &from= " . $day . " &to= " . $now . " &width=155&height=100&legend=no'></a></div> " );
}
echo ( " <div style=' margin-bottom: 5px;'> " );
2010-02-20 17:22:22 +00:00
if ( $ports [ 'new_broadband' ]) {
2009-08-07 11:58:41 +00:00
echo ( " <div style='width: 235px; float: left;'>
< a onmouseover = \ " return overlib(' \
2010-07-27 12:54:29 +00:00
< img src = \ 'graph.php?type=multiport_bits&id=".$ports[' new_broadband ' ] . " &from= " . $day . " &to= " . $now . " &width=400&height=150&inverse=0 \ '> \
< img src = \ 'graph.php?type=multiport_bits&id=".$ports[' new_broadband ' ] . " &from= " . $week . " &to= " . $now . " &width=400&height=150&inverse=0 \ '> \
2009-08-07 11:58:41 +00:00
', LEFT, FGCOLOR, ' #e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
" <div style='font-size: 16px; font-weight: bold; color: #555555;'>Jersey Broadband NGN</div> " .
2010-07-27 12:54:29 +00:00
" <img src='graph.php?type=multiport_bits&id= " . $ports [ 'new_broadband' ] . " &from= " . $day . " &to= " . $now . " &width=155&height=100&inverse=0&legend=no'></a></div> " );
2009-08-07 11:58:41 +00:00
}
echo ( " </div> " );
2010-02-20 17:22:22 +00:00
if ( $ports [ 'wave_broadband' ]) {
2009-08-07 11:58:41 +00:00
echo ( " <div style='width: 235px; float: left;'>
< a onmouseover = \ " return overlib(' \
2010-09-01 16:01:21 +00:00
< img src = \ 'graph.php?type=port_bits&id=".$ports[' wave_broadband ' ] . " &from= " . $day . " &to= " . $now . " &width=400&height=150&inverse=1&legend=1 \ '> \
< img src = \ 'graph.php?type=port_bits&id=".$ports[' wave_broadband ' ] . " &from= " . $week . " &to= " . $now . " &width=400&height=150&inverse=1&legend=1 \ '> \
2009-08-07 11:58:41 +00:00
', LEFT, FGCOLOR, ' #e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >". "
< div style = 'font-size: 16px; font-weight: bold; color: #555555;' > Wave Broadband </ div > " .
2010-09-01 16:01:21 +00:00
" <img src='graph.php?type=port_bits&id= " . $ports [ 'wave_broadband' ] . " &from= " . $day . " &to= " . $now . " &width=155&height=100&inverse=1&legend=no'></a></div> " );
2009-08-07 11:58:41 +00:00
}
echo ( " </div> " );
}
?>
</ td >
</ tr >
< tr >
</ tr ></ table >