update changelog, clean up files

git-svn-id: http://www.observium.org/svn/observer/trunk@1893 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-16 22:04:29 +00:00
parent 2d5eee1c95
commit 39dc6e9053
7 changed files with 127 additions and 115 deletions
+2
View File
@@ -18,6 +18,8 @@ SVN 0.10-current
* Add support for XUPS-MIB for Eaton devices
* Add support for JunOS BGP prefix counters
* Add support for Ingrasys iPoMan 1200 series PDUs
* Add support for Socomec Net Vision UPS systems
* Add support for ServerTech Sentry3 power systems
* MySQL and nginx application pollers
* Add support for IPMI polling on servers
* Add a new discovery parameter to only discover new devices, this can be run every 5 minutes
+4 -3
View File
@@ -6,7 +6,8 @@ include("config.php");
include("includes/functions.php");
$alert_query = mysql_query("SELECT *, A.id as id FROM `alerts` as A, `devices` as D where A.device_id = D.device_id AND alerted = '0'");
while ($alert = mysql_fetch_array($alert_query)) {
while ($alert = mysql_fetch_array($alert_query))
{
$id = $alert['id'];
$host = $alert['hostname'];
$date = $alert['time_logged'];
@@ -14,10 +15,10 @@ while ($alert = mysql_fetch_array($alert_query)) {
$alert_text .= "$date $host $msg";
mysql_query("UPDATE `alerts` SET alerted = '1' WHERE `id` = '$id'");
}
if($alert_text) {
if ($alert_text)
{
echo("$alert_text");
# `echo '$alert_text' | gnokii --sendsms <NUMBER>`;
}
+10 -2
View File
@@ -4,10 +4,18 @@
include("config.php");
include("includes/functions.php");
$data = trim(shell_exec("cat ".$argv[1]));
$fd = fopen($argv[1],'r');
$data = fread($fd,4096);
while (!feof($fd))
{
$data .= fread($fd,4096);
}
foreach( explode("\n", $data) as $line) {
foreach (explode("\n", $data) as $line)
{
$update = mysql_query($line);
# FIXME check query success?
echo("$line \n");
}
?>
+3 -2
View File
@@ -16,10 +16,12 @@
$device = @mysql_fetch_array(mysql_query("SELECT * FROM devices WHERE `hostname` = '".$entry['0']."'"));
if(!$device['device_id']) {
if (!$device['device_id'])
{
$device = @mysql_fetch_array(mysql_query("SELECT * FROM ipv4_addresses AS A, ports AS I WHERE
A.ipv4_address = '" . $entry['0']."' AND I.interface_id = A.interface_id"));
}
if (!$device['device_id']) { exit; } else { }
print_r($device);
@@ -27,5 +29,4 @@
$file = $config['install_dir'] . "/includes/snmptrap/".$entry['1'].".inc.php";
if (is_file($file)) { include("$file"); } else { echo("unknown trap ($file)"); exit; }
?>