make poller logging more forgiving

git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/branches/BRANCH_0_8_6/cacti@3757 860744bd-22fc-0310-8c96-e9fe5004b5ca
This commit is contained in:
Larry Adams committed 2006-08-29 03:08:56 +00:00
1 parent 98ef565d7a
commit 34ef1da05b
2 files changed
+12 -12

No files matched your search

+5 -5
View File
@@ -220,15 +220,15 @@ if ((sizeof($polling_items) > 0) && (read_config_option("poller_enabled") == "on
/* assert the result with the expected value in the db; recache if the assert fails */
if (($index_item["op"] == "=") && ($index_item["assert_value"] != trim($output))) {
cacti_log("ASSERT: '" . $index_item["assert_value"] . "=" . trim($output) . "' failed. Recaching host '" . $item["hostname"] . "', data query #" . $index_item["data_query_id"], $print_data_to_stdout);
db_execute("insert into poller_command (poller_id,time,action,command) values (0,NOW()," . POLLER_COMMAND_REINDEX . ",'" . $item["host_id"] . ":" . $index_item["data_query_id"] . "')");
db_execute("insert into poller_command (poller_id, time, action, command) values (0, NOW(), " . POLLER_COMMAND_REINDEX . ", '" . $item["host_id"] . ":" . $index_item["data_query_id"] . "')");
$assert_fail = true;
}else if (($index_item["op"] == ">") && ($index_item["assert_value"] < trim($output))) {
cacti_log("ASSERT: '" . $index_item["assert_value"] . ">" . trim($output) . "' failed. Recaching host '" . $item["hostname"] . "', data query #" . $index_item["data_query_id"], $print_data_to_stdout);
db_execute("insert into poller_command (poller_id,time,action,command) values (0,NOW()," . POLLER_COMMAND_REINDEX . ",'" . $item["host_id"] . ":" . $index_item["data_query_id"] . "')");
db_execute("insert into poller_command (poller_id, time, action, command) values (0, NOW(), " . POLLER_COMMAND_REINDEX . ", '" . $item["host_id"] . ":" . $index_item["data_query_id"] . "')");
$assert_fail = true;
}else if (($index_item["op"] == "<") && ($index_item["assert_value"] > trim($output))) {
cacti_log("ASSERT: '" . $index_item["assert_value"] . "<" . trim($output) . "' failed. Recaching host '" . $item["hostname"] . "', data query #" . $index_item["data_query_id"], $print_data_to_stdout);
db_execute("insert into poller_command (poller_id,time,action,command) values (0,NOW()," . POLLER_COMMAND_REINDEX . ",'" . $item["host_id"] . ":" . $index_item["data_query_id"] . "')");
db_execute("insert into poller_command (poller_id, time, action, command) values (0, NOW(), " . POLLER_COMMAND_REINDEX . ", '" . $item["host_id"] . ":" . $index_item["data_query_id"] . "')");
$assert_fail = true;
}
@@ -348,7 +348,7 @@ if ((sizeof($polling_items) > 0) && (read_config_option("poller_enabled") == "on
db_execute("insert into poller_output (local_data_id,rrd_name,time,output) values (" . $item["local_data_id"] . ",'" . $item["rrd_name"] . "','$host_update_time','" . addslashes("U") . "')");
/* otherwise, just insert the value received from the poller */
}else{
db_execute("insert into poller_output (local_data_id,rrd_name,time,output) values (" . $item["local_data_id"] . ",'" . $item["rrd_name"] . "','$host_update_time','" . addslashes($output) . "')");
db_execute("insert into poller_output (local_data_id, rrd_name, time, output) values (" . $item["local_data_id"] . ", '" . $item["rrd_name"] . "', '$host_update_time', '" . addslashes($output) . "')");
}
}
} /* Next Cache Item */
@@ -383,4 +383,4 @@ if ((sizeof($polling_items) > 0) && (read_config_option("poller_enabled") == "on
/* Let the poller server know about cmd.php being finished */
db_execute("insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())");
?>
?>