mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Moving around polling files...
git-svn-id: http://www.observium.org/svn/observer/trunk@72 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
$type = strtolower($device['os']);
|
||||
unset($image);
|
||||
|
||||
$image = getImage($device[id]);
|
||||
$image = getImage($device['device_id']);
|
||||
|
||||
echo("
|
||||
<tr bgcolor='$bg'>
|
||||
|
@@ -4,31 +4,31 @@ if(!$samehost) {
|
||||
if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg = $list_colour_a; }
|
||||
}
|
||||
|
||||
$service_type = strtolower($service[service_type]);
|
||||
$service_type = strtolower($service['service_type']);
|
||||
|
||||
if($service[service_status] == '0') {$status = "<span class=red><b>$service_type</b></span>";
|
||||
} elseif ($service[service_status] == '1') {$status = "<span class=green><b>$service_type</b></span>";
|
||||
} elseif ($service[service_status] == '2') {$status = "<span class=grey><b>$service_type</b></span>";}
|
||||
|
||||
$message = trim($service[service_message]);
|
||||
$message = trim($service['service_message']);
|
||||
$message = str_replace("\n", "<br />", $message);
|
||||
|
||||
$since = time() - $service[service_changed];
|
||||
$since = time() - $service['service_changed'];
|
||||
$since = formatUptime($since);
|
||||
|
||||
if($service[service_checked]) {
|
||||
$checked = time() - $service[service_checked];
|
||||
if($service['service_checked']) {
|
||||
$checked = time() - $service['service_checked'];
|
||||
$checked = formatUptime($checked);
|
||||
} else { $checked = "Never"; }
|
||||
|
||||
|
||||
echo("
|
||||
<tr style=\"background-color: $bg; padding: 5px;\"><td valign=top>$service[service_id].</td>");
|
||||
<tr style=\"background-color: $bg; padding: 5px;\"><td valign=top>" . $service['service_id'] . ".</td>");
|
||||
|
||||
if($device_id) {
|
||||
if(!$samehost) {
|
||||
$device[id] = $device_id;
|
||||
$device[hostname] = $device_hostname;
|
||||
$device['device_id'] = $device_id;
|
||||
$device['hostname'] = $device_hostname;
|
||||
echo("<td valign=top width=200><span style='font-weight:bold;'>" . generatedevicelink($device) . "</span></td>");
|
||||
} else {
|
||||
echo("<td></td>");
|
||||
@@ -49,5 +49,4 @@ echo("
|
||||
|
||||
$i++;
|
||||
|
||||
|
||||
?>
|
||||
|
@@ -6,12 +6,12 @@ echo("<div style='margin: 5px;'><table cellpadding=7 border=0 cellspacing=0 widt
|
||||
//echo("<tr class=interface-desc bgcolor='#e5e5e5'><td>Device</td><td>Service</td><td>Status</td><td>Changed</td><td>Checked</td><td>Message</td></tr>");
|
||||
|
||||
|
||||
$host_sql = "SELECT D.id, D.hostname FROM devices AS D, services AS S WHERE D.id = S.service_host GROUP BY D.hostname ORDER BY D.hostname";
|
||||
$host_sql = "SELECT * FROM devices AS D, services AS S WHERE D.device_id = S.service_host GROUP BY D.hostname ORDER BY D.hostname";
|
||||
$host_query = mysql_query($host_sql);
|
||||
while($host_data = mysql_fetch_array($host_query)) {
|
||||
$device_id = $host_data[id];
|
||||
$device_hostname = $host_data[hostname];
|
||||
$service_query = mysql_query("SELECT * FROM `services` WHERE `service_host` = '$host_data[id]' $where");
|
||||
$device_id = $host_data['device_id'];
|
||||
$device_hostname = $host_data['hostname'];
|
||||
$service_query = mysql_query("SELECT * FROM `services` WHERE `service_host` = '" . $host_data['device_id'] . "' $where");
|
||||
while($service = mysql_fetch_array($service_query)) {
|
||||
include("includes/print-service.inc");
|
||||
$samehost = 1;
|
||||
|
Reference in New Issue
Block a user