Ejemplo n.º 1
0
				$start = $seconds + $micro;

				db_execute("REPLACE INTO settings (name, value) VALUES ('mt_last_run_time', '$current_time')");

				collect_mactrack_data($start, $site_id);
				log_mactrack_statistics("collect");
			}

			if ($time_till_next_db_maint < 0) {
				/* take time and log performance data */
				list($micro,$seconds) = explode(" ", microtime());
				$start = $seconds + $micro;

				db_execute("REPLACE INTO settings (name, value) VALUES ('mt_last_db_maint_time', '$current_time')");
				perform_mactrack_db_maint();
				log_mactrack_statistics("maint");
			}
		}
	}
}

/*	display_help - displays the usage of the function */
function display_help () {
	$version = mactrack_version();
	print "MacTrack Master Poller v" . $version["version"] . ", Copyright 2004-2010 - The Cacti Group\n\n";
	print "usage: poller_mactrack.php [-sid=site_id] [-d] [-h] [--help] [-v] [--version]\n\n";
	print "-sid=site_id  - The mac_track_sites site_id to scan\n";
	print "-w | --web    - Display output suitable for the web\n";
	print "-f | --force  - Force the execution of a collection process\n";
	print "-d | --debug  - Display verbose output during execution\n";
	print "-v --version  - Display this help message\n";
Ejemplo n.º 2
0
            if ($time_till_next_run < 0 || $forcerun == TRUE) {
                mactrack_debug('Either a scan has been forced, or it\'s time to check for macs');
                /* take time and log performance data */
                list($micro, $seconds) = explode(' ', microtime());
                $start = $seconds + $micro;
                db_execute("REPLACE INTO settings (name, value) VALUES ('mt_last_run_time', '{$current_time}')");
                collect_mactrack_data($start, $site_id);
                log_mactrack_statistics('collect');
            }
            if ($time_till_next_db_maint < 0) {
                /* take time and log performance data */
                list($micro, $seconds) = explode(' ', microtime());
                $start = $seconds + $micro;
                db_execute("REPLACE INTO settings (name, value) VALUES ('mt_last_db_maint_time', '{$current_time}')");
                perform_mactrack_db_maint();
                log_mactrack_statistics('maint');
            }
        }
    }
    /* show errors now */
    errors_restore();
}
function errors_disable()
{
    global $track_errors;
    $track_errors = ini_get('track_errors');
    ini_set('track_errors', 0);
}
function errors_restore()
{
    global $track_errors;