Esempio n. 1
0
		display_help();
		exit;
	}
}

/* record the start time */
list($micro,$seconds) = split(" ", microtime());
$start = $seconds + $micro;

/* open a pipe to rrdtool for writing */
$rrdtool_pipe = rrd_init();

$rrds_processed = 0;

while (db_fetch_cell("SELECT count(*) FROM poller_output") > 0) {
	$rrds_processed = $rrds_processed + process_poller_output($rrdtool_pipe, FALSE);
}

echo "There were $rrds_processed, RRD updates made this pass\n";

rrd_close($rrdtool_pipe);

/*	display_help - displays the usage of the function */
function display_help () {
	print "Cacti Empty Poller Output Table Script 1.0, Copyright 2007 - The Cacti Group\n\n";
	print "usage: poller_output_empty.php [-h] [--help] [-v] [--version]\n\n";
	print "-v --version  - Display this help message\n";
	print "-h --help     - Display this help message\n";
}

?>
Esempio n. 2
0
				"Hosts: %s, " .
				"Hosts/Process: %s",
				round($end-$start,4),
				$method,
				$concurrent_processes,
				$max_threads,
				sizeof($polling_hosts),
				$hosts_per_file),true,"SYSTEM");

			break;
		}else {
			if (read_config_option("log_verbosity") >= POLLER_VERBOSITY_MEDIUM) {
				print "Waiting on " . ($process_file_number - sizeof($polling_items)) . "/$process_file_number pollers.\n";
			}

			process_poller_output($rrdtool_pipe);

			/* end the process if the runtime exceeds MAX_POLLER_RUNTIME */
			if (($start + MAX_POLLER_RUNTIME) < time()) {
				rrd_close($rrdtool_pipe);
				cacti_log("Maximum runtime of " . MAX_POLLER_RUNTIME . " seconds exceeded. Exiting.", true, "POLLER");
				exit;
			}

			sleep(1);
			$loop_count++;
		}
	}

	rrd_close($rrdtool_pipe);