Changed id field in devices table to device_id (!!!1!!1!!eleven!1)

git-svn-id: http://www.observium.org/svn/observer/trunk@69 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2007-04-08 14:34:19 +00:00
parent ff04606a2f
commit e52334f578
20 changed files with 151 additions and 367 deletions

View File

@@ -1,16 +1,16 @@
<?php
$daily_traffic = "graph.php?host=$device[id]&type=$graph_type&from=$day&to=$now&width=215&height=100";
$daily_url = "graph.php?host=$device[id]&type=$graph_type&from=$day&to=$now&width=400&height=150";
$daily_traffic = "graph.php?host=" . $device['device_id'] . "&type=$graph_type&from=$day&to=$now&width=215&height=100";
$daily_url = "graph.php?host=" . $device['device_id'] . "&type=$graph_type&from=$day&to=$now&width=400&height=150";
$weekly_traffic = "graph.php?host=$device[id]&type=$graph_type&from=$week&to=$now&width=215&height=100";
$weekly_url = "graph.php?host=$device[id]&type=$graph_type&from=$week&to=$now&width=400&height=150";
$weekly_traffic = "graph.php?host=" . $device['device_id'] . "&type=$graph_type&from=$week&to=$now&width=215&height=100";
$weekly_url = "graph.php?host=" . $device['device_id'] . "&type=$graph_type&from=$week&to=$now&width=400&height=150";
$monthly_traffic = "graph.php?host=$device[id]&type=$graph_type&from=$month&to=$now&width=215&height=100";
$monthly_url = "graph.php?host=$device[id]&type=$graph_type&from=$month&to=$now&width=400&height=150";
$monthly_traffic = "graph.php?host=" . $device['device_id'] . "&type=$graph_type&from=$month&to=$now&width=215&height=100";
$monthly_url = "graph.php?host=" . $device['device_id'] . "&type=$graph_type&from=$month&to=$now&width=400&height=150";
$yearly_traffic = "graph.php?host=$device[id]&type=$graph_type&from=$year&to=$now&width=215&height=100";
$yearly_url = "graph.php?host=$device[id]&type=$graph_type&from=$year&to=$now&width=400&height=150";
$yearly_traffic = "graph.php?host=" . $device['device_id'] . "&type=$graph_type&from=$year&to=$now&width=215&height=100";
$yearly_url = "graph.php?host=" . $device['device_id'] . "&type=$graph_type&from=$year&to=$now&width=400&height=150";
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$daily_traffic' border=0></a> ");

View File

@@ -7,15 +7,14 @@
$query_a = mysql_query("SELECT * FROM `devices`");
while($device = mysql_fetch_array($query_a)) {
if($device[status] == 0 && $device[ignore] == '0') { $this_alert = "1"; } elseif($device[ignore] == '0') {
if($device['status'] == 0 && $device['ignore'] == '0') { $this_alert = "1"; } elseif($device['ignore'] == '0') {
if(mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_status = '0' AND service_host = '$device[id]'"),0)) { $this_alert = "1"; }
if(mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' AND device_id = '$device[id]'"),0)) { $this_alert = "1"; }
if(mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' AND device_id = '" . $device[device_id] . "'"),0)) { $this_alert = "1"; }
}
if($this_alert) {
$device_alerts++;
$device_alert_sql .= " OR `id` = '$device[id]'";
$device_alert_sql .= " OR `device_id` = '" . $device['device_id'] . "'";
}
unset($this_alert);
}

View File

@@ -1,9 +1,9 @@
<?php
$devices['count'] = mysql_result(mysql_query("SELECT count(id) FROM devices"),0);
$devices['up'] = mysql_result(mysql_query("SELECT count(id) FROM devices WHERE status = '1' AND `ignore` = '0'"),0);
$devices['down'] = mysql_result(mysql_query("SELECT count(id) FROM devices WHERE status = '0' AND `ignore` = '0'"),0);
$devices['disabled'] = mysql_result(mysql_query("SELECT count(id) FROM devices WHERE `ignore` = '1'"),0);
$devices['count'] = mysql_result(mysql_query("SELECT count(*) FROM devices"),0);
$devices['up'] = mysql_result(mysql_query("SELECT count(*) FROM devices WHERE status = '1' AND `ignore` = '0'"),0);
$devices['down'] = mysql_result(mysql_query("SELECT count(*) FROM devices WHERE status = '0' AND `ignore` = '0'"),0);
$devices['disabled'] = mysql_result(mysql_query("SELECT count(*) FROM devices WHERE `ignore` = '1'"),0);
$interfaces['count'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces"),0);
$interfaces['up'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE ifOperStatus = 'up'"),0);