mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
more code cleanup (last commit for now)
git-svn-id: http://www.observium.org/svn/observer/trunk@2520 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -14,7 +14,7 @@ if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $c
|
||||
|
||||
$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' " . $uptimesql);
|
||||
|
||||
while ($device = mysql_fetch_assoc($sql)){
|
||||
while ($device = mysql_fetch_assoc($sql)) {
|
||||
unset($already);
|
||||
$i = 0;
|
||||
while ($i <= count($nodes)) {
|
||||
@@ -29,7 +29,7 @@ while ($device = mysql_fetch_assoc($sql)){
|
||||
|
||||
|
||||
$sql = mysql_query("SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0'");
|
||||
while ($device = mysql_fetch_assoc($sql)){
|
||||
while ($device = mysql_fetch_assoc($sql)) {
|
||||
if (device_permitted($device['device_id'])) {
|
||||
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;'>
|
||||
<strong>".generate_device_link($device, shorthost($device['hostname']))."</strong><br />
|
||||
@@ -42,7 +42,7 @@ while ($device = mysql_fetch_assoc($sql)){
|
||||
if ($config['warn']['ifdown']) {
|
||||
|
||||
$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_assoc($sql)){
|
||||
while ($interface = mysql_fetch_assoc($sql)) {
|
||||
if (port_permitted($interface['interface_id'])) {
|
||||
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;'>
|
||||
<strong>".generate_device_link($interface, shorthost($interface['hostname']))."</strong><br />
|
||||
@@ -56,7 +56,7 @@ while ($interface = mysql_fetch_assoc($sql)){
|
||||
}
|
||||
|
||||
$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_assoc($sql)){
|
||||
while ($service = mysql_fetch_assoc($sql)) {
|
||||
if (device_permitted($service['device_id'])) {
|
||||
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;'>
|
||||
<strong>".generate_device_link($service, shorthost($service['hostname']))."</strong><br />
|
||||
@@ -68,7 +68,7 @@ while ($service = mysql_fetch_assoc($sql)){
|
||||
}
|
||||
|
||||
$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_assoc($sql)){
|
||||
while ($peer = mysql_fetch_assoc($sql)) {
|
||||
if (device_permitted($peer['device_id'])) {
|
||||
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;'>
|
||||
<strong>".generate_device_link($peer, shorthost($peer['hostname']))."</strong><br />
|
||||
@@ -82,7 +82,7 @@ while ($peer = mysql_fetch_assoc($sql)){
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
{
|
||||
$sql = mysql_query("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE A.attrib_value < '" . $config['uptime_warning'] . "' AND A.attrib_type = 'uptime' AND A.device_id = D.device_id AND ignore = '0' AND disabled = '0'");
|
||||
while ($device = mysql_fetch_assoc($sql)){
|
||||
while ($device = mysql_fetch_assoc($sql)) {
|
||||
if (device_permitted($device['device_id']) && $device['attrib_value'] < $config['uptime_warning'] && $device['attrib_type'] == "uptime") {
|
||||
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;'>
|
||||
<strong>".generate_device_link($device, shorthost($device['hostname']))."</strong><br />
|
||||
@@ -96,7 +96,7 @@ if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $c
|
||||
|
||||
echo("
|
||||
|
||||
<div style='clear: both;'>$errorboxes</div> <div style='margin: 0px; clear: both;'>
|
||||
<div style='clear: both;'>$errorboxes</div> <div style='margin: 0px; clear: both;'>
|
||||
|
||||
<h3>Recent Syslog Messages</h3>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user