From d4bfb3538908244e61c18ac306ea1945b92fda03 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Wed, 4 Apr 2007 10:43:23 +0000 Subject: [PATCH] fixing things! git-svn-id: http://www.observium.org/svn/observer/trunk@55 61d68cd4-352d-0410-923a-c4978735b2b8 --- cron-minute.sh | 22 +++++----------------- html/includes/print-event.inc | 15 +++++++++------ html/pages/devices.php | 16 +++++++++++----- poll-interface.php | 14 +++++++------- poll-os.php | 7 ------- 5 files changed, 32 insertions(+), 42 deletions(-) diff --git a/cron-minute.sh b/cron-minute.sh index ff20a181c..a80ac2040 100755 --- a/cron-minute.sh +++ b/cron-minute.sh @@ -1,26 +1,14 @@ #!/bin/bash ./process-syslog.php -sleep 5 +sleep 10 ./process-syslog.php & -sleep 5 +sleep 10 ./process-syslog.php & -sleep 5 +sleep 10 ./process-syslog.php & -sleep 5 +sleep 10 ./process-syslog.php & -sleep 5 -./process-syslog.php & -sleep 5 -./process-syslog.php & -sleep 5 -./process-syslog.php & -sleep 5 -./process-syslog.php & -sleep 5 -./process-syslog.php & -sleep 5 -./process-syslog.php & -sleep 5 +sleep 10 ./process-syslog.php & diff --git a/html/includes/print-event.inc b/html/includes/print-event.inc index 19241be69..483ad95e4 100644 --- a/html/includes/print-event.inc +++ b/html/includes/print-event.inc @@ -15,7 +15,7 @@ if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; } echo(" - $entry[datetime] + " . $entry['datetime'] . " "); if(!$_GET[id] && !$overview) { $dev['id'] = $entry['host']; @@ -25,14 +25,17 @@ if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; } "); } - $if['id'] = $entry[interface]; + echo(""); + + if($if['id']) { + $if['id'] = $entry['interface']; $if['if'] = $interface; - echo(" - " . generateiflink($if) . " - + echo(generateiflink($if)); + } + echo(""); $icon - $entry[message] + " . $entry['message'] . " "); diff --git a/html/pages/devices.php b/html/pages/devices.php index 92aa229f1..2749e44b8 100644 --- a/html/pages/devices.php +++ b/html/pages/devices.php @@ -1,16 +1,22 @@ "); while($device = mysql_fetch_array($device_query)) { + $device[uptime] = @mysql_result(mysql_query("SELECT device_uptime FROM device_uptime WHERE device_id = '" . $device[id] ."'" ), 0); include("includes/hostbox.inc"); } diff --git a/poll-interface.php b/poll-interface.php index 0d2a106ad..90dde221d 100755 --- a/poll-interface.php +++ b/poll-interface.php @@ -68,13 +68,13 @@ while ($interface = mysql_fetch_array($interface_query)) { if ( $old_if != $ifDescr && $ifDescr != "" ) { $update = "`if` = '$ifDescr'"; $seperator = ", "; - mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'Name: $old_if -> $ifDescr')"); + mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'Name -> $ifDescr')"); } if ( $old_alias != $ifAlias ) { $update .= $seperator . "`name` = \"$ifAlias\""; $seperator = ", "; - mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'Desc: $old_alias -> $ifAlias')"); + mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'Desc -> $ifAlias')"); } if ( $old_up != $ifOperStatus && $ifOperStatus != "" ) { $update .= $seperator . "`up` = '$ifOperStatus'"; @@ -90,22 +90,22 @@ while ($interface = mysql_fetch_array($interface_query)) { if ( $old_duplex != $ifDuplex && $ifDuplex != "" ) { $update .= $seperator . "`ifDuplex` = '$ifDuplex'"; $seperator = ", "; - mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'Duplex changed to $ifDuplex')"); + mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'Duplex -> $ifDuplex')"); } if ( $old_type != $ifType && $ifType != "" ) { $update .= $seperator . "`ifType` = '$ifType'"; $seperator = ", "; - mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'Type changed to $ifType')"); + mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'Type -> $ifType')"); } if ( $old_mtu != $ifMtu && $ifMtu != "" ) { $update .= $seperator . "`ifMtu` = '$ifMtu'"; $seperator = ", "; - mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'MTU changed to $ifMtu')"); + mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'MTU -> $ifMtu')"); } if ( $old_physaddress != $ifPhysAddress && $ifPhysAddress != "" ) { $update .= $seperator . "`ifPhysAddress` = '$ifPhysAddress'"; $seperator = ", "; - mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'MAC changed to $ifPhysAddress')"); + mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'MAC -> $ifPhysAddress')"); } if ( $old_speed != $ifSpeed && $ifSpeed != "" ) { @@ -113,7 +113,7 @@ while ($interface = mysql_fetch_array($interface_query)) { $seperator = ", "; $prev = humanspeed($old_speed); $now = humanspeed($ifSpeed); - mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'Speed changed from $prev -> $now')"); + mysql_query("INSERT INTO eventlog (host, interface, datetime, message) values ($interface[host], $interface[sqlid], NOW(), 'Speed -> $now')"); } if ($update) { diff --git a/poll-os.php b/poll-os.php index 78acabfc7..8decedc5d 100755 --- a/poll-os.php +++ b/poll-os.php @@ -1,16 +1,9 @@ #!/usr/bin/php