mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
change interfaces table to ports (to match GUI conventions)
git-svn-id: http://www.observium.org/svn/observer/trunk@889 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -8,12 +8,12 @@ $devices['down'] = mysql_result(mysql_query("SELECT count(*) FROM devices WHERE
|
||||
$devices['ignored'] = mysql_result(mysql_query("SELECT count(*) FROM devices WHERE `ignore` = '1'"),0);
|
||||
$devices['disabled'] = mysql_result(mysql_query("SELECT count(*) FROM devices WHERE `disabled` = '1'"),0);
|
||||
|
||||
$interfaces['count'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces"),0);
|
||||
$interfaces['up'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces AS I, devices AS D WHERE I.ifOperStatus = 'up' AND I.ignore = '0' AND I.device_id = D.device_id AND D.ignore = '0'"),0);
|
||||
$interfaces['down'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces AS I, devices AS D WHERE I.ifOperStatus = 'down' AND I.ifAdminStatus = 'up' AND I.ignore = '0' AND D.device_id = I.device_id AND D.ignore = '0'"),0);
|
||||
$interfaces['shutdown'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces AS I, devices AS D WHERE I.ifAdminStatus = 'down' AND I.ignore = '0' AND D.device_id = I.device_id AND D.ignore = '0'"),0);
|
||||
$interfaces['ignored'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces AS I, devices AS D WHERE D.device_id = I.device_id AND ( I.ignore = '1' OR D.ignore = '1')"),0);
|
||||
$interfaces['errored'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces AS I, devices AS D WHERE D.device_id = I.device_id AND ( I.ignore = '0' OR D.ignore = '0') AND (I.ifInErrors_delta > '0' OR I.ifOutErrors_delta > '0')"),0);
|
||||
$ports['count'] = mysql_result(mysql_query("SELECT count(*) FROM ports"),0);
|
||||
$ports['up'] = mysql_result(mysql_query("SELECT count(*) FROM ports AS I, devices AS D WHERE I.ifOperStatus = 'up' AND I.ignore = '0' AND I.device_id = D.device_id AND D.ignore = '0'"),0);
|
||||
$ports['down'] = mysql_result(mysql_query("SELECT count(*) FROM ports AS I, devices AS D WHERE I.ifOperStatus = 'down' AND I.ifAdminStatus = 'up' AND I.ignore = '0' AND D.device_id = I.device_id AND D.ignore = '0'"),0);
|
||||
$ports['shutdown'] = mysql_result(mysql_query("SELECT count(*) FROM ports AS I, devices AS D WHERE I.ifAdminStatus = 'down' AND I.ignore = '0' AND D.device_id = I.device_id AND D.ignore = '0'"),0);
|
||||
$ports['ignored'] = mysql_result(mysql_query("SELECT count(*) FROM ports AS I, devices AS D WHERE D.device_id = I.device_id AND ( I.ignore = '1' OR D.ignore = '1')"),0);
|
||||
$ports['errored'] = mysql_result(mysql_query("SELECT count(*) FROM ports AS I, devices AS D WHERE D.device_id = I.device_id AND ( I.ignore = '0' OR D.ignore = '0') AND (I.ifInErrors_delta > '0' OR I.ifOutErrors_delta > '0')"),0);
|
||||
|
||||
|
||||
$services['count'] = mysql_result(mysql_query("SELECT count(service_id) FROM services"),0);
|
||||
@@ -29,11 +29,11 @@ $services['disabled'] = mysql_result(mysql_query("SELECT count(service_id) FROM
|
||||
$devices['down'] = mysql_result(mysql_query("SELECT count(D.device_id) FROM devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND D.status = '0' AND D.ignore = '0'"),0);
|
||||
$devices['disabled'] = mysql_result(mysql_query("SELECT count(D.device_id) FROM devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND D.ignore = '1'"),0);
|
||||
|
||||
$interfaces['count'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces AS I, devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND I.device_id = D.device_id"),0);
|
||||
$interfaces['up'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces AS I, devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND I.device_id = D.device_id AND ifOperStatus = 'up'"),0);
|
||||
$interfaces['down'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces AS I, devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up'"),0);
|
||||
$interfaces['disabled'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces AS I, devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND I.device_id = D.device_id AND ifAdminStatus = 'down'"),0);
|
||||
$interfaces['errored'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces AS I, devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND I.device_id = D.device_id AND (I.in_errors > '0' OR I.out_errors > '0')"),0);
|
||||
$ports['count'] = mysql_result(mysql_query("SELECT count(*) FROM ports AS I, devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND I.device_id = D.device_id"),0);
|
||||
$ports['up'] = mysql_result(mysql_query("SELECT count(*) FROM ports AS I, devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND I.device_id = D.device_id AND ifOperStatus = 'up'"),0);
|
||||
$ports['down'] = mysql_result(mysql_query("SELECT count(*) FROM ports AS I, devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up'"),0);
|
||||
$ports['disabled'] = mysql_result(mysql_query("SELECT count(*) FROM ports AS I, devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND I.device_id = D.device_id AND ifAdminStatus = 'down'"),0);
|
||||
$ports['errored'] = mysql_result(mysql_query("SELECT count(*) FROM ports AS I, devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND I.device_id = D.device_id AND (I.in_errors > '0' OR I.out_errors > '0')"),0);
|
||||
|
||||
$services['count'] = mysql_result(mysql_query("SELECT count(service_id) FROM services AS S, devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND S.service_host = D.device_id"),0);
|
||||
$services['up'] = mysql_result(mysql_query("SELECT count(service_id) FROM services AS S, devices AS D, devices_perms AS P WHERE P.user_id = '" . $_SESSION['user_id'] . "' AND P.device_id = D.device_id AND S.service_host = D.device_id AND service_status = '1' AND service_ignore ='0'"),0);
|
||||
@@ -43,7 +43,7 @@ $services['disabled'] = mysql_result(mysql_query("SELECT count(service_id) FROM
|
||||
}
|
||||
|
||||
if($devices['down']) { $devices['bgcolour'] = "#ffcccc"; } else { $devices['bgcolour'] = "transparent"; }
|
||||
if($interfaces['down']) { $interfaces['bgcolour'] = "#ffcccc"; } else { $interfaces['bgcolour'] = "#e5e5e5"; }
|
||||
if($ports['down']) { $ports['bgcolour'] = "#ffcccc"; } else { $ports['bgcolour'] = "#e5e5e5"; }
|
||||
if($services['down']) { $services['bgcolour'] = "#ffcccc"; } else { $services['bgcolour'] = "transparent"; }
|
||||
|
||||
?>
|
||||
@@ -62,14 +62,14 @@ if($services['down']) { $services['bgcolour'] = "#ffcccc"; } else { $services['b
|
||||
<td> ) </td>
|
||||
<td width=5></td>
|
||||
</tr>
|
||||
<tr style="background-color: <?php echo $interfaces['bgcolour'] ?>">
|
||||
<tr style="background-color: <?php echo $ports['bgcolour'] ?>">
|
||||
<td width="5"></td><td>Interfaces : </td>
|
||||
<td><?php echo $interfaces['count'] ?></td>
|
||||
<td><?php echo $ports['count'] ?></td>
|
||||
<td> ( </td>
|
||||
<td style='text-align: right'><span class=green> <?php echo $interfaces['up'] ?> up </span></td>
|
||||
<td style='text-align: right'><span class="red"> <?php echo $interfaces['down'] ?> down </span></td>
|
||||
<td style='text-align: right'><span class="black"> <?php echo $interfaces['ignored'] ?> ignored </span></td>
|
||||
<td style='text-align: right'><span class="grey"> <?php echo $interfaces['shutdown'] ?> shutdown</span></td>
|
||||
<td style='text-align: right'><span class=green> <?php echo $ports['up'] ?> up </span></td>
|
||||
<td style='text-align: right'><span class="red"> <?php echo $ports['down'] ?> down </span></td>
|
||||
<td style='text-align: right'><span class="black"> <?php echo $ports['ignored'] ?> ignored </span></td>
|
||||
<td style='text-align: right'><span class="grey"> <?php echo $ports['shutdown'] ?> shutdown</span></td>
|
||||
<td> ) </td>
|
||||
<td width=5></td>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user