|
Devices with Alerts | Host | Int | Srv |
?>
'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("
".generate_device_link($device, shorthost($device['hostname']))."
Device Down
".truncate($device['location'], 20)."
");
}
$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'");
while($interface = mysql_fetch_array($sql)){
echo("
".generate_device_link($interface, shorthost($interface['hostname']))."
Port Down
".generate_port_link($interface, makeshortif($interface['ifDescr']))."
".truncate($interface['ifAlias'], 20)."
");
}
$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'");
while($service = mysql_fetch_array($sql)){
echo("
".generate_device_link($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 bgpPeerState != 'established' AND B.device_id = D.device_id");
while($peer = mysql_fetch_array($sql)){
echo("
".generate_device_link($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 A.attrib_type = 'uptime' AND A.attrib_value < '84600'");
while($device = mysql_fetch_array($sql)){
echo("
".generate_device_link($device, shorthost($device['hostname']))."
Device
Rebooted
".formatUptime($device['attrib_value'])."
");
}
echo("
$errorboxes
Recent Syslog Messages
");
$sql = "SELECT *, DATE_FORMAT(timestamp, '%D %b %T') AS date from syslog ORDER BY timestamp 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 ports as I, devices as D WHERE `ifAlias` like 'L2TP: %' AND I.device_id = D.device_id AND D.hostname LIKE '%";
$sql .= $config['mydomain'] . "' ORDER BY I.ifAlias";
$query = mysql_query($sql);
unset ($seperator);
while($interface = mysql_fetch_array($query)) {
$ports['l2tp'] .= $seperator . $interface['interface_id'];
$seperator = ",";
}
$sql = "select * from ports as I, devices as D WHERE `ifAlias` like 'Transit: %' AND I.device_id = D.device_id AND D.hostname LIKE '%";
$sql .= $config['mydomain'] . "' ORDER BY I.ifAlias";
$query = mysql_query($sql);
unset ($seperator);
while($interface = mysql_fetch_array($query)) {
$ports['transit'] .= $seperator . $interface['interface_id'];
$seperator = ",";
}
$sql = "select * from ports as I, devices as D WHERE `ifAlias` like 'Server: thlon-pbx%' AND I.device_id = D.device_id AND D.hostname LIKE '%";
$sql .= $config['mydomain'] . "' ORDER BY I.ifAlias";
$query = mysql_query($sql);
unset ($seperator);
while($interface = mysql_fetch_array($query)) {
$ports['voip'] .= $seperator . $interface['interface_id'];
$seperator = ",";
}
if($ports['transit']) {
echo("', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 250);\" onmouseout=\"return nd();\" >".
" Internet Transit ".
" ");
}
if($ports['l2tp']) {
echo("', LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 250);\" onmouseout=\"return nd();\" >".
"L2TP ADSL ".
" ");
}
if($ports['voip']) {
echo("', LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 250);\" onmouseout=\"return nd();\" >".
"VoIP to PSTN ".
" ");
}
}
/// END VOSTRON
?>
|