Example #1
0
}
if ($_REQUEST["step"] == "4") {
    include_once "../lib/data_query.php";
    include_once "../lib/utility.php";
    $i = 0;
    /* get all items on the form and write values for them  */
    while (list($name, $array) = each($input)) {
        if (isset($_POST[$name])) {
            db_execute("update settings set value='" . $_POST[$name] . "' where name='{$name}'");
        }
    }
    setcookie(session_name(), "", time() - 3600, "/");
    kill_session_var("sess_config_array");
    kill_session_var("sess_host_cache_array");
    /* just in case we have hard drive graphs to deal with */
    api_data_query_execute(db_fetch_cell("select id from host where hostname='127.0.0.1'"), 6);
    /* it's always a good idea to re-populate the poller cache to make sure everything is refreshed and
    	up-to-date */
    repopulate_poller_cache();
    db_execute("delete from version");
    db_execute("insert into version (cacti) values ('" . CACTI_VERSION . "')");
    header("Location: ../index.php");
    exit;
} elseif ($_REQUEST["step"] == "8" && $_REQUEST["install_type"] == "3") {
    /* if the version is not found, die */
    if (!is_int($old_version_index)) {
        print "\t<p style='font-family: Verdana, Arial; font-size: 16px; font-weight: bold; color: red;'>Error</p>\n\t\t\t<p style='font-family: Verdana, Arial; font-size: 12px;'>Invalid Cacti version\n\t\t\t<strong>{$old_cacti_version}</strong>, cannot upgrade to <strong>" . CACTI_VERSION . "\n\t\t\t</strong></p>";
        exit;
    }
    /* loop from the old version to the current, performing updates for each version in between */
    for ($i = $old_version_index + 1; $i < count($cacti_versions); $i++) {
Example #2
0
function host_reload_query()
{
    api_data_query_execute($_GET["host_id"], $_GET["id"]);
}
Example #3
0
			list($host_id, $data_query_id) = explode(":", $command["command"]);
				if ($last_host_id != $host_id) {
				$last_host_id = $host_id;
				$first_host = true;
				$recached_hosts++;
			} else {
				$first_host = false;
			}

			if ($first_host) {
				log_save(_("Host[$host_id] WARNING: Recache Event Detected for Host"), SEV_WARNING, FACIL_POLLER, "", $poller_id, 0, true);
			}

			log_save(_("Host[$host_id] RECACHE: Re-cache for Host, data query #$data_query_id"), SEV_NOTICE, FACIL_POLLER, "", $poller_id, 0, true);

			api_data_query_execute($host_id, $data_query_id);

			log_save(_("Host[$host_id] RECACHE: Re-cache successful."), SEV_NOTICE, FACIL_POLLER, "", $poller_id, 0, true);

			break;
		case POLLER_COMMAND_RRDPURGE:
			log_save(sprintf("_(Host[%i] PURGE: Unused RRDfile removed from system '%s')", $host_id, $command),SEV_NOTICE,  FACIL_POLLER, "", $poller_id, 0, 0, true);

			if (file_exists($command)) {
				@unlink($command);
			}

			break;
		default:
			cacti_log("Unknown poller command issued", SEV_ERROR, $poller_id, 0, 0, true, FACIL_POLLER);
		}