From bd8fb496d441b959e5c22ca4fdd7a71482cf0f79 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Fri, 7 Aug 2009 11:58:41 +0000 Subject: [PATCH] added default JT front page git-svn-id: http://www.observium.org/svn/observer/trunk@444 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/front/jt.php | 240 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 html/pages/front/jt.php diff --git a/html/pages/front/jt.php b/html/pages/front/jt.php new file mode 100644 index 0000000000..a643555133 --- /dev/null +++ b/html/pages/front/jt.php @@ -0,0 +1,240 @@ + + + + + + + + +
+ '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)){ + if(devicepermitted($device['device_id'])) { + echo("
+ ".generatedevicelink($device, shorthost($device['hostname']))."
+ Device Down
+ ".truncate($device['location'], 35)." +
"); + } +} + +if($config['warn']['ifdown']) { + +$sql = mysql_query("SELECT * FROM `interfaces` 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'"); +while($interface = mysql_fetch_array($sql)){ + if(interfacepermitted($interface['interface_id'])) { + echo("
+ ".generatedevicelink($interface, shorthost($interface['hostname']))."
+ Port Down
+ ".generateiflink($interface, makeshortif($interface['ifDescr']))."
+ ".truncate($interface['ifAlias'], 15)." +
"); + } +} + +} + +$sql = mysql_query("SELECT * FROM `services` AS S, `devices` AS D WHERE S.service_host = D.device_id AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0'"); +while($service = mysql_fetch_array($sql)){ + if(devicepermitted($service['device_id'])) { + echo("
+ ".generatedevicelink($service, shorthost($service['hostname']))."
+ Service Down
+ ".$service['service_type']."
+ ".truncate($interface['ifAlias'], 15)." +
"); + } +} + +$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)){ + if(devicepermitted($peer['device_id'])) { + echo("
+ ".generatedevicelink($peer, shorthost($peer['hostname']))."
+ BGP Down
+ ".$peer['bgpPeerIdentifier']."
+ AS".$peer['bgpPeerRemoteAs']." ".truncate($peer['astext'], 10)." +
"); + } +} + +$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)){ + if(devicepermitted($device['device_id']) && $device['attrib_value'] < "84600" && $device['attrib_type'] == "uptime" ) { + echo("
+ ".generatedevicelink($device, shorthost($device['hostname']))."
+ Device
Rebooted

+ ".formatUptime($device['attrib_value'])." +
"); + } +} + + +echo(" + +
$errorboxes
+ +

Recent Syslog Messages

+ +"); + +$sql = "SELECT *, DATE_FORMAT(datetime, '%D %b %T') AS date from syslog,devices WHERE syslog.device_id = devices.device_id ORDER BY seq DESC LIMIT 20"; +$query = mysql_query($sql); +echo(""); +while($entry = mysql_fetch_array($query)) { include("includes/print-syslog.inc"); } +echo("
"); + + +echo("
+ +
"); + + +/// this stuff can be customised to show whatever you want.... + +if($_SESSION['userlevel'] >= '5') +{ + + $sql = "select * from interfaces as I, devices as D WHERE `ifAlias` like 'Transit: %' AND I.device_id = D.device_id ORDER BY I.ifAlias"; + $query = mysql_query($sql); + unset ($seperator); + while($interface = mysql_fetch_array($query)) { + $interfaces['transit'] .= $seperator . $interface['interface_id']; + $seperator = ","; + } + + $sql = "select * from interfaces as I, devices as D WHERE `ifAlias` like 'Peering: %' AND I.device_id = D.device_id ORDER BY I.ifAlias"; + $query = mysql_query($sql); + unset ($seperator); + while($interface = mysql_fetch_array($query)) { + $interfaces['peering'] .= $seperator . $interface['interface_id']; + $seperator = ","; + } + + + $interfaces['broadband'] = "3294,3295,688,3534"; + $interfaces['wave_broadband'] = "827"; + + $interfaces['new_broadband'] = "3659,4149,4121,4108,3676,4135"; + + + echo(""); + + echo(""); + + echo("
"); + + if($interfaces['broadband'] && $interfaces['wave_broadband'] && $interfaces['new_broadband']) { + echo(""); + } + + + + echo(""); + +} + +?> +