--- cacti-0.8.6d/cmd.php 2005-04-26 20:47:35.000000000 -0400 +++ cacti-0.8.6d-new/cmd.php 2005-05-15 16:04:44.000000000 -0400 @@ -132,7 +132,12 @@ if ($current_host != $last_host) { $new_host = true; + + /* assume the host is up */ $host_down = false; + + /* assume we don't have to spike prevent */ + $set_spike_kill = false; } $host_id = $item["host_id"]; @@ -153,10 +158,6 @@ $ping_availability = read_config_option("availability_method"); } - /* for this host, get it's current status for spike detection and set default spike value */ - //$pre_host_status = $hosts[$host_id]["status"]; - $set_spike_kill = FALSE; - /* if we are only allowed to use an snmp check and this host does not support snnp, we must assume that this host is up */ if (($ping_availability == AVAIL_SNMP) && ($item["snmp_community"] == "")) { @@ -229,8 +230,9 @@ /* spike kill logic */ if (($assert_fail) && ($index_item["arg1"] == ".1.3.6.1.2.1.1.3.0")) { + /* don't spike kill unless we are certain */ + if (!empty($output)) { $set_spike_kill = true; - $set_spike_kill_time = date("Y-m-d H:i:s", strtotime($poller_update_time)); if (read_config_option("log_verbosity") == POLLER_VERBOSITY_DEBUG) { cacti_log("Host[$host_id] NOTICE: Spike Kill in Effect for '" . $item["hostname"] . "'.", $print_data_to_stdout); @@ -240,6 +242,7 @@ } } } + } $new_host = false; $last_host = $current_host; @@ -324,9 +327,9 @@ } /* End Switch */ if (isset($output)) { - /* insert a NaN in place of the actual value if the snmp agent restarts */ + /* insert a U in place of the actual value if the snmp agent restarts */ if (($set_spike_kill) && (!substr_count($output, ":"))) { - db_execute("insert into poller_output (local_data_id,rrd_name,time,output) values (" . $item["local_data_id"] . ",'" . $item["rrd_name"] . "','$set_spike_kill_time','" . addslashes("nan") . "')"); + db_execute("insert into poller_output (local_data_id,rrd_name,time,output) values (" . $item["local_data_id"] . ",'" . $item["rrd_name"] . "','$poller_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"] . "','$poller_update_time','" . addslashes($output) . "')");