diff --git a/html/pages/front/demo.php b/html/pages/front/demo.php new file mode 100644 index 0000000000..405cb2589d --- /dev/null +++ b/html/pages/front/demo.php @@ -0,0 +1,134 @@ + + + + +?> + '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)){ + + echo("
+
".generatedevicelink($device, shorthost($device['hostname']))."
+ Device Down
+ ".truncate($device['location'], 20)." +
"); + +} + +$sql = mysql_query("SELECT * FROM `interfaces` AS I, `devices` AS D WHERE I.device_id = D.device_id AND D.status = '1' AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0'"); +while($interface = mysql_fetch_array($sql)){ + + echo("
+
".generatedevicelink($interface, shorthost($interface['hostname']))."
+ Port Down + ".generateiflink($interface, makeshortif($interface['ifDescr']))."
+ ".truncate($interface['ifAlias'], 20)." +
"); + +} + +$sql = mysql_query("SELECT * FROM `services` AS S, `devices` AS D WHERE S.service_host = D.device_id AND D.status = '1' AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0'"); +while($service = mysql_fetch_array($sql)){ + + echo("
+
".generatedevicelink($service, shorthost($service['hostname']))."
+ Service Down + ".$service['service_type']."
+ ".truncate($interface['ifAlias'], 20)." +
"); + +} + +$sql = mysql_query("SELECT * FROM `devices` AS D, bgpPeers AS B WHERE D.status = '1' AND bgpPeerState != 'established' AND B.device_id = D.device_id"); +while($peer = mysql_fetch_array($sql)){ + + echo("
+
".generatedevicelink($peer, shorthost($peer['hostname']))."
+ BGP Down + ".$peer['bgpPeerIdentifier']."
+ AS".$peer['bgpPeerRemoteAs']." ".truncate($peer['astext'], 10)." +
"); + +} + +$sql = mysql_query("SELECT * FROM `devices` AS D, devices_attribs AS A WHERE A.device_id = D.device_id AND D.status = '1' AND A.attrib_type = 'uptime' AND A.attrib_value < '84600'"); +while($device = mysql_fetch_array($sql)){ + + 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 ORDER BY datetime DESC LIMIT 20"; +$query = mysql_query($sql); +echo("
+
Devices with Alerts
Host
Int
Srv
"); +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') { + +echo("', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 250);\" onmouseout=\"return nd();\" >". + "
Alpha Traffic
". + "
"); + +echo("
"); + +echo("', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 250);\" onmouseout=\"return nd();\" >". + "
Alpha Storage
". + "
"); + +#} + +?> + + + + +